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
7 # NOTE: support for actions in ci-admin requires that the `tasks` property be an array *before* JSON-e rendering
9 - $if: 'tasks_for in ["hg-push", "action", "cron"]'
12 # sometimes the push user is just `ffxbld` or the like, but we want an email-like field..
13 ownerEmail: {$if: '"@" in push.owner', then: '${push.owner}', else: '${push.owner}@noreply.mozilla.org'}
14 # ensure there's no trailing `/` on the repo URL
15 repoUrl: {$if: 'repository.url[-1] == "/"', then: {$eval: 'repository.url[:-1]'}, else: {$eval: 'repository.url'}}
17 taskId: {$if: 'tasks_for != "action"', then: '${as_slugid("decision")}'}
19 $if: 'tasks_for == "action"'
21 '${action.taskGroupId}'
23 '${as_slugid("decision")}' # same as taskId; this is how automation identifies a decision tsak
24 schedulerId: 'gecko-level-${repository.level}'
26 created: {$fromNow: ''}
27 deadline: {$fromNow: '1 day'}
28 expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
31 - owner: "${ownerEmail}"
32 source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml"
33 - $if: 'tasks_for == "hg-push"'
35 name: "Gecko Decision Task"
36 description: 'The task that creates all of the other tasks in the task graph'
38 $if: 'tasks_for == "action"'
40 name: "Action: ${action.title}"
41 description: '${action.description}'
43 name: "Decision Task for cron job ${cron.job_name}"
44 description: 'Created by a [cron task](https://tools.taskcluster.net/tasks/${cron.task_id})'
46 provisionerId: "aws-provisioner-v1"
47 workerType: "gecko-${repository.level}-decision"
50 $if: 'tasks_for == "hg-push"'
52 createdForUser: "${ownerEmail}"
55 $if: 'tasks_for == "action"'
57 createdForUser: '${ownerEmail}'
58 kind: 'action-callback'
60 $if: 'tasks_for == "cron"'
66 - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
67 - $if: 'tasks_for == "hg-push"'
69 - "index.gecko.v2.${repository.project}.latest.taskgraph.decision"
70 - "index.gecko.v2.${repository.project}.revision.${push.revision}.taskgraph.decision"
71 - "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision"
72 - "notify.email.${ownerEmail}.on-failed"
73 - "notify.email.${ownerEmail}.on-exception"
74 # These are the old index routes for the decision task.
75 # They are still here so external tools that referenced them continue to work.
76 - "index.gecko.v2.${repository.project}.latest.firefox.decision"
77 - "index.gecko.v2.${repository.project}.revision.${push.revision}.firefox.decision"
79 $if: 'tasks_for == "action"'
81 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-failed"
82 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-exception"
83 - "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.actions.${ownTaskId}"
85 - "index.gecko.v2.${repository.project}.latest.taskgraph.decision-${cron.job_name}"
86 - "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
89 $if: 'tasks_for == "hg-push"'
91 - 'assume:repo:${repoUrl[8:]}:branch:default'
92 - 'queue:route:notify.email.${ownerEmail}.*'
93 - 'in-tree:hook-action:project-gecko/in-tree-action-${repository.level}-*'
95 $if: 'tasks_for == "action"'
97 # when all actions are hooks, we can calculate this directly rather than using a variable
98 - '${action.repo_scope}'
100 - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
103 requires: all-completed
110 # checkout-gecko uses these to check out the source; the inputs
111 # to `mach taskgraph decision` are all on the command line.
113 - GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
114 GECKO_HEAD_REPOSITORY: '${repoUrl}'
115 GECKO_HEAD_REF: '${push.revision}'
116 GECKO_HEAD_REV: '${push.revision}'
117 GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${push.comment}'}
118 HG_STORE_PATH: /builds/worker/checkouts/hg-store
119 TASKCLUSTER_CACHES: /builds/worker/checkouts
120 - $if: 'tasks_for == "action"'
122 ACTION_TASK_GROUP_ID: '${taskGroupId}' # taskGroupId of the target task
123 ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
124 ACTION_INPUT: {$json: {$eval: 'input'}}
125 ACTION_CALLBACK: '${action.cb_name}'
126 ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
129 level-${repository.level}-checkouts-sparse-v2: /builds/worker/checkouts
132 taskclusterProxy: true
135 # Note: This task is built server side without the context or tooling that
136 # exist in tree so we must hard code the hash
137 image: 'taskcluster/decision:2.1.0@sha256:6db3b697d7a3c7aba440d72f04199331b872111cefff57206b8b8b1d53230360'
142 - /builds/worker/bin/run-task
143 - '--vcs-checkout=/builds/worker/checkouts/gecko'
144 - '--sparse-profile=build/sparse-profiles/taskgraph'
149 extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
151 $if: 'tasks_for == "action"'
153 cd /builds/worker/checkouts/gecko &&
154 ln -s /builds/worker/artifacts artifacts &&
155 ./mach --log-no-times taskgraph action-callback
157 cd /builds/worker/checkouts/gecko &&
158 ln -s /builds/worker/artifacts artifacts &&
159 ./mach --log-no-times taskgraph decision
160 --pushlog-id='${push.pushlog_id}'
161 --pushdate='${push.pushdate}'
162 --project='${repository.project}'
163 --message="$GECKO_COMMIT_MSG"
164 --owner='${ownerEmail}'
165 --level='${repository.level}'
166 --base-repository="$GECKO_BASE_REPOSITORY"
167 --head-repository="$GECKO_HEAD_REPOSITORY"
168 --head-ref="$GECKO_HEAD_REF"
169 --head-rev="$GECKO_HEAD_REV"
175 path: '/builds/worker/artifacts'
176 expires: {$fromNow: '1 year'}
183 platform: gecko-decision
184 - $if: 'tasks_for == "hg-push"'
188 $if: 'tasks_for == "action"'
190 groupName: 'action-callback'
192 symbol: "${action.symbol}"
195 symbol: "${cron.job_symbol}"
196 - $if: 'tasks_for == "action"'
198 parent: '${action.taskGroupId}'
200 name: '${action.name}'
202 taskGroupId: '${action.taskGroupId}'
203 taskId: {$eval: 'taskId'}
204 input: {$eval: 'input'}
205 parameters: {$eval: 'parameters'}
206 - $if: 'tasks_for == "cron"'
208 cron: {$json: {$eval: 'cron'}}
209 - tasks_for: '${tasks_for}'