Bug 1493442 [wpt PR 13169] - Update interfaces/picture-in-picture.idl, a=testonly
[gecko.git] / .taskcluster.yml
blobbf0ff06eb90d1a852973b90e099ca8b101ce88ca
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                 # These are the old index routes for the decision task.
85                 # They are still here so external tools that referenced them continue to work.
86                 - "index.gecko.v2.${repository.project}.latest.firefox.decision"
87                 - "index.gecko.v2.${repository.project}.revision.${push.revision}.firefox.decision"
88               else:
89                 $if: 'tasks_for == "action"'
90                 then:
91                 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-failed"
92                 - "notify.email.taskcluster-notifications+action-task@mozilla.com.on-exception"
93                 - "index.gecko.v2.${repository.project}.pushlog-id.${_pushId}.actions.${ownTaskId}"
94                 else:  # cron
95                 - "index.gecko.v2.${repository.project}.latest.taskgraph.decision-${cron.job_name}"
96                 # These are the old index routes for the decision task.
97                 - "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
99         scopes:
100           $if: 'tasks_for == "hg-push"'
101           then:
102             - 'assume:repo:${repoUrl[8:]}:branch:default'
103             - 'queue:route:notify.email.${ownerEmail}.*'
104             - 'in-tree:hook-action:project-gecko/in-tree-action-${repository.level}-*'
105           else:
106             $if: 'tasks_for == "action"'
107             then:
108               # when all actions are hooks, we can calculate this directly rather than using a variable
109               - '${action.repo_scope}'
110             else:
111               - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
113         dependencies: []
114         requires: all-completed
116         priority:
117           # Most times, there is plenty of worker capacity so everything runs
118           # quickly, but sometimes a storm of action tasks lands.  Then we
119           # want, from highest to lowest:
120           # - cron tasks (time-sensitive) (low)
121           # - decision tasks (minimize user-visible delay) (very-low)
122           # - action tasks (avoid interfering with the other two) (lowest)
123           # SCM levels all use different workerTypes, so there is no need for priority
124           # between levels; "low" is the highest priority available at all levels, and
125           # nothing runs at any higher priority on these workerTypes.
126           $if: "tasks_for == 'cron'"
127           then: low
128           else:
129             $if: "tasks_for == 'hg-push'"
130             then: very-low
131             else: lowest  # tasks_for == 'action'
132         retries: 5
134         payload:
135           env:
136             # checkout-gecko uses these to check out the source; the inputs
137             # to `mach taskgraph decision` are all on the command line.
138             $merge:
139               - GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
140                 GECKO_HEAD_REPOSITORY: '${repoUrl}'
141                 GECKO_HEAD_REF: '${push.revision}'
142                 GECKO_HEAD_REV: '${push.revision}'
143                 GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${_pushComment}'}
144                 HG_STORE_PATH: /builds/worker/checkouts/hg-store
145                 TASKCLUSTER_CACHES: /builds/worker/checkouts
146               - $if: 'tasks_for == "action"'
147                 then:
148                   ACTION_TASK_GROUP_ID: '${action.taskGroupId}'     # taskGroupId of the target task
149                   ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
150                   ACTION_INPUT: {$json: {$eval: 'input'}}
151                   ACTION_CALLBACK: '${action.cb_name}'
152                   ACTION_PARAMETERS: {$json: {$eval: 'parameters'}}
154           cache:
155             level-${repository.level}-checkouts-sparse-v2: /builds/worker/checkouts
157           features:
158             taskclusterProxy: true
159             chainOfTrust: true
161           # Note: This task is built server side without the context or tooling that
162           # exist in tree so we must hard code the hash
163           image: 'taskcluster/decision:2.1.0@sha256:6db3b697d7a3c7aba440d72f04199331b872111cefff57206b8b8b1d53230360'
165           maxRunTime: 1800
167           command:
168             - /builds/worker/bin/run-task
169             - '--vcs-checkout=/builds/worker/checkouts/gecko'
170             - '--sparse-profile=build/sparse-profiles/taskgraph'
171             - '--'
172             - bash
173             - -cx
174             - $let:
175                 extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
176               in:
177                 $if: 'tasks_for == "action"'
178                 then: >
179                   cd /builds/worker/checkouts/gecko &&
180                   ln -s /builds/worker/artifacts artifacts &&
181                   ./mach --log-no-times taskgraph action-callback
182                 else: >
183                   cd /builds/worker/checkouts/gecko &&
184                   ln -s /builds/worker/artifacts artifacts &&
185                   ./mach --log-no-times taskgraph decision
186                   --pushlog-id='${_pushId}'
187                   --pushdate='${_pushDate}'
188                   --project='${repository.project}'
189                   --message="$GECKO_COMMIT_MSG"
190                   --owner='${ownerEmail}'
191                   --level='${repository.level}'
192                   --base-repository="$GECKO_BASE_REPOSITORY"
193                   --head-repository="$GECKO_HEAD_REPOSITORY"
194                   --head-ref="$GECKO_HEAD_REF"
195                   --head-rev="$GECKO_HEAD_REV"
196                   ${extraArgs}
198           artifacts:
199             'public':
200               type: 'directory'
201               path: '/builds/worker/artifacts'
202               expires: {$fromNow: '1 year'}
204         extra:
205           $merge:
206             - treeherder:
207                 $merge:
208                   - machine:
209                       platform: gecko-decision
210                   - $if: 'tasks_for == "hg-push"'
211                     then:
212                       symbol: D
213                     else:
214                       $if: 'tasks_for == "action"'
215                       then:
216                         groupName: 'action-callback'
217                         groupSymbol: AC
218                         symbol: "${action.symbol}"
219                       else:
220                         groupSymbol: cron
221                         symbol: "${cron.job_symbol}"
222             - $if: 'tasks_for == "action"'
223               then:
224                 parent: '${action.taskGroupId}'
225                 action:
226                   name: '${action.name}'
227                   context:
228                     taskGroupId: '${action.taskGroupId}'
229                     taskId: {$eval: 'taskId'}
230                     input: {$eval: 'input'}
231                     parameters: {$eval: 'parameters'}
232             - $if: 'tasks_for == "cron"'
233               then:
234                 cron: {$json: {$eval: 'cron'}}
235             - tasks_for: '${tasks_for}'
236             # Email format for try pushes
237             - $if: 'tasks_for == "hg-push" && repository.project == "try"'
238               then:
239                 notify:
240                   email:
241                     subject: "Thank you for your try submission of ${push.revision}. It's the best!"
242                     content: "Your try push has been submitted. Use the link to view the status of your jobs."
243                     link:
244                       text: "Treeherder Jobs"
245                       href: "https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"
246