Bug 1492219 - Update .taskcluster.yml with (some) changes from M-C r=tomprince
authorRob Lemley <rob@thunderbird.net>
Fri, 21 Sep 2018 01:27:31 +0000
changeset 33199 66c355e529f52dd7bb136b387b1f1ceaae5d5591
parent 33198 c33ef0679b50abf286fae6f23b6786ff87ae6552
child 33200 bdd596274fb1216de1d694dd583d0aaf82ae462c
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewerstomprince
bugs1492219
Bug 1492219 - Update .taskcluster.yml with (some) changes from M-C r=tomprince The idea is to make actions work again from treeherder Differential Revision: https://phabricator.services.mozilla.com/D6399
.taskcluster.yml
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -7,16 +7,22 @@
 version: 1
 
 tasks:
   - $let:
       # sometimes the push user is just `ffxbld` or the like, but we want an email-like field..
       ownerEmail: {$if: '"@" in push.owner', then: '${push.owner}', else: '${push.owner}@noreply.mozilla.org'}
       # ensure there's no trailing `/` on the repo URL
       repoUrl: {$if: 'repository.url[-1] == "/"', then: {$eval: 'repository.url[:-1]'}, else: {$eval: 'repository.url'}}
+      # Hardcode cron push info for now, so that we can transition to using real values without breaking callers of Chain of Trust
+      _pushId: {$if: 'tasks_for == "cron"', then: '-1', else: {$eval: 'push.pushlog_id'}}
+      # action tasks can fail because of no pushdate or push comment information in context, so include them in
+      # hardcodes (even though they don't use these variables)
+      _pushDate: {$if: 'tasks_for == "cron" || tasks_for == "action"', then: '0', else: {$eval: 'push.pushdate'}}
+      _pushComment: {$if: 'tasks_for == "cron" || tasks_for == "action"', then: '', else: {$eval: 'push.comment'}}
     in:
       taskId: {$if: 'tasks_for != "action"', then: '${as_slugid("decision")}'}
       taskGroupId:
         $if: 'tasks_for == "action"'
         then:
           '${action.taskGroupId}'
         else:
           '${as_slugid("decision")}'  # same as taskId; this is how automation identifies a decision tsak
@@ -65,24 +71,28 @@ tasks:
               - "index.comm.v2.${repository.project}.revision.${push.revision}.taskgraph.decision"
               - "index.comm.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision"
               - "notify.email.${ownerEmail}.on-failed"
               - $if: '"mozilla@hocat.ca" in ownerEmail'
                 # Until taskcluster is ready for general consumption, don't report exceptions from taskcluster.
                 then: "notify.email.${ownerEmail}.on-exception"
             else:
               - $if: 'tasks_for == "action"'
-                then: "index.comm.v2.${repository.project}.pushlog-id.${push.pushlog_id}.actions.$ownTaskId"
+                then:
+                - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-failed"
+                - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-exception"
+                - "index.comm.v2.${repository.project}.pushlog-id.${_pushId}.actions.${ownTaskId}"
                 else: "index.comm.v2.${repository.project}.latest.taskgraph.decision-${cron.job_name}"
 
       scopes:
         $if: 'tasks_for == "hg-push"'
         then:
           - 'assume:repo:${repoUrl[8:]}:branch:default'
           - 'queue:route:notify.email.${ownerEmail}.*'
+          - 'in-tree:hook-action:project-comm/in-tree-action-${repository.level}-*'
         else:
           $if: 'tasks_for == "action"'
           then:
             - '${action.repo_scope}'
           else:
             - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
 
       dependencies: []
@@ -98,28 +108,27 @@ tasks:
           $merge:
             - GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
               GECKO_HEAD_REPOSITORY: 'https://hg.mozilla.org/mozilla-central'
               GECKO_HEAD_REF: 'default'
               COMM_BASE_REPOSITORY: 'https://hg.mozilla.org/comm-central'
               COMM_HEAD_REPOSITORY: '${repoUrl}'
               COMM_HEAD_REF: '${push.revision}'
               COMM_HEAD_REV: '${push.revision}'
-              HG_STORE_PATH: /buillds/worker/checkouts/hg-store
+              HG_STORE_PATH: /builds/worker/checkouts/hg-store
               TASKCLUSTER_CACHES: /builds/worker/checkouts
             - $if: 'tasks_for != "action"'
               then:
                 # scriptworker expects an environment variable named GECKO_COMMIT_MSG,
                 # see: https://github.com/mozilla-releng/scriptworker/blob/master/scriptworker/task.py
-                GECKO_COMMIT_MSG: '${push.comment}'
+                GECKO_COMMIT_MSG: '${_pushComment}'
             - $if: 'tasks_for == "action"'
               then:
-                ACTION_TASK_GROUP_ID: '${ownTaskId}'
-                ACTION_TASK_ID: {$json: {$eval: 'taskId'}}
-                ACTION_TASK: {$json: {$eval: 'task'}}
+                ACTION_TASK_GROUP_ID: '${action.taskGroupId}' # taskGroupId of the target task
+                ACTION_TASK_ID: {$json: {$eval: 'taskId'}}    # taskId of the target task (JSON-encoded)
                 ACTION_INPUT: {$json: {$eval: 'input'}}
                 ACTION_CALLBACK: '${action.cb_name}'
                 ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
 
         cache:
           level-${repository.level}-checkouts-sparse-v2: /builds/worker/checkouts
 
         features: