Bug 1499346 [wpt PR 13540] - Use a common blank reference for wpt/css., a=testonly
[gecko.git] / .taskcluster.yml
blob4e412cae6d474cc101b4e770da34388f34400b1a
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   # NOTE: support for actions in ci-admin requires that the `tasks` property be an array *before* JSON-e rendering
8   # takes place.
9   - $if: 'tasks_for in ["hg-push", "action", "cron"]'
10     then:
11       $let:
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'}}
16         # Hardcode cron push info for now, so that we can transition to using real values without breaking callers of Chain of Trust
17         _pushId: {$if: 'tasks_for == "cron"', then: '-1', else: {$eval: 'push.pushlog_id'}}
18         # action tasks can fail because of no pushdate or push comment information in context, so include them in
19         # hardcodes (even though they don't use these variables)
20         _pushDate: {$if: 'tasks_for == "cron" || tasks_for == "action"', then: '0', else: {$eval: 'push.pushdate'}}
21         _pushComment: {$if: 'tasks_for == "cron" || tasks_for == "action"', then: '', else: {$eval: 'push.comment'}}
22       in:
23         taskId: {$if: 'tasks_for != "action"', then: '${as_slugid("decision")}'}
24         taskGroupId:
25           $if: 'tasks_for == "action"'
26           then:
27             '${action.taskGroupId}'
28           else:
29             '${as_slugid("decision")}' # same as taskId; this is how automation identifies a decision tsak
30         schedulerId: 'gecko-level-${repository.level}'
32         created: {$fromNow: ''}
33         deadline: {$fromNow: '1 day'}
34         expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
35         metadata:
36           $merge:
37             - owner: "${ownerEmail}"
38               source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml"
39             - $if: 'tasks_for == "hg-push"'
40               then:
41                 name: "Gecko Decision Task"
42                 description: 'The task that creates all of the other tasks in the task graph'
43               else:
44                 $if: 'tasks_for == "action"'
45                 then:
46                   name: "Action: ${action.title}"
47                   description: '${action.description}'
48                 else:
49                   name: "Decision Task for cron job ${cron.job_name}"
50                   description: 'Created by a [cron task](https://tools.taskcluster.net/tasks/${cron.task_id})'
52         provisionerId: "aws-provisioner-v1"
53         workerType: "gecko-${repository.level}-decision"
55         tags:
56           $if: 'tasks_for == "hg-push"'
57           then:
58             createdForUser: "${ownerEmail}"
59             kind: decision-task
60           else:
61             $if: 'tasks_for == "action"'
62             then:
63               createdForUser: '${ownerEmail}'
64               kind: 'action-callback'
65             else:
66               $if: 'tasks_for == "cron"'
67               then:
68                 kind: cron-task
70         routes:
71           $flatten:
72             - "tc-treeherder.v2.${repository.project}.${push.revision}.${_pushId}"
73             - $if: 'tasks_for == "hg-push"'
74               then:
75                 - "index.gecko.v2.${repository.project}.latest.taskgraph.decision"
76                 - "index.gecko.v2.${repository.project}.revision.${push.revision}.taskgraph.decision"
77                 - "index.gecko.v2.${repository.project}.pushlog-id.${_pushId}.decision"
78                 - "notify.email.${ownerEmail}.on-failed"
79                 - "notify.email.${ownerEmail}.on-exception"
80                 # Send a notification email if the push comes from try
81                 - $if: 'repository.project == "try"'
82                   then:
83                     "notify.email.${ownerEmail}.on-completed"
84                 # BUG 1500166 Notify ciduty by email if a nightly hook fails
85                 - "notify.email.ciduty+failedcron@mozilla.com.on-failed"
86                 - "notify.email.ciduty+exceptioncron@mozilla.com.on-exception"
87                 - "notify.email.sheriffs+failedcron@mozilla.com.on-failed"
88                 - "notify.email.sheriffs+exceptioncron@mozilla.com.on-exception"
89                 # These are the old index routes for the decision task.
90                 # They are still here so external tools that referenced them continue to work.
91                 - "index.gecko.v2.${repository.project}.latest.firefox.decision"
92                 - "index.gecko.v2.${repository.project}.revision.${push.revision}.firefox.decision"
93               else:
94                 $if: 'tasks_for == "action"'
95                 then:
96                 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-failed"
97                 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-exception"
98                 - "index.gecko.v2.${repository.project}.pushlog-id.${_pushId}.actions.${ownTaskId}"
99                 else:  # cron
100                 - "index.gecko.v2.${repository.project}.latest.taskgraph.decision-${cron.job_name}"
101                 # list each cron task on this revision, so actions can find them
102                 - 'index.gecko.v2.${repository.project}.revision.${push.revision}.cron.${as_slugid("decision")}'
103                 # These are the old index routes for the decision task.
104                 - "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
106         scopes:
107           $if: 'tasks_for == "hg-push"'
108           then:
109             - 'assume:repo:${repoUrl[8:]}:branch:default'
110             - 'queue:route:notify.email.${ownerEmail}.*'
111             - 'in-tree:hook-action:project-gecko/in-tree-action-${repository.level}-*'
112           else:
113             $if: 'tasks_for == "action"'
114             then:
115               # when all actions are hooks, we can calculate this directly rather than using a variable
116               - '${action.repo_scope}'
117             else:
118               - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
120         dependencies: []
121         requires: all-completed
123         priority:
124           # Most times, there is plenty of worker capacity so everything runs
125           # quickly, but sometimes a storm of action tasks lands.  Then we
126           # want, from highest to lowest:
127           # - cron tasks (time-sensitive) (low)
128           # - decision tasks (minimize user-visible delay) (very-low)
129           # - action tasks (avoid interfering with the other two) (lowest)
130           # SCM levels all use different workerTypes, so there is no need for priority
131           # between levels; "low" is the highest priority available at all levels, and
132           # nothing runs at any higher priority on these workerTypes.
133           $if: "tasks_for == 'cron'"
134           then: low
135           else:
136             $if: "tasks_for == 'hg-push'"
137             then: very-low
138             else: lowest  # tasks_for == 'action'
139         retries: 5
141         payload:
142           env:
143             # checkout-gecko uses these to check out the source; the inputs
144             # to `mach taskgraph decision` are all on the command line.
145             $merge:
146               - GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
147                 GECKO_HEAD_REPOSITORY: '${repoUrl}'
148                 GECKO_HEAD_REF: '${push.revision}'
149                 GECKO_HEAD_REV: '${push.revision}'
150                 GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${_pushComment}'}
151                 HG_STORE_PATH: /builds/worker/checkouts/hg-store
152                 TASKCLUSTER_CACHES: /builds/worker/checkouts
153               - $if: 'tasks_for == "action"'
154                 then:
155                   ACTION_TASK_GROUP_ID: '${action.taskGroupId}'     # taskGroupId of the target task
156                   ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
157                   ACTION_INPUT: {$json: {$eval: 'input'}}
158                   ACTION_CALLBACK: '${action.cb_name}'
159                   ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
161           cache:
162             level-${repository.level}-checkouts-sparse-v2: /builds/worker/checkouts
164           features:
165             taskclusterProxy: true
166             chainOfTrust: true
168           # Note: This task is built server side without the context or tooling that
169           # exist in tree so we must hard code the hash
170           image: 'taskcluster/decision:2.1.0@sha256:6db3b697d7a3c7aba440d72f04199331b872111cefff57206b8b8b1d53230360'
172           maxRunTime: 1800
174           command:
175             - /builds/worker/bin/run-task
176             - '--vcs-checkout=/builds/worker/checkouts/gecko'
177             - '--sparse-profile=build/sparse-profiles/taskgraph'
178             - '--'
179             - bash
180             - -cx
181             - $let:
182                 extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
183               in:
184                 $if: 'tasks_for == "action"'
185                 then: >
186                   cd /builds/worker/checkouts/gecko &&
187                   ln -s /builds/worker/artifacts artifacts &&
188                   ./mach --log-no-times taskgraph action-callback
189                 else: >
190                   cd /builds/worker/checkouts/gecko &&
191                   ln -s /builds/worker/artifacts artifacts &&
192                   ./mach --log-no-times taskgraph decision
193                   --pushlog-id='${_pushId}'
194                   --pushdate='${_pushDate}'
195                   --project='${repository.project}'
196                   --message="$GECKO_COMMIT_MSG"
197                   --owner='${ownerEmail}'
198                   --level='${repository.level}'
199                   --base-repository="$GECKO_BASE_REPOSITORY"
200                   --head-repository="$GECKO_HEAD_REPOSITORY"
201                   --head-ref="$GECKO_HEAD_REF"
202                   --head-rev="$GECKO_HEAD_REV"
203                   ${extraArgs}
205           artifacts:
206             'public':
207               type: 'directory'
208               path: '/builds/worker/artifacts'
209               expires: {$fromNow: '1 year'}
211         extra:
212           $merge:
213             - treeherder:
214                 $merge:
215                   - machine:
216                       platform: gecko-decision
217                   - $if: 'tasks_for == "hg-push"'
218                     then:
219                       symbol: D
220                     else:
221                       $if: 'tasks_for == "action"'
222                       then:
223                         groupName: 'action-callback'
224                         groupSymbol: AC
225                         symbol: "${action.symbol}"
226                       else:
227                         groupSymbol: cron
228                         symbol: "${cron.job_symbol}"
229             - $if: 'tasks_for == "action"'
230               then:
231                 parent: '${action.taskGroupId}'
232                 action:
233                   name: '${action.name}'
234                   context:
235                     taskGroupId: '${action.taskGroupId}'
236                     taskId: {$eval: 'taskId'}
237                     input: {$eval: 'input'}
238                     parameters: {$eval: 'parameters'}
239             - $if: 'tasks_for == "cron"'
240               then:
241                 cron: {$json: {$eval: 'cron'}}
242             - tasks_for: '${tasks_for}'
243             # Email format for try pushes
244             - $if: 'tasks_for == "hg-push" && repository.project == "try"'
245               then:
246                 notify:
247                   email:
248                     subject: "Thank you for your try submission of ${push.revision}. It's the best!"
249                     content: "Your try push has been submitted. Use the link to view the status of your jobs."
250                     link:
251                       text: "Treeherder Jobs"
252                       href: "https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"
253