Bug 1410737: Log repositories checked out. r=gps draft
authorTom Prince <mozilla@hocat.ca>
Thu, 26 Oct 2017 11:54:55 -0600
changeset 698883 bc2c602985874d76fea4b2524f718c53839daee7
parent 698882 9b43757a2b802bc6a00b4e8c8977f77877b8f1a5
child 740455 41474fd6dc506a553027c88eaaeedde444994c2f
push id89380
push userbmo:mozilla@hocat.ca
push dateThu, 16 Nov 2017 05:44:12 +0000
reviewersgps
bugs1410737
milestone59.0a1
Bug 1410737: Log repositories checked out. r=gps MozReview-Commit-ID: 7D7i8CMXjMY
taskcluster/docker/recipes/run-task
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/docker/recipes/run-task
+++ b/taskcluster/docker/recipes/run-task
@@ -211,16 +211,26 @@ def vcs_checkout(source_repo, dest, stor
     # Update the current revision hash and ensure that it is well formed.
     revision = subprocess.check_output(
         [b'hg', b'log',
          b'--rev', b'.',
          b'--template', b'{node}'],
         cwd=dest)
 
     assert re.match('^[a-f0-9]{40}$', revision)
+
+    repo_name = source_repo.split('/')[-1]
+    print_line(b'vcs', b"TinderboxPrint:<a href={source_repo}/rev/{revision} "
+                       b"title='Built from {repo_name} revision {revision}'>"
+                       b"{revision}</a>\n".format(
+                           revision=revision,
+                           source_repo=source_repo,
+                           repo_name=repo_name,
+                       ))
+
     return revision
 
 
 def main(args):
     print_line(b'setup', b'run-task started\n')
     running_as_root = os.getuid() == 0
 
     # Arguments up to '--' are ours. After are for the main task
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -271,18 +271,27 @@ def mozharness_on_generic_worker(config,
         hg_command.append('robustcheckout')
         hg_command.extend(['--sharebase', 'y:\\hg-shared'])
         hg_command.append('--purge')
         hg_command.extend(['--upstream', base_repo])
         hg_command.extend(['--revision', head_rev])
         hg_command.append(head_repo)
         hg_command.append(path)
 
+        logging_command = [
+            b":: TinderboxPrint:<a href={source_repo}/rev/{revision} "
+            b"title='Built from {repo_name} revision {revision}'>{revision}</a>\n".format(
+                revision=head_rev,
+                source_repo=head_repo,
+                repo_name=head_repo.split('/')[-1],
+            )]
+
         return [
             ' '.join(hg_command),
+            ' '.join(logging_command),
         ]
 
     hg_commands = checkout_repo(
         base_repo=env['GECKO_BASE_REPOSITORY'],
         head_repo=env['GECKO_HEAD_REPOSITORY'],
         head_rev=env['GECKO_HEAD_REV'],
         path='.\\build\\src')