1 # This file is rendered via JSON-e by
2 # - mozilla-taskcluster - https://docs.taskcluster.net/reference/integrations/mozilla-taskcluster/docs/taskcluster-yml
3 # - cron tasks - taskcluster/taskgraph/cron/decision.py
4 # - action tasks - taskcluster/taskgraph/actions/registry.py
8 # sometimes the push user is just `ffxbld` or the like, but we want an email-like field..
9 ownerEmail: {$if: '"@" in push.owner', then: '${push.owner}', else: '${push.owner}@noreply.mozilla.org'}
10 # ensure there's no trailing `/` on the repo URL
11 repoUrl: {$if: 'repository.url[-1] == "/"', then: {$eval: 'repository.url[:-1]'}, else: {$eval: 'repository.url'}}
13 taskId: {$if: 'tasks_for != "action"', then: '${as_slugid("decision")}'}
15 $if: 'tasks_for == "action"'
17 '${action.taskGroupId}'
19 '${as_slugid("decision")}' # same as taskId; this is how automation identifies a decision tsak
20 schedulerId: 'gecko-level-${repository.level}'
22 created: {$fromNow: ''}
23 deadline: {$fromNow: '1 day'}
24 expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
27 - owner: "${ownerEmail}"
28 source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml"
29 - $if: 'tasks_for == "hg-push"'
31 name: "Gecko Decision Task"
32 description: 'The task that creates all of the other tasks in the task graph'
34 $if: 'tasks_for == "action"'
36 name: "Action: ${action.title}"
37 description: '${action.description}'
39 name: "Decision Task for cron job ${cron.job_name}"
40 description: 'Created by a [cron task](https://tools.taskcluster.net/tasks/${cron.task_id})'
42 provisionerId: "aws-provisioner-v1"
43 workerType: "gecko-${repository.level}-decision"
46 $if: 'tasks_for == "hg-push"'
47 then: {createdForUser: "${ownerEmail}"}
49 $if: 'tasks_for == "action"'
51 createdForUser: '${ownerEmail}'
52 kind: 'action-callback'
55 $if: 'tasks_for == "hg-push"'
57 - "index.gecko.v2.${repository.project}.latest.firefox.decision"
58 - "index.gecko.v2.${repository.project}.revision.${push.revision}.firefox.decision"
59 - "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision"
60 - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
61 - "notify.email.${ownerEmail}.on-failed"
62 - "notify.email.${ownerEmail}.on-exception"
64 - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
65 - $if: 'tasks_for == "action"'
66 then: "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.actions.${ownTaskId}"
67 else: "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
70 $if: 'tasks_for == "hg-push"'
72 - 'assume:repo:${repoUrl[8:]}:branch:default'
73 - 'queue:route:notify.email.${ownerEmail}.*'
75 $if: 'tasks_for == "action"'
77 - '${action.repo_scope}'
79 - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
82 requires: all-completed
89 # checkout-gecko uses these to check out the source; the inputs
90 # to `mach taskgraph decision` are all on the command line.
92 - GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
93 GECKO_HEAD_REPOSITORY: '${repoUrl}'
94 GECKO_HEAD_REF: '${push.revision}'
95 GECKO_HEAD_REV: '${push.revision}'
96 GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${push.comment}'}
97 HG_STORE_PATH: /builds/worker/checkouts/hg-store
98 TASKCLUSTER_CACHES: /builds/worker/checkouts
99 - $if: 'tasks_for == "action"'
101 ACTION_TASK_GROUP_ID: '${ownTaskId}'
102 ACTION_TASK_ID: {$json: {$eval: 'taskId'}}
103 ACTION_TASK: {$json: {$eval: 'task'}}
104 ACTION_INPUT: {$json: {$eval: 'input'}}
105 ACTION_CALLBACK: '${action.cb_name}'
106 ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
109 level-${repository.level}-checkouts-sparse-v1: /builds/worker/checkouts
112 taskclusterProxy: true
115 # Note: This task is built server side without the context or tooling that
116 # exist in tree so we must hard code the hash
117 # XXX Changing this will break Chain of Trust without an associated puppet and
118 # scriptworker patch!
119 image: 'taskcluster/decision:2.0.0@sha256:4039fd878e5700b326d4a636e28c595c053fbcb53909c1db84ad1f513cf644ef'
124 - /builds/worker/bin/run-task
125 - '--vcs-checkout=/builds/worker/checkouts/gecko'
126 - '--sparse-profile=build/sparse-profiles/taskgraph'
131 extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
133 $if: 'tasks_for == "action"'
135 cd /builds/worker/checkouts/gecko &&
136 ln -s /builds/worker/artifacts artifacts &&
137 ./mach --log-no-times taskgraph action-callback
139 cd /builds/worker/checkouts/gecko &&
140 ln -s /builds/worker/artifacts artifacts &&
141 ./mach --log-no-times taskgraph decision
142 --pushlog-id='${push.pushlog_id}'
143 --pushdate='${push.pushdate}'
144 --project='${repository.project}'
145 --message="$GECKO_COMMIT_MSG"
146 --owner='${ownerEmail}'
147 --level='${repository.level}'
148 --base-repository="$GECKO_BASE_REPOSITORY"
149 --head-repository="$GECKO_HEAD_REPOSITORY"
150 --head-ref="$GECKO_HEAD_REF"
151 --head-rev="$GECKO_HEAD_REV"
157 path: '/builds/worker/artifacts'
158 expires: {$fromNow: '1 year'}
165 platform: gecko-decision
166 - $if: 'tasks_for == "hg-push"'
170 $if: 'tasks_for == "action"'
172 groupName: 'action-callback'
174 symbol: "${action.symbol}"
177 symbol: "${cron.job_symbol}"
178 - $if: 'tasks_for == "action"'
180 parent: '${action.taskGroupId}'
182 name: '${action.name}'
184 taskGroupId: '${action.taskGroupId}'
185 taskId: {$eval: 'taskId'}
186 input: {$eval: 'input'}
187 parameters: {$eval: 'parameters'}
188 - $if: 'tasks_for == "cron"'
190 cron: {$json: {$eval: 'cron'}}
191 - tasks_for: '${tasks_for}'