Bug 1491907 - Set correct branch URL for Thunderbird based on product-details r=bhearsum
authorRob Lemley <rob@thunderbird.net>
Mon, 24 Sep 2018 08:21:17 +0000
changeset 487244 f9cf6e98fc4bbaebf12fe6c101adc6f7ff8702c7
parent 487243 5688a792346d144f2f7a2ac511d8f0d84dc217c6
child 487245 b96cec26d463643b2dc0347930cf2561bfcb0071
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersbhearsum
bugs1491907
milestone64.0a1
Bug 1491907 - Set correct branch URL for Thunderbird based on product-details r=bhearsum Thunderbird releases come from the comm-esr.* repositories rather than the comm-release repository. This adds a special case for Thunderbird and sets the branch URL correctly. This initial patch is based on the branch_prefix (comm or mozilla). Differential Revision: https://phabricator.services.mozilla.com/D6509
testing/mozharness/scripts/release/update-verify-config-creator.py
--- a/testing/mozharness/scripts/release/update-verify-config-creator.py
+++ b/testing/mozharness/scripts/release/update-verify-config-creator.py
@@ -200,48 +200,63 @@ class UpdateVerifyConfigCreator(BaseScri
             self.config["previous_archive_prefix"] = self.config["archive_prefix"]
         self.config["archive_prefix"].rstrip("/")
         self.config["previous_archive_prefix"].rstrip("/")
         self.config["mar_channel_id_overrides"] = {}
         for override in self.config["mar_channel_id_options"]:
             pattern, override_str = override.split(",", 1)
             self.config["mar_channel_id_overrides"][pattern] = override_str
 
+    def _get_branch_url(self, category, branch_prefix, version):
+        branch = None
+        if category == "dev":
+            branch = "releases/{}-beta".format(branch_prefix)
+        elif category == "esr":
+            branch = "releases/{}-esr{}".format(branch_prefix, version[:2])
+        elif category in ("major", "stability"):
+            if branch_prefix == "comm":
+                # Thunderbird does not have ESR releases, regular releases
+                # go in an ESR branch
+                branch = "releases/{}-esr{}".format(branch_prefix, version[:2])
+            else:
+                branch = "releases/{}-release".format(branch_prefix)
+        if not branch:
+            raise Exception("Cannot determine branch, cannot continue!")
+
+        return branch
+
     def _get_update_paths(self):
         from mozrelease.l10n import getPlatformLocales
         from mozrelease.paths import getCandidatesDir
         from mozrelease.platforms import ftp2infoFile
         from mozrelease.versions import MozillaVersion
 
         self.update_paths = {}
 
         ret = self._retry_download(
             "{}/1.0/{}.json".format(
                 self.config["product_details_server"],
                 self.config["stage_product"],
             ),
             "WARNING",
         )
         releases = json.load(ret)["releases"]
-        for release_name, release_info in reversed(sorted(releases.items())):
-            product, version = release_name.split("-", 1)
+        for release_name, release_info in \
+            reversed(sorted(releases.items(),
+                            key=lambda x: MozillaVersion(x[1]['version']))):
+            product = release_info['product']
+            version = release_info['version']
+            category = release_info['category']
             tag = "{}_{}_RELEASE".format(product.upper(), version.replace(".", "_"))
             # Product details has a "category" for releases that we can use to
             # determine the repo path. This will fail if any previous releases
             # were built from a project branch - but that's not something we do
             # at the time of writing.
-            branch = None
-            if release_info["category"] == "dev":
-                branch = "releases/{}-beta".format(self.config['branch_prefix'])
-            elif release_info["category"] == "esr":
-                branch = "releases/{}-esr{}".format(self.config['branch_prefix'], version[:2])
-            elif release_info["category"] in ("major", "stability"):
-                branch = "releases/{}-release".format(self.config['branch_prefix'])
-            if not branch:
-                raise Exception("Cannot determine branch, cannot continue!")
+            branch = self._get_branch_url(category, self.config["branch_prefix"],
+                                          version)
 
             # Exclude any releases that don't match one of our include version
             # regexes. This is generally to avoid including versions from other
             # channels. Eg: including betas when testing releases
             for v in self.config["include_versions"]:
                 if re.match(v, version):
                     break
             else: