-
Notifications
You must be signed in to change notification settings - Fork 115
branches: add esr branch support (bug 2048638) #2198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1d428d1
ee89511
8f3bbdf
53b2caa
37378d0
5906f8f
67005e3
1f6ef9a
b786087
24e3167
3a4bd1b
afd4789
32615e2
8acc139
2c22584
9de2176
94e90f0
98c604c
882b42c
8584fc1
5564856
98c748b
549b535
fad17ec
c45c338
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |||||||
| from mozregression.errors import MozRegressionError | ||||||||
|
|
||||||||
| LOG = get_proxy_logger("Branches") | ||||||||
| RE_ESR = re.compile(r"^(?:(mozilla-|comm-))?esr(\d+)$", re.I) | ||||||||
|
|
||||||||
|
|
||||||||
| class Branches(object): | ||||||||
|
|
@@ -38,19 +39,33 @@ def set_alias(self, alias, branch_name): | |||||||
| self._aliases[alias] = branch_name | ||||||||
|
|
||||||||
| def get_url(self, branch_name_or_alias): | ||||||||
| name = self.get_name(branch_name_or_alias) | ||||||||
| try: | ||||||||
| return self._branches[self.get_name(branch_name_or_alias)] | ||||||||
| return self._branches[name] | ||||||||
| except KeyError: | ||||||||
| if RE_ESR.match(name): | ||||||||
| url = self.DEFAULT_REPO_URL + "releases/%s" % name | ||||||||
| return url | ||||||||
| raise MozRegressionError("No such branch '%s'." % branch_name_or_alias) | ||||||||
|
|
||||||||
| def get_name(self, branch_name_or_alias): | ||||||||
| if branch_name_or_alias: | ||||||||
| match = RE_ESR.match(branch_name_or_alias) | ||||||||
|
Comment on lines
+52
to
+53
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
Then later lines can be dedented. |
||||||||
| if match: | ||||||||
| prefix = match.group(1) | ||||||||
| if prefix: | ||||||||
| return "%sesr%s" % (prefix, match.group(2)) | ||||||||
| else: | ||||||||
| return "esr%s" % match.group(2) | ||||||||
| return self._aliases.get(branch_name_or_alias) or branch_name_or_alias | ||||||||
|
|
||||||||
| def get_category(self, branch_name_or_alias): | ||||||||
| name = self.get_name(branch_name_or_alias) | ||||||||
| for cat, names in self._categories.items(): | ||||||||
| if name in names: | ||||||||
| return cat | ||||||||
| if name and RE_ESR.match(name): | ||||||||
| return "releases" | ||||||||
|
|
||||||||
|
|
||||||||
| def create_branches(): | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -238,7 +238,20 @@ def set_repo(self, repo): | |||||||||||||||||
| If not set or set to None, default repos would be used (see | ||||||||||||||||||
| :meth:`get_nightly_repo` and :attr:`integration_branch`) | ||||||||||||||||||
| """ | ||||||||||||||||||
| self.repo = branches.get_name(repo) if repo else None | ||||||||||||||||||
| if repo: | ||||||||||||||||||
| name = branches.get_name(repo) | ||||||||||||||||||
| is_esr = name.startswith("esr") | ||||||||||||||||||
|
Comment on lines
+241
to
+243
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to reverse the logic here. Handle the general case first, and then handle the esr case. |
||||||||||||||||||
| if self.app_name == "thunderbird" and is_esr: | ||||||||||||||||||
| self.repo = "comm-" + name | ||||||||||||||||||
| elif self.app_name == "firefox" and is_esr: | ||||||||||||||||||
| self.repo = "mozilla-" + name | ||||||||||||||||||
| elif is_esr: | ||||||||||||||||||
| # A bare `esr` defaults to the Firefox (`mozilla`) repository. | ||||||||||||||||||
| self.repo = "mozilla-" + name | ||||||||||||||||||
|
Comment on lines
+246
to
+250
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit - I don't think adding the check for
Suggested change
|
||||||||||||||||||
| else: | ||||||||||||||||||
| self.repo = name | ||||||||||||||||||
| else: | ||||||||||||||||||
| self.repo = None | ||||||||||||||||||
|
|
||||||||||||||||||
| def should_use_archive(self): | ||||||||||||||||||
| """ | ||||||||||||||||||
|
|
@@ -559,11 +572,17 @@ class ThunderbirdIntegrationConfigMixin(IntegrationConfigMixin): | |||||||||||||||||
|
|
||||||||||||||||||
| def tk_routes(self, push): | ||||||||||||||||||
| for build_type in self.build_types: | ||||||||||||||||||
| yield "comm.v2.{}.revision.{}.thunderbird.{}-{}".format( | ||||||||||||||||||
| yield "comm.v2.{}{}.revision.{}.thunderbird.{}-{}".format( | ||||||||||||||||||
| self.integration_branch, | ||||||||||||||||||
| ( | ||||||||||||||||||
| ".shippable" | ||||||||||||||||||
| if self.integration_branch != "comm-central" | ||||||||||||||||||
| or (self.integration_branch == "comm-central" and build_type == "shippable") | ||||||||||||||||||
| else "" | ||||||||||||||||||
| ), | ||||||||||||||||||
| push.changeset, | ||||||||||||||||||
| _common_tk_part(self), | ||||||||||||||||||
| build_type, | ||||||||||||||||||
| "opt", | ||||||||||||||||||
|
Magnolia-Liu marked this conversation as resolved.
|
||||||||||||||||||
| ) | ||||||||||||||||||
| self._inc_used_build() | ||||||||||||||||||
| return | ||||||||||||||||||
|
|
@@ -675,6 +694,15 @@ def available_archs(self): | |||||||||||||||||
| class ThunderbirdConfig( | ||||||||||||||||||
| CommonConfig, ThunderbirdNightlyConfigMixin, ThunderbirdIntegrationConfigMixin | ||||||||||||||||||
| ): | ||||||||||||||||||
| BUILD_TYPES = ( | ||||||||||||||||||
| "shippable", | ||||||||||||||||||
| "opt", | ||||||||||||||||||
| ) | ||||||||||||||||||
| BUILD_TYPE_FALLBACKS = { | ||||||||||||||||||
| "shippable": ("opt",), | ||||||||||||||||||
| "opt": ("shippable",), | ||||||||||||||||||
| } | ||||||||||||||||||
|
Magnolia-Liu marked this conversation as resolved.
|
||||||||||||||||||
|
|
||||||||||||||||||
| pass | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is repeated a few times in this class. We could put this functionality in
self._esr_matchandself.is_esr_name.