bug 1469284: allow ssh username to be passed to the merge day scripts. r=mtabara, a=release DEVEDITION_62_0b11_BUILD1 DEVEDITION_62_0b11_RELEASE FENNEC_62_0b11_BUILD1 FENNEC_62_0b11_RELEASE FIREFOX_62_0b11_BUILD1 FIREFOX_62_0b11_RELEASE
authorBen Hearsum <bhearsum@mozilla.com>
Mon, 23 Jul 2018 10:40:35 -0400
changeset 480588 88222b8b526d8a6a0f2e4ca099f425af17f7d10d
parent 480587 c3eb232def25f3ae6b8254eb8b8389ad1bec4eae
child 480589 18a419eeb3f5a12942e233f850a46b6c9e87e1a6
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtabara, release
bugs1469284
milestone62.0
bug 1469284: allow ssh username to be passed to the merge day scripts. r=mtabara, a=release
testing/mozharness/scripts/merge_day/gecko_migration.py
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -42,16 +42,23 @@ class GeckoMigration(MercurialScript, Ba
     config_options = [
         [['--hg-user', ], {
             "action": "store",
             "dest": "hg_user",
             "type": "string",
             "default": "ffxbld <release@mozilla.com>",
             "help": "Specify what user to use to commit to hg.",
         }],
+        [['--ssh-user', ], {
+            "action": "store",
+            "dest": "ssh_user",
+            "type": "string",
+            "default": None,
+            "help": "The user to push to hg.mozilla.org as.",
+        }],
         [['--balrog-api-root', ], {
             "action": "store",
             "dest": "balrog_api_root",
             "type": "string",
             "help": "Specify Balrog API root URL.",
         }],
         [['--balrog-username', ], {
             "action": "store",
@@ -186,17 +193,22 @@ class GeckoMigration(MercurialScript, Ba
                 self.config['migration_behavior'] == 'beta_to_release':
             return ['--new-branch', '-r', '.']
         else:
             return ['-r', '.']
 
     def set_push_to_ssh(self):
         for cwd in self.query_push_dirs():
             repo_url = self.read_repo_hg_rc(cwd).get('paths', 'default')
-            push_dest = repo_url.replace('https://', 'ssh://')
+            username = self.config.get('ssh_user', '')
+            # Add a trailing @ to the username if it exists, otherwise it gets
+            # mushed up with the hostname.
+            if username:
+                username += '@'
+            push_dest = repo_url.replace('https://', 'ssh://' + username)
 
             if not push_dest.startswith('ssh://'):
                 raise Exception('Warning: path "{}" is not supported. Protocol must be ssh')
 
             self.edit_repo_hg_rc(cwd, 'paths', 'default-push', push_dest)
 
     def query_from_revision(self):
         """ Shortcut to get the revision for the from repo