Bug 1277041 - update migration scripts to support robustcheckout, DONTBUILD r=gps
authorJordan Lund <jlund@mozilla.com>
Tue, 31 May 2016 12:43:15 -0700
changeset 340821 092c8795c47a04bb8fd96499847198537c144258
parent 340820 a0ecfb9c274386956d390493efe732d184a922dc
child 340822 7383d49bc7c8e9b1683d4dbfbe9642e112b9f43c
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1277041
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277041 - update migration scripts to support robustcheckout, DONTBUILD r=gps MozReview-Commit-ID: GD3vspSFmTa * fix clean_repos. it expects vcs_config key revision but now we use branch
testing/mozharness/configs/merge_day/aurora_to_beta.py
testing/mozharness/configs/merge_day/beta_to_release.py
testing/mozharness/configs/merge_day/bump_esr.py
testing/mozharness/configs/merge_day/central_to_aurora.py
testing/mozharness/configs/merge_day/release_to_esr.py
testing/mozharness/configs/merge_day/staging_beta_migration.py
testing/mozharness/mozharness/mozilla/repo_manupulation.py
testing/mozharness/scripts/merge_day/gecko_migration.py
--- a/testing/mozharness/configs/merge_day/aurora_to_beta.py
+++ b/testing/mozharness/configs/merge_day/aurora_to_beta.py
@@ -1,8 +1,12 @@
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
+
 config = {
     "log_name": "aurora_to_beta",
     "version_files": [
         {"file": "browser/config/version.txt", "suffix": ""},
         {"file": "browser/config/version_display.txt", "suffix": "b1"},
         {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
@@ -52,21 +56,20 @@ config = {
         ("build/mozconfig.common",
          "MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-0}",
          "MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-1}"),
         ("build/mozconfig.common",
          "# Disable enforcing that add-ons are signed by the trusted root",
          "# Enable enforcing that add-ons are signed by the trusted root")
     ],
 
-    # Disallow sharing, since we want pristine .hg directories.
-    # "vcs_share_base": None,
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     # "hg_share_base": None,
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-aurora",
     "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-beta",
 
     "base_tag": "FIREFOX_BETA_%(major_version)s_BASE",
     "end_tag": "FIREFOX_BETA_%(major_version)s_END",
 
     "migration_behavior": "aurora_to_beta",
 
--- a/testing/mozharness/configs/merge_day/beta_to_release.py
+++ b/testing/mozharness/configs/merge_day/beta_to_release.py
@@ -1,8 +1,12 @@
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
+
 config = {
     "log_name": "beta_to_release",
     "copy_files": [
         {
             "src": "browser/config/version.txt",
             "dst": "browser/config/version_display.txt",
         },
     ],
@@ -20,21 +24,20 @@ config = {
         ("browser/confvars.sh",
          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
         ("browser/confvars.sh",
          "MAR_CHANNEL_ID=firefox-mozilla-beta",
          "MAR_CHANNEL_ID=firefox-mozilla-release"),
     ],
 
-    # Disallow sharing, since we want pristine .hg directories.
-    # "vcs_share_base": None,
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     # "hg_share_base": None,
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-beta",
     "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-release",
 
     "base_tag": "FIREFOX_RELEASE_%(major_version)s_BASE",
     "end_tag": "FIREFOX_RELEASE_%(major_version)s_END",
 
     "migration_behavior": "beta_to_release",
     "require_remove_locales": False,
--- a/testing/mozharness/configs/merge_day/bump_esr.py
+++ b/testing/mozharness/configs/merge_day/bump_esr.py
@@ -1,17 +1,21 @@
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 config = {
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     "log_name": "bump_esr",
     "version_files": [
         {"file": "browser/config/version.txt", "suffix": ""},
         {"file": "browser/config/version_display.txt", "suffix": ""},
         {"file": "config/milestone.txt", "suffix": ""},
     ],
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-esr45",
 
     "migration_behavior": "bump_second_digit",
     "require_remove_locales": False,
     "requires_head_merge": False,
     "default_actions": [
         "clean-repos",
         "pull",
--- a/testing/mozharness/configs/merge_day/central_to_aurora.py
+++ b/testing/mozharness/configs/merge_day/central_to_aurora.py
@@ -1,8 +1,11 @@
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 config = {
     "log_name": "central_to_aurora",
     "version_files": [
         {"file": "browser/config/version.txt", "suffix": ""},
         {"file": "browser/config/version_display.txt", "suffix": ""},
         {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
@@ -61,21 +64,20 @@ config = {
     ],
     "locale_files": [
         "browser/locales/shipped-locales",
         "browser/locales/all-locales",
         "mobile/android/locales/maemo-locales",
         "mobile/android/locales/all-locales"
     ],
 
-    # Disallow sharing, since we want pristine .hg directories.
-    # "vcs_share_base": None,
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     # "hg_share_base": None,
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "from_repo_url": "ssh://hg.mozilla.org/mozilla-central",
     "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-aurora",
 
     "base_tag": "FIREFOX_AURORA_%(major_version)s_BASE",
     "end_tag": "FIREFOX_AURORA_%(major_version)s_END",
 
     "migration_behavior": "central_to_aurora",
 
--- a/testing/mozharness/configs/merge_day/release_to_esr.py
+++ b/testing/mozharness/configs/merge_day/release_to_esr.py
@@ -1,8 +1,11 @@
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 NEW_ESR_REPO = "ssh://hg.mozilla.org/releases/mozilla-esr45"
 OLD_ESR_REPO = "https://hg.mozilla.org/releases/mozilla-esr38"
 OLD_ESR_CHANGESET = "16351963d75c"
 
 config = {
     "log_name": "relese_to_esr",
     "version_files": [
         {"file": "browser/config/version.txt", "suffix": ""},
@@ -13,21 +16,20 @@ config = {
         # File, from, to
         ("browser/confvars.sh",
          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release",
          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-esr"),
         ("browser/confvars.sh",
          "MAR_CHANNEL_ID=firefox-mozilla-release",
          "MAR_CHANNEL_ID=firefox-mozilla-esr"),
     ],
-    # Disallow sharing, since we want pristine .hg directories.
-    # "vcs_share_base": None,
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     # "hg_share_base": None,
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-release",
     "to_repo_url": NEW_ESR_REPO,
 
     "base_tag": "FIREFOX_ESR_%(major_version)s_BASE",
     "end_tag": "FIREFOX_ESR_%(major_version)s_END",
 
     "migration_behavior": "release_to_esr",
     "require_remove_locales": False,
--- a/testing/mozharness/configs/merge_day/staging_beta_migration.py
+++ b/testing/mozharness/configs/merge_day/staging_beta_migration.py
@@ -1,18 +1,22 @@
 # Use this script in conjunction with aurora_to_beta.py.
 # mozharness/scripts/merge_day/gecko_migration.py -c \
 #   mozharness/configs/merge_day/aurora_to_beta.py -c
 #   mozharness/configs/merge_day/staging_beta_migration.py ...
+import os
+
+ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 
 config = {
     "log_name": "staging_beta",
 
+    "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
-    "tools_repo_revision": "default",
+    "tools_repo_branch": "default",
     "from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-aurora",
     "to_repo_url": "ssh://hg.mozilla.org/users/stage-ffxbld/mozilla-beta",
 
     "base_tag": "FIREFOX_BETA_%(major_version)s_BASE",
     "end_tag": "FIREFOX_BETA_%(major_version)s_END",
 
     "migration_behavior": "aurora_to_beta",
 }
--- a/testing/mozharness/mozharness/mozilla/repo_manupulation.py
+++ b/testing/mozharness/mozharness/mozilla/repo_manupulation.py
@@ -66,17 +66,17 @@ class MercurialRepoManipulationMixin(obj
             'explanation': "Nothing to clean up; we're good!",
         }] + HgErrorList
         for repo_config in hg_repos:
             repo_name = repo_config["dest"]
             repo_path = os.path.join(dirs['abs_work_dir'], repo_name)
             if os.path.exists(repo_path):
                 # hg up -C to discard uncommitted changes
                 self.run_command(
-                    hg + ["up", "-C", "-r", repo_config['revision']],
+                    hg + ["up", "-C", "-r", repo_config['branch']],
                     cwd=repo_path,
                     error_list=HgErrorList,
                     halt_on_failure=True,
                 )
                 # discard unpushed commits
                 status = self.retry(
                     self.run_command,
                     args=(hg + ["--config", "extensions.mq=", "strip",
@@ -88,17 +88,17 @@ class MercurialRepoManipulationMixin(obj
                         'success_codes': (0, 255),
                     },
                 )
                 if status not in [0, 255]:
                     self.fatal("Issues stripping outgoing revisions!")
                 # 2nd hg up -C to make sure we're not on a stranded head
                 # which can happen when reverting debugsetparents
                 self.run_command(
-                    hg + ["up", "-C", "-r", repo_config['revision']],
+                    hg + ["up", "-C", "-r", repo_config['branch']],
                     cwd=repo_path,
                     error_list=HgErrorList,
                     halt_on_failure=True,
                 )
 
     def commit_changes(self):
         """ Do the commit.
             """
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -148,17 +148,17 @@ class GeckoMigration(MercurialScript, Ba
         dirs = self.query_abs_dirs()
         self.gecko_repos = []
         for k in ('from', 'to'):
             repo_key = "%s_repo_url" % k
             url = self.config.get(repo_key)
             if url:
                 self.gecko_repos.append({
                     "repo": url,
-                    "revision": self.config.get("%s_repo_revision", "default"),
+                    "branch": self.config.get("%s_repo_branch" % (k,), "default"),
                     "dest": dirs['abs_%s_dir' % k],
                     "vcs": "hg",
                 })
             else:
                 self.warning("Skipping %s" % repo_key)
         self.info(pprint.pformat(self.gecko_repos))
         return self.gecko_repos
 
@@ -457,17 +457,17 @@ class GeckoMigration(MercurialScript, Ba
                          curr_version, next_version + f["suffix"])
         self.touch_clobber_file(dirs['abs_to_dir'])
 
     def pull(self):
         """ Pull tools first, then use hgtool for the gecko repos
             """
         repos = [{
             "repo": self.config["tools_repo_url"],
-            "revision": self.config["tools_repo_revision"],
+            "branch": self.config["tools_repo_branch"],
             "dest": "tools",
             "vcs": "hg",
         }] + self.query_repos()
         super(GeckoMigration, self).pull(repos=repos)
 
     def lock_update_paths(self):
         self.lock_balrog_rules(self.config["balrog_rules_to_lock"])