Bug 1277041 - add unique hg share option and rev in push with migration runs, DONTBUILD r=gps
authorJordan Lund <jlund@mozilla.com>
Tue, 31 May 2016 19:44:26 -0700
changeset 341487 1ec243446e6d3afe0c60842b5aaddc699bf7a069
parent 341486 ea11a32f0f61ac3446589a7182442abe300805e5
child 341488 867a9bdc20665a9826cdd9399163f2b0a0f011bf
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 - add unique hg share option and rev in push with migration runs, DONTBUILD r=gps this patch: * forces always passing '-r' when pushing after a migration run * removes '--new-branch' from beta_to_release push. we don't generate new branches on releases anymore because of release promotion! * has migration runs use a unique share dir for each repo. this can be used as a stop gap. maybe even a more permanent solution so we don't need to add complexity to robustcheckout for an edgecase like this. MozReview-Commit-ID: HXY5vDI1pIt
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/base/vcs/mercurial.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
@@ -56,16 +56,17 @@ 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")
     ],
 
+    "use_vcs_unique_share": True,
     "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_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",
--- a/testing/mozharness/configs/merge_day/beta_to_release.py
+++ b/testing/mozharness/configs/merge_day/beta_to_release.py
@@ -24,16 +24,17 @@ 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"),
     ],
 
+    "use_vcs_unique_share": True,
     "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_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",
--- a/testing/mozharness/configs/merge_day/bump_esr.py
+++ b/testing/mozharness/configs/merge_day/bump_esr.py
@@ -1,12 +1,13 @@
 import os
 
 ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 config = {
+    "use_vcs_unique_share": True,
     "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",
--- a/testing/mozharness/configs/merge_day/central_to_aurora.py
+++ b/testing/mozharness/configs/merge_day/central_to_aurora.py
@@ -64,16 +64,17 @@ config = {
     ],
     "locale_files": [
         "browser/locales/shipped-locales",
         "browser/locales/all-locales",
         "mobile/android/locales/maemo-locales",
         "mobile/android/locales/all-locales"
     ],
 
+    "use_vcs_unique_share": True,
     "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_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",
--- a/testing/mozharness/configs/merge_day/release_to_esr.py
+++ b/testing/mozharness/configs/merge_day/release_to_esr.py
@@ -16,16 +16,17 @@ 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"),
     ],
+    "use_vcs_unique_share": True,
     "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_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",
--- a/testing/mozharness/configs/merge_day/staging_beta_migration.py
+++ b/testing/mozharness/configs/merge_day/staging_beta_migration.py
@@ -4,16 +4,17 @@
 #   mozharness/configs/merge_day/staging_beta_migration.py ...
 import os
 
 ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
 
 config = {
     "log_name": "staging_beta",
 
+    "use_vcs_unique_share": True,
     "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
     "tools_repo_url": "https://hg.mozilla.org/build/tools",
     "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",
--- a/testing/mozharness/mozharness/base/vcs/mercurial.py
+++ b/testing/mozharness/mozharness/base/vcs/mercurial.py
@@ -7,16 +7,17 @@
 """Mercurial VCS support.
 """
 
 import os
 import re
 import subprocess
 from collections import namedtuple
 from urlparse import urlsplit
+import hashlib
 
 import sys
 sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0]))))
 
 import mozharness
 from mozharness.base.errors import HgErrorList, VCSException
 from mozharness.base.log import LogMixin, OutputParser
 from mozharness.base.script import ScriptMixin
@@ -349,16 +350,20 @@ class MercurialVCS(ScriptMixin, LogMixin
         # scripts that have multiple repos. This includes the clone_tools()
         # step :(
 
         if not rev and not branch:
             self.warning('did not specify revision or branch; assuming "default"')
             branch = 'default'
 
         share_base = c.get('vcs_share_base', os.environ.get('HG_SHARE_BASE_DIR', None))
+        if share_base and c.get('use_vcs_unique_share'):
+            # Bug 1277041 - update migration scripts to support robustcheckout
+            # fake a share but don't really share
+            share_base = os.path.join(share_base, hashlib.md5(dest).hexdigest())
 
         # We require shared storage is configured because it guarantees we
         # only have 1 local copy of logical repo stores.
         if not share_base:
             raise VCSException('vcs share base not defined; '
                                'refusing to operate sub-optimally')
 
         if not self.robustcheckout_path:
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -172,21 +172,17 @@ class GeckoMigration(MercurialScript, Ba
     def query_commit_message(self):
         return "Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release"
 
     def query_push_dirs(self):
         dirs = self.query_abs_dirs()
         return dirs.get('abs_from_dir'), dirs.get('abs_to_dir')
 
     def query_push_args(self, cwd):
-        if cwd == self.query_abs_dirs()['abs_to_dir'] and \
-                self.config['migration_behavior'] == 'beta_to_release':
-            return ['--new-branch']
-        else:
-            return []
+        return ['-r', '.']
 
     def query_from_revision(self):
         """ Shortcut to get the revision for the from repo
             """
         dirs = self.query_abs_dirs()
         return self.query_hg_revision(dirs['abs_from_dir'])
 
     def query_to_revision(self):