4 pullRequests: collaborators
9 # Github events have this stuff in different places...
11 $if: 'tasks_for in ["cron", "action"]'
12 then: '${tasks_for}@noreply.mozilla.org'
14 $if: 'tasks_for == "github-push"'
16 $if: 'event.pusher.email'
17 then: '${event.pusher.email}'
18 else: '${event.pusher.name}@users.noreply.github.com'
20 $if: 'tasks_for == "github-pull-request"'
21 then: '${event.pull_request.user.login}@users.noreply.github.com'
23 $if: 'tasks_for in ["github-push", "github-release"]'
24 then: '${event.repository.html_url}'
26 $if: 'tasks_for == "github-pull-request"'
27 then: '${event.pull_request.base.repo.html_url}'
29 $if: 'tasks_for in ["cron", "action"]'
30 then: '${repository.url}'
32 $if: 'tasks_for in ["github-push", "github-release"]'
33 then: '${event.repository.html_url}'
35 $if: 'tasks_for == "github-pull-request"'
36 then: '${event.pull_request.head.repo.html_url}'
38 $if: 'tasks_for in ["cron", "action"]'
39 then: '${repository.url}'
41 $if: 'tasks_for in ["github-push", "github-release"]'
42 then: '${event.repository.name}'
44 $if: 'tasks_for == "github-pull-request"'
45 then: '${event.pull_request.head.repo.name}'
47 $if: 'tasks_for in ["cron", "action"]'
48 then: '${repository.project}'
50 $if: 'tasks_for == "github-pull-request"'
51 then: ${event.pull_request.head.ref}
53 $if: 'tasks_for == "github-push"'
56 $if: 'tasks_for == "github-release"'
57 then: '${event.release.target_commitish}'
59 $if: 'tasks_for in ["action", "cron"]'
60 then: '${push.branch}'
62 $if: 'tasks_for == "github-push"'
63 then: '${event.after}'
65 $if: 'tasks_for == "github-pull-request"'
66 then: '${event.pull_request.head.sha}'
68 $if: 'tasks_for == "github-release"'
69 then: '${event.release.tag_name}'
71 $if: 'tasks_for in ["action", "cron"]'
72 then: '${push.revision}'
76 $if: 'tasks_for == "github-release"'
77 then: '${event.release.tag_name}'
80 $if: '"github" in tasks_for'
81 then: {$eval: as_slugid("decision_task")}
83 $if: 'tasks_for in ["cron", "action"]'
86 $if: 'tasks_for == "github-pull-request"'
90 $if: 'tasks_for == "github-release"'
95 tasks_for in ["action", "cron"]
96 || (tasks_for == "github-pull-request" && pullRequestAction in ["opened", "reopened", "synchronize"])
97 || (tasks_for == "github-push" && head_branch[:10] != "refs/tags/") && (head_branch != "staging.tmp") && (head_branch != "trying.tmp")
101 $if: 'tasks_for in ["github-push", "github-release", "action", "cron"] && repoUrl == "https://github.com/mozilla-mobile/focus-android"'
106 $if: 'head_branch[:11] == "refs/heads/"'
107 then: {$eval: 'head_branch[11:]'}
110 - $if: 'tasks_for != "action"'
112 taskId: '${ownTaskId}'
114 $if: 'tasks_for == "action"'
116 '${action.taskGroupId}'
118 '${ownTaskId}' # same as taskId; this is how automation identifies a decision task
119 schedulerId: '${trustDomain}-level-${level}'
120 created: {$fromNow: ''}
121 deadline: {$fromNow: '1 day'}
122 expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
125 - owner: "${ownerEmail}"
126 source: '${repoUrl}/raw/${head_sha}/.taskcluster.yml'
127 - $if: 'tasks_for in ["github-push", "github-pull-request", "github-release"]'
129 name: "Decision Task"
130 description: 'The task that creates all of the other tasks in the task graph'
132 $if: 'tasks_for == "action"'
134 name: "Action: ${action.title}"
136 ${action.description}
138 Action triggered by clientID `${clientId}`
140 name: "Decision Task for cron job ${cron.job_name}"
141 description: 'Created by a [cron task](https://firefox-ci-tc.services.mozilla.com/tasks/${cron.task_id})'
142 provisionerId: "mobile-${level}"
143 workerType: "decision-gcp"
145 $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
149 $if: 'tasks_for == "action"'
151 kind: 'action-callback'
153 $if: 'tasks_for == "cron"'
159 - $if: 'level == "3" || repoUrl == "https://github.com/mozilla-releng/staging-focus-android"'
161 - tc-treeherder.v2.${project}.${head_sha}
162 # TODO Bug 1601928: Make this scope fork-friendly once ${project} is better defined. This will enable
163 # staging release promotion on forks.
164 - $if: 'tasks_for == "github-push"'
166 - index.mobile.v2.${project}.branch.${short_head_branch}.latest.taskgraph.decision
167 - index.mobile.v2.${project}.branch.${short_head_branch}.revision.${head_sha}.taskgraph.decision
168 - index.mobile.v2.${project}.revision.${head_sha}.taskgraph.decision
169 - $if: 'tasks_for == "cron"'
171 # cron context provides ${head_branch} as a short one
172 - index.mobile.v2.${project}.branch.${head_branch}.latest.taskgraph.decision-${cron.job_name}
173 - index.mobile.v2.${project}.branch.${head_branch}.revision.${head_sha}.taskgraph.decision-${cron.job_name}
174 - index.mobile.v2.${project}.branch.${head_branch}.revision.${head_sha}.taskgraph.cron.${ownTaskId}
176 $if: 'tasks_for == "github-push"'
178 # `https://` is 8 characters so, ${repoUrl[8:]} is the repository without the protocol.
179 - 'assume:repo:${repoUrl[8:]}:branch:${short_head_branch}'
181 $if: 'tasks_for == "github-pull-request"'
183 - 'assume:repo:github.com/${event.pull_request.base.repo.full_name}:pull-request'
185 $if: 'tasks_for == "github-release"'
187 - 'assume:repo:${repoUrl[8:]}:release'
189 $if: 'tasks_for == "action"'
191 # when all actions are hooks, we can calculate this directly rather than using a variable
192 - '${action.repo_scope}'
194 - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
196 requires: all-completed
202 # run-task uses these to check out the source; the inputs
203 # to `mach taskgraph decision` are all on the command line.
205 - MOBILE_BASE_REPOSITORY: '${baseRepoUrl}'
206 MOBILE_HEAD_REPOSITORY: '${repoUrl}'
207 MOBILE_HEAD_REF: '${head_branch}'
208 MOBILE_HEAD_REV: '${head_sha}'
209 MOBILE_HEAD_TAG: '${head_tag}'
210 MOBILE_PIP_REQUIREMENTS: taskcluster/requirements.txt
211 MOBILE_REPOSITORY_TYPE: git
213 REPOSITORIES: {$json: {mobile: "Focus-Android"}}
214 ANDROID_SDK_ROOT: /builds/worker/android-sdk
215 - $if: 'tasks_for in ["github-pull-request"]'
217 MOBILE_PULL_REQUEST_NUMBER: '${event.pull_request.number}'
218 - $if: 'tasks_for == "action"'
220 ACTION_TASK_GROUP_ID: '${action.taskGroupId}' # taskGroupId of the target task
221 ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
222 ACTION_INPUT: {$json: {$eval: 'input'}}
223 ACTION_CALLBACK: '${action.cb_name}'
224 - $if: 'tasks_for == "github-release"'
226 MOBILE_HEAD_TAG: '${event.release.tag_name}'
228 taskclusterProxy: true
230 # Note: This task is built server side without the context or tooling that
231 # exist in tree so we must hard code the hash
233 mozillareleases/taskgraph:decision-mobile-625975b642c148be4c6f1d8ee5cedf7399f5d0dd33d275ff69d5934e3082d4a9@sha256:bfb26700182486e1c6c52701baea6f386fa39e5e25417423c27845933605ad43
238 - /usr/local/bin/run-task
239 - '--mobile-checkout=/builds/worker/checkouts/vcs'
240 - '--task-cwd=/builds/worker/checkouts/vcs'
245 extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
247 $if: 'tasks_for == "action"'
249 taskcluster/scripts/decision-install-sdk.sh &&
250 ln -s /builds/worker/artifacts artifacts &&
251 ~/.local/bin/taskgraph action-callback
253 taskcluster/scripts/decision-install-sdk.sh &&
254 ln -s /builds/worker/artifacts artifacts &&
255 ~/.local/bin/taskgraph decision
258 --project='${project}'
260 --owner='${ownerEmail}'
262 --base-repository="$MOBILE_BASE_REPOSITORY"
263 --head-repository="$MOBILE_HEAD_REPOSITORY"
264 --head-ref="$MOBILE_HEAD_REF"
265 --head-rev="$MOBILE_HEAD_REV"
266 --head-tag="$MOBILE_HEAD_TAG"
267 --repository-type="$MOBILE_REPOSITORY_TYPE"
268 --tasks-for='${tasks_for}'
274 path: '/builds/worker/artifacts'
275 expires: {$fromNow: '1 year'}
276 'public/docker-contexts':
278 path: '/builds/worker/checkouts/vcs/docker-contexts'
279 # This needs to be at least the deadline of the
280 # decision task + the docker-image task deadlines.
281 # It is set to a week to allow for some time for
282 # debugging, but they are not useful long-term.
283 expires: {$fromNow: '7 day'}
290 platform: gecko-decision
291 - $if: 'tasks_for in ["github-push", "github-pull-request"]'
295 $if: 'tasks_for == "github-release"'
297 symbol: 'ship_focus_android'
299 $if: 'tasks_for == "action"'
301 groupName: 'action-callback'
303 symbol: "${action.symbol}"
306 symbol: "${cron.job_symbol}"
307 - $if: 'tasks_for == "action"'
309 parent: '${action.taskGroupId}'
311 name: '${action.name}'
313 taskGroupId: '${action.taskGroupId}'
314 taskId: {$eval: 'taskId'}
315 input: {$eval: 'input'}
316 clientId: {$eval: 'clientId'}
317 - $if: 'tasks_for == "cron"'
319 cron: {$json: {$eval: 'cron'}}
320 - tasks_for: '${tasks_for}'