Bug 1384210 - Add comm-central checkout support to taskcluster's run-task; r=gps
☠☠ backed out by d587eeda28f3 ☠ ☠
authorTom Prince <mozilla@hocat.ca>
Tue, 25 Jul 2017 10:17:03 -0600
changeset 371459 bdad4ba95b6da5bd63db5f3edd8f70dfb6711ed3
parent 371458 f7ba51fec8d0767720819a3631779136293b5475
child 371460 4d7f8040175114453ed4a1927fd6a0bf376f21d3
push id47448
push userryanvm@gmail.com
push dateThu, 27 Jul 2017 22:41:40 +0000
treeherderautoland@bdad4ba95b6d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1384210
milestone56.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 1384210 - Add comm-central checkout support to taskcluster's run-task; r=gps MozReview-Commit-ID: LxjYLdzmNO3
taskcluster/docker/recipes/run-task
--- a/taskcluster/docker/recipes/run-task
+++ b/taskcluster/docker/recipes/run-task
@@ -172,16 +172,18 @@ def main(args):
     # dropped. This is often necessary for caches/volumes, since they default
     # to root:root ownership.
     parser.add_argument('--chown', action='append',
                         help='Directory to chown to --user:--group')
     parser.add_argument('--chown-recursive', action='append',
                         help='Directory to recursively chown to --user:--group')
     parser.add_argument('--vcs-checkout',
                         help='Directory where Gecko checkout should be created')
+    parser.add_argument('--comm-checkout',
+                        help='Directory where Comm checkout should be created')
     parser.add_argument('--tools-checkout',
                         help='Directory where build/tools checkout should be created')
     parser.add_argument('--fetch-hgfingerprint', action='store_true',
                         help='Fetch the latest hgfingerprint from the secrets store, '
                         'using the taskclsuerProxy')
 
     args = parser.parse_args(our_args)
 
@@ -340,16 +342,36 @@ def main(args):
     if args.tools_checkout:
         vcs_checkout(b'https://hg.mozilla.org/build/tools',
                      args.tools_checkout,
                      os.environ['HG_STORE_PATH'],
                      # Always check out the latest commit on default branch.
                      # This is non-deterministic!
                      branch=b'default')
 
+    # Checkout the repository, setting the COMM_HEAD_REV to the current
+    # revision hash. Revision hashes have priority over symbolic revisions. We
+    # disallow running tasks with symbolic revisions unless they have been
+    # resolved by a checkout.
+    if args.comm_checkout:
+        base_repo = os.environ.get('COMM_BASE_REPOSITORY')
+
+        os.environ['COMM_HEAD_REV'] = vcs_checkout(
+            os.environ['COMM_HEAD_REPOSITORY'],
+            args.comm_checkout,
+            os.environ['HG_STORE_PATH'],
+            base_repo=base_repo,
+            revision=os.environ.get('COMM_HEAD_REV'),
+            branch=os.environ.get('COMM_HEAD_REF'))
+
+    elif not os.environ.get('COMM_HEAD_REV') and \
+            os.environ.get('COMM_HEAD_REF'):
+        print('task should be defined in terms of non-symbolic revision')
+        return 1
+
     return run_and_prefix_output(b'task', task_args)
 
 
 if __name__ == '__main__':
     # Unbuffer stdio.
     sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
     sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)