Bug 1447216 [wpt PR 10104] - Worker: Support ES Modules on DedicatedWorker behind...
[gecko.git] / .taskcluster.yml
blob9545784a928f8c3754e4c5d255d26191883dd7e3
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
5 version: 1
6 tasks:
7   - $let:
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'}}
12     in:
13       taskId: {$if: 'tasks_for != "action"', then: '${as_slugid("decision")}'}
14       taskGroupId:
15         $if: 'tasks_for == "action"'
16         then:
17           '${action.taskGroupId}'
18         else:
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
25       metadata:
26         $merge:
27           - owner: "${ownerEmail}"
28             source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml"
29           - $if: 'tasks_for == "hg-push"'
30             then:
31               name: "Gecko Decision Task"
32               description: 'The task that creates all of the other tasks in the task graph'
33             else:
34               $if: 'tasks_for == "action"'
35               then:
36                 name: "Action: ${action.title}"
37                 description: '${action.description}'
38               else:
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"
45       tags:
46         $if: 'tasks_for == "hg-push"'
47         then: {createdForUser: "${ownerEmail}"}
48         else:
49           $if: 'tasks_for == "action"'
50           then:
51             createdForUser: '${ownerEmail}'
52             kind: 'action-callback'
54       routes:
55         $if: 'tasks_for == "hg-push"'
56         then:
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"
63         else:
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}"
69       scopes:
70         $if: 'tasks_for == "hg-push"'
71         then:
72           - 'assume:repo:${repoUrl[8:]}:branch:default'
73           - 'queue:route:notify.email.${ownerEmail}.*'
74         else:
75           $if: 'tasks_for == "action"'
76           then:
77             - '${action.repo_scope}'
78           else:
79             - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
81       dependencies: []
82       requires: all-completed
84       priority: lowest
85       retries: 5
87       payload:
88         env:
89           # checkout-gecko uses these to check out the source; the inputs
90           # to `mach taskgraph decision` are all on the command line.
91           $merge:
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"'
100               then:
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'}}
108         cache:
109           level-${repository.level}-checkouts-sparse-v1: /builds/worker/checkouts
111         features:
112           taskclusterProxy: true
113           chainOfTrust: 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'
121         maxRunTime: 1800
123         command:
124           - /builds/worker/bin/run-task
125           - '--vcs-checkout=/builds/worker/checkouts/gecko'
126           - '--sparse-profile=build/sparse-profiles/taskgraph'
127           - '--'
128           - bash
129           - -cx
130           - $let:
131               extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
132             in:
133               $if: 'tasks_for == "action"'
134               then: >
135                 cd /builds/worker/checkouts/gecko &&
136                 ln -s /builds/worker/artifacts artifacts &&
137                 ./mach --log-no-times taskgraph action-callback
138               else: >
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"
152                 ${extraArgs}
154         artifacts:
155           'public':
156             type: 'directory'
157             path: '/builds/worker/artifacts'
158             expires: {$fromNow: '1 year'}
160       extra:
161         $merge:
162           - treeherder:
163               $merge:
164                 - machine:
165                     platform: gecko-decision
166                 - $if: 'tasks_for == "hg-push"'
167                   then:
168                     symbol: D
169                   else:
170                     $if: 'tasks_for == "action"'
171                     then:
172                       groupName: 'action-callback'
173                       groupSymbol: AC
174                       symbol: "${action.symbol}"
175                     else:
176                       groupSymbol: cron
177                       symbol: "${cron.job_symbol}"
178           - $if: 'tasks_for == "action"'
179             then:
180               parent: '${action.taskGroupId}'
181               action:
182                 name: '${action.name}'
183                 context:
184                   taskGroupId: '${action.taskGroupId}'
185                   taskId: {$eval: 'taskId'}
186                   input: {$eval: 'input'}
187                   parameters: {$eval: 'parameters'}
188           - $if: 'tasks_for == "cron"'
189             then:
190               cron: {$json: {$eval: 'cron'}}
191           - tasks_for: '${tasks_for}'