2019-09-12 12:06:28 +00:00
|
|
|
---
|
2019-01-08 00:58:02 +00:00
|
|
|
version: 1
|
2019-09-12 12:06:28 +00:00
|
|
|
reporting: checks-v1
|
2019-01-08 00:58:02 +00:00
|
|
|
policy:
|
2019-09-12 12:06:28 +00:00
|
|
|
# XXX We restrict taskcluster to collaborators so priviledged tests (like UI tests) can run on PRs
|
|
|
|
pullRequests: collaborators
|
2019-01-08 00:58:02 +00:00
|
|
|
tasks:
|
2019-09-12 12:06:28 +00:00
|
|
|
- $let:
|
|
|
|
taskgraph:
|
|
|
|
branch: taskgraph
|
2021-11-23 21:27:39 +00:00
|
|
|
revision: d85f4e4213706ec7737c7257f681977fdf20eb60
|
2019-09-12 12:06:28 +00:00
|
|
|
trustDomain: mobile
|
2019-01-08 00:58:02 +00:00
|
|
|
in:
|
2019-09-13 08:08:51 +00:00
|
|
|
$let:
|
|
|
|
# Github events have this stuff in different places...
|
|
|
|
ownerEmail:
|
2019-10-11 12:49:16 +00:00
|
|
|
$if: 'tasks_for in ["cron", "action"]'
|
|
|
|
then: '${tasks_for}@noreply.mozilla.org'
|
|
|
|
else:
|
2020-09-21 09:46:02 +00:00
|
|
|
$if: 'event.sender.login == "bors[bot]"'
|
|
|
|
then: 'skaspari+mozlando@mozilla.com' # It must match what's in bors.toml
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2020-09-21 09:46:02 +00:00
|
|
|
$if: 'tasks_for == "github-push"'
|
|
|
|
then: '${event.pusher.email}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2020-09-21 09:46:02 +00:00
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: '${event.pull_request.user.login}@users.noreply.github.com'
|
2019-09-13 08:08:51 +00:00
|
|
|
baseRepoUrl:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for == "github-push"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then: '${event.repository.html_url}'
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: '${event.pull_request.base.repo.html_url}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-09-13 08:08:51 +00:00
|
|
|
$if: 'tasks_for in ["cron", "action"]'
|
|
|
|
then: '${repository.url}'
|
|
|
|
repoUrl:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for == "github-push"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then: '${event.repository.html_url}'
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: '${event.pull_request.head.repo.html_url}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-09-13 08:08:51 +00:00
|
|
|
$if: 'tasks_for in ["cron", "action"]'
|
|
|
|
then: '${repository.url}'
|
|
|
|
project:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for == "github-push"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then: '${event.repository.name}'
|
|
|
|
else:
|
2019-09-12 12:06:28 +00:00
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then: '${event.pull_request.head.repo.name}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-09-13 08:08:51 +00:00
|
|
|
$if: 'tasks_for in ["cron", "action"]'
|
|
|
|
then: '${repository.project}'
|
|
|
|
head_branch:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: ${event.pull_request.head.ref}
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-push"'
|
|
|
|
then: ${event.ref}
|
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for in ["action", "cron"]'
|
|
|
|
then: '${push.branch}'
|
2019-09-13 08:08:51 +00:00
|
|
|
head_sha:
|
|
|
|
$if: 'tasks_for == "github-push"'
|
|
|
|
then: '${event.after}'
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: '${event.pull_request.head.sha}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for in ["action", "cron"]'
|
|
|
|
then: '${push.revision}'
|
2020-01-22 03:57:26 +00:00
|
|
|
|
2019-09-13 08:08:51 +00:00
|
|
|
ownTaskId:
|
|
|
|
$if: '"github" in tasks_for'
|
|
|
|
then: {$eval: as_slugid("decision_task")}
|
|
|
|
else:
|
2019-11-28 13:49:34 +00:00
|
|
|
$if: 'tasks_for in ["cron", "action"]'
|
2019-09-13 08:08:51 +00:00
|
|
|
then: '${ownTaskId}'
|
2020-03-03 13:33:48 +00:00
|
|
|
pullRequestAction:
|
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
|
|
then: ${event.action}
|
|
|
|
else: 'UNDEFINED'
|
2019-09-13 08:08:51 +00:00
|
|
|
in:
|
2020-03-03 13:33:48 +00:00
|
|
|
$if: >
|
|
|
|
tasks_for in ["action", "cron"]
|
2020-04-20 09:25:37 +00:00
|
|
|
|| (tasks_for == "github-pull-request" && pullRequestAction in ["opened", "reopened", "synchronize"])
|
2021-02-16 16:47:16 +00:00
|
|
|
|| (tasks_for == "github-push" && head_branch[:10] != "refs/tags/") && (head_branch != "staging.tmp") && (head_branch != "trying.tmp") && (head_branch[:8] != "mergify/")
|
2019-09-13 08:08:51 +00:00
|
|
|
then:
|
2019-09-12 12:06:28 +00:00
|
|
|
$let:
|
|
|
|
level:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for in ["github-push", "action", "cron"] && repoUrl == "https://github.com/mozilla-mobile/fenix"'
|
2019-09-12 12:06:28 +00:00
|
|
|
then: '3'
|
2019-09-13 10:48:22 +00:00
|
|
|
else: '1'
|
2019-11-28 13:49:34 +00:00
|
|
|
|
|
|
|
short_head_branch:
|
|
|
|
$if: 'head_branch[:11] == "refs/heads/"'
|
|
|
|
then: {$eval: 'head_branch[11:]'}
|
2019-09-12 12:06:28 +00:00
|
|
|
in:
|
2019-11-28 13:49:34 +00:00
|
|
|
$mergeDeep:
|
|
|
|
- $if: 'tasks_for != "action"'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
taskId: '${ownTaskId}'
|
|
|
|
- taskGroupId:
|
|
|
|
$if: 'tasks_for == "action"'
|
|
|
|
then:
|
|
|
|
'${action.taskGroupId}'
|
|
|
|
else:
|
|
|
|
'${ownTaskId}' # same as taskId; this is how automation identifies a decision task
|
|
|
|
schedulerId: '${trustDomain}-level-${level}'
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '1 day'}
|
|
|
|
expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
|
|
|
|
metadata:
|
|
|
|
$merge:
|
|
|
|
- owner: "${ownerEmail}"
|
|
|
|
source: '${repoUrl}/raw/${head_sha}/.taskcluster.yml'
|
2022-01-14 12:04:02 +00:00
|
|
|
- $if: 'tasks_for in ["github-push", "github-pull-request"]'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
name: "Decision Task"
|
|
|
|
description: 'The task that creates all of the other tasks in the task graph'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-11-28 13:49:34 +00:00
|
|
|
$if: 'tasks_for == "action"'
|
|
|
|
then:
|
|
|
|
name: "Action: ${action.title}"
|
2020-05-14 14:45:11 +00:00
|
|
|
description: |
|
|
|
|
${action.description}
|
|
|
|
|
|
|
|
Action triggered by clientID `${clientId}`
|
2019-11-28 13:49:34 +00:00
|
|
|
else:
|
|
|
|
name: "Decision Task for cron job ${cron.job_name}"
|
|
|
|
description: 'Created by a [cron task](https://firefox-ci-tc.services.mozilla.com/tasks/${cron.task_id})'
|
|
|
|
provisionerId: "mobile-${level}"
|
|
|
|
workerType: "decision"
|
|
|
|
tags:
|
|
|
|
$if: 'tasks_for in ["github-push", "github-pull-request"]'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
kind: decision-task
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-11-28 13:49:34 +00:00
|
|
|
$if: 'tasks_for == "action"'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
kind: 'action-callback'
|
|
|
|
else:
|
|
|
|
$if: 'tasks_for == "cron"'
|
|
|
|
then:
|
|
|
|
kind: cron-task
|
|
|
|
routes:
|
|
|
|
$flattenDeep:
|
|
|
|
- checks
|
2021-01-27 01:28:59 +00:00
|
|
|
- $if: 'level == "3" || repoUrl == "https://github.com/mozilla-releng/staging-fenix"'
|
2019-11-28 13:49:34 +00:00
|
|
|
then:
|
|
|
|
- tc-treeherder.v2.${project}.${head_sha}
|
|
|
|
# TODO Bug 1601928: Make this scope fork-friendly once ${project} is better defined. This will enable
|
|
|
|
# staging release promotion on forks.
|
|
|
|
- $if: 'tasks_for == "github-push"'
|
|
|
|
then:
|
2020-05-13 09:01:08 +00:00
|
|
|
- index.mobile.v2.${project}.branch.${short_head_branch}.latest.taskgraph.decision
|
|
|
|
- index.mobile.v2.${project}.branch.${short_head_branch}.revision.${head_sha}.taskgraph.decision
|
2020-05-14 09:32:58 +00:00
|
|
|
- index.mobile.v2.${project}.revision.${head_sha}.taskgraph.decision
|
2019-11-28 13:49:34 +00:00
|
|
|
- $if: 'tasks_for == "cron"'
|
|
|
|
then:
|
2019-12-20 10:54:56 +00:00
|
|
|
# cron context provides ${head_branch} as a short one
|
2020-05-13 09:01:08 +00:00
|
|
|
- index.mobile.v2.${project}.branch.${head_branch}.latest.taskgraph.decision-${cron.job_name}
|
|
|
|
- index.mobile.v2.${project}.branch.${head_branch}.revision.${head_sha}.taskgraph.decision-${cron.job_name}
|
|
|
|
- index.mobile.v2.${project}.branch.${head_branch}.revision.${head_sha}.taskgraph.cron.${ownTaskId}
|
2019-11-28 13:49:34 +00:00
|
|
|
scopes:
|
|
|
|
$if: 'tasks_for == "github-push"'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
# `https://` is 8 characters so, ${repoUrl[8:]} is the repository without the protocol.
|
|
|
|
- 'assume:repo:${repoUrl[8:]}:branch:${short_head_branch}'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2019-11-28 13:49:34 +00:00
|
|
|
$if: 'tasks_for == "github-pull-request"'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
- 'assume:repo:github.com/${event.pull_request.base.repo.full_name}:pull-request'
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for == "action"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then:
|
2022-01-14 12:04:02 +00:00
|
|
|
# when all actions are hooks, we can calculate this directly rather than using a variable
|
|
|
|
- '${action.repo_scope}'
|
2019-09-13 08:08:51 +00:00
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
- 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
requires: all-completed
|
|
|
|
priority: lowest
|
|
|
|
retries: 5
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
payload:
|
|
|
|
env:
|
|
|
|
# run-task uses these to check out the source; the inputs
|
|
|
|
# to `mach taskgraph decision` are all on the command line.
|
|
|
|
$merge:
|
|
|
|
- MOBILE_BASE_REPOSITORY: '${baseRepoUrl}'
|
|
|
|
MOBILE_HEAD_REPOSITORY: '${repoUrl}'
|
|
|
|
MOBILE_HEAD_REF: '${head_branch}'
|
|
|
|
MOBILE_HEAD_REV: '${head_sha}'
|
|
|
|
MOBILE_REPOSITORY_TYPE: git
|
|
|
|
TASKGRAPH_BASE_REPOSITORY: https://hg.mozilla.org/ci/taskgraph
|
|
|
|
TASKGRAPH_HEAD_REPOSITORY: https://hg.mozilla.org/ci/${taskgraph.branch}
|
|
|
|
TASKGRAPH_HEAD_REV: ${taskgraph.revision}
|
|
|
|
TASKGRAPH_REPOSITORY_TYPE: hg
|
|
|
|
REPOSITORIES: {$json: {mobile: "Fenix", taskgraph: "Taskgraph"}}
|
|
|
|
HG_STORE_PATH: /builds/worker/checkouts/hg-store
|
|
|
|
ANDROID_SDK_ROOT: /builds/worker/android-sdk
|
|
|
|
- $if: 'tasks_for in ["github-pull-request"]'
|
|
|
|
then:
|
|
|
|
MOBILE_PULL_REQUEST_NUMBER: '${event.pull_request.number}'
|
|
|
|
- $if: 'tasks_for == "action"'
|
|
|
|
then:
|
|
|
|
ACTION_TASK_GROUP_ID: '${action.taskGroupId}' # taskGroupId of the target task
|
|
|
|
ACTION_TASK_ID: {$json: {$eval: 'taskId'}} # taskId of the target task (JSON-encoded)
|
|
|
|
ACTION_INPUT: {$json: {$eval: 'input'}}
|
|
|
|
ACTION_CALLBACK: '${action.cb_name}'
|
|
|
|
features:
|
|
|
|
taskclusterProxy: true
|
|
|
|
chainOfTrust: true
|
|
|
|
# Note: This task is built server side without the context or tooling that
|
|
|
|
# exist in tree so we must hard code the hash
|
|
|
|
image:
|
2021-06-09 19:52:28 +00:00
|
|
|
mozillareleases/taskgraph:decision-mobile-44b6b7b4c370220eff56efa8b508aa5157ef9c6e74847c7ecc19d640946ba49e@sha256:4107cbc5e154502529e4d38efa4dc89c05ee54e2cbc6e2e66023e68407502894
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
maxRunTime: 1800
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
command:
|
|
|
|
- /usr/local/bin/run-task
|
2021-11-23 21:27:39 +00:00
|
|
|
- '--mobile-checkout=/builds/worker/checkouts/vcs'
|
2019-11-28 13:49:34 +00:00
|
|
|
- '--taskgraph-checkout=/builds/worker/checkouts/taskgraph'
|
2021-11-23 21:27:39 +00:00
|
|
|
- '--task-cwd=/builds/worker/checkouts/vcs'
|
2019-11-28 13:49:34 +00:00
|
|
|
- '--'
|
|
|
|
- bash
|
|
|
|
- -cx
|
|
|
|
- $let:
|
|
|
|
extraArgs: {$if: 'tasks_for == "cron"', then: '${cron.quoted_args}', else: ''}
|
|
|
|
in:
|
|
|
|
$if: 'tasks_for == "action"'
|
|
|
|
then: >
|
2021-06-09 19:52:28 +00:00
|
|
|
PIP_IGNORE_INSTALLED=0 pip3 install --user /builds/worker/checkouts/taskgraph &&
|
|
|
|
PIP_IGNORE_INSTALLED=0 pip3 install --user mozilla-version &&
|
2020-04-01 16:29:35 +00:00
|
|
|
taskcluster/scripts/decision-install-sdk.sh &&
|
2019-11-28 13:49:34 +00:00
|
|
|
ln -s /builds/worker/artifacts artifacts &&
|
|
|
|
~/.local/bin/taskgraph action-callback
|
|
|
|
else: >
|
2021-06-09 19:52:28 +00:00
|
|
|
PIP_IGNORE_INSTALLED=0 pip3 install --user /builds/worker/checkouts/taskgraph &&
|
|
|
|
PIP_IGNORE_INSTALLED=0 pip3 install --user mozilla-version &&
|
2020-04-01 16:29:35 +00:00
|
|
|
taskcluster/scripts/decision-install-sdk.sh &&
|
2019-11-28 13:49:34 +00:00
|
|
|
ln -s /builds/worker/artifacts artifacts &&
|
|
|
|
~/.local/bin/taskgraph decision
|
|
|
|
--pushlog-id='0'
|
|
|
|
--pushdate='0'
|
|
|
|
--project='${project}'
|
|
|
|
--message=""
|
|
|
|
--owner='${ownerEmail}'
|
|
|
|
--level='${level}'
|
|
|
|
--base-repository="$MOBILE_BASE_REPOSITORY"
|
|
|
|
--head-repository="$MOBILE_HEAD_REPOSITORY"
|
|
|
|
--head-ref="$MOBILE_HEAD_REF"
|
|
|
|
--head-rev="$MOBILE_HEAD_REV"
|
|
|
|
--repository-type="$MOBILE_REPOSITORY_TYPE"
|
|
|
|
--tasks-for='${tasks_for}'
|
|
|
|
${extraArgs}
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
artifacts:
|
|
|
|
'public':
|
|
|
|
type: 'directory'
|
|
|
|
path: '/builds/worker/artifacts'
|
|
|
|
expires: {$fromNow: '1 year'}
|
2020-07-17 22:30:55 +00:00
|
|
|
'public/docker-contexts':
|
|
|
|
type: 'directory'
|
2021-11-23 21:27:39 +00:00
|
|
|
path: '/builds/worker/checkouts/vcs/docker-contexts'
|
2020-07-17 22:30:55 +00:00
|
|
|
# This needs to be at least the deadline of the
|
|
|
|
# decision task + the docker-image task deadlines.
|
|
|
|
# It is set to a week to allow for some time for
|
|
|
|
# debugging, but they are not useful long-term.
|
|
|
|
expires: {$fromNow: '7 day'}
|
2019-09-12 12:06:28 +00:00
|
|
|
|
2019-11-28 13:49:34 +00:00
|
|
|
extra:
|
|
|
|
$merge:
|
|
|
|
- treeherder:
|
|
|
|
$merge:
|
|
|
|
- machine:
|
|
|
|
platform: gecko-decision
|
|
|
|
- $if: 'tasks_for in ["github-push", "github-pull-request"]'
|
2019-09-12 12:06:28 +00:00
|
|
|
then:
|
2019-11-28 13:49:34 +00:00
|
|
|
symbol: D
|
2019-09-12 12:06:28 +00:00
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
$if: 'tasks_for == "action"'
|
2019-09-13 08:08:51 +00:00
|
|
|
then:
|
2022-01-14 12:04:02 +00:00
|
|
|
groupName: 'action-callback'
|
|
|
|
groupSymbol: AC
|
|
|
|
symbol: "${action.symbol}"
|
2019-09-13 08:08:51 +00:00
|
|
|
else:
|
2022-01-14 12:04:02 +00:00
|
|
|
groupSymbol: cron
|
|
|
|
symbol: "${cron.job_symbol}"
|
2019-11-28 13:49:34 +00:00
|
|
|
- $if: 'tasks_for == "action"'
|
|
|
|
then:
|
|
|
|
parent: '${action.taskGroupId}'
|
|
|
|
action:
|
|
|
|
name: '${action.name}'
|
|
|
|
context:
|
|
|
|
taskGroupId: '${action.taskGroupId}'
|
|
|
|
taskId: {$eval: 'taskId'}
|
|
|
|
input: {$eval: 'input'}
|
2020-05-14 14:45:11 +00:00
|
|
|
clientId: {$eval: 'clientId'}
|
2019-11-28 13:49:34 +00:00
|
|
|
- $if: 'tasks_for == "cron"'
|
|
|
|
then:
|
|
|
|
cron: {$json: {$eval: 'cron'}}
|
|
|
|
- tasks_for: '${tasks_for}'
|