Bug 1344229 - alter version bumping to prevent race conditions. r=rail a=release DONTBUILD
authorMihai Tabara <mtabara@mozilla.com>
Fri, 10 Mar 2017 23:24:12 +0000
changeset 379021 c32166f8c0c41147e320418ae7ce359a4edb94e3
parent 379020 e5eb0121a580e4b8acf53886861363f669a864ad
child 379022 a571068c57c875374166901a883e7a635c066e92
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrail, release
bugs1344229
milestone53.0
Bug 1344229 - alter version bumping to prevent race conditions. r=rail a=release DONTBUILD MozReview-Commit-ID: Fy38tKghu2M
testing/mozharness/scripts/release/postrelease_version_bump.py
--- a/testing/mozharness/scripts/release/postrelease_version_bump.py
+++ b/testing/mozharness/scripts/release/postrelease_version_bump.py
@@ -153,20 +153,27 @@ class PostReleaseVersionBump(MercurialSc
     def pull(self):
         super(PostReleaseVersionBump, self).pull(
                 repos=self.query_repos())
 
     def bump_postrelease(self, *args, **kwargs):
         """Bump version"""
         dirs = self.query_abs_dirs()
         for f in self.config["version_files"]:
-            curr_version = ".".join(
-                self.get_version(dirs['abs_gecko_dir'], f["file"]))
-            self.replace(os.path.join(dirs['abs_gecko_dir'], f["file"]),
-                         curr_version, self.config["next_version"])
+            curr_version = self.get_version(dirs['abs_gecko_dir'], f["file"])
+            next_version = self.config['next_version'].split('.')
+
+            if next_version <= curr_version:
+                self.warning("Version bumping skipped due to conflicting values")
+                continue
+            else:
+                curr_version = ".".join(curr_version)
+                next_version = ".".join(next_version)
+                self.replace(os.path.join(dirs['abs_gecko_dir'], f["file"]),
+                             curr_version, self.config["next_version"])
 
     def tag(self):
         dirs = self.query_abs_dirs()
         tags = ["{product}_{version}_BUILD{build_number}",
                 "{product}_{version}_RELEASE"]
         tags = [t.format(product=self.config["product"].upper(),
                          version=self.config["version"].replace(".", "_"),
                          build_number=self.config["build_number"])