bugbug/.taskcluster.yml

379 строки
15 KiB
YAML
Исходник Обычный вид История

version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
user: ${event.sender.login}
head_branch:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.ref}
else:
$if: 'tasks_for == "github-push"'
then: ${event.ref}
else: ${event.release.target_commitish}
head_rev:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.sha}
else:
$if: 'tasks_for == "github-push"'
then: ${event.after}
else: ${event.release.tag_name}
repository:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
2019-09-04 13:37:58 +03:00
2023-09-21 18:30:47 +03:00
taskboot_image: "mozilla/taskboot:0.4.2"
in:
2020-04-07 20:47:52 +03:00
$if: 'tasks_for == "github-push" || (tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])'
then:
- taskId: { $eval: as_slugid("lint_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: batch
payload:
maxRunTime: 3600
2023-07-07 02:10:57 +03:00
image: python:3.10
command:
- "/bin/bash"
- "-lcx"
2019-06-08 12:19:01 +03:00
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r test-requirements.txt &&
pre-commit run -a --show-diff-on-failure"
metadata:
name: bugbug lint
description: bugbug lint
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push"'
then:
taskId: { $eval: as_slugid("version_check_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: batch
payload:
maxRunTime: 3600
2023-07-07 02:10:57 +03:00
image: python:3.10
command:
- "/bin/bash"
- "-lcx"
2019-06-08 12:19:01 +03:00
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/version_check.py"
metadata:
name: bugbug tag version check
description: bugbug tag version check
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("tests_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: compute-smaller
payload:
maxRunTime: 3600
2023-07-07 02:10:57 +03:00
image: python:3.10
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
2022-02-03 20:52:15 +03:00
apt-get -qq install -y libhdf5-dev zstd &&
git clone --quiet ${repository} &&
2021-04-09 20:30:48 +03:00
curl -L https://github.com/mozilla/rust-code-analysis/releases/download/v0.0.23/rust-code-analysis-linux-web-x86_64.tar.gz | tar -C /usr/bin -xzv &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cp infra/hgrc /etc/mercurial/hgrc.d/bugbug.rc &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r requirements.txt &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r extra-nlp-requirements.txt &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r infra/spawn_pipeline_requirements.txt &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r test-requirements.txt &&
hg clone -r 7436689a409528730ee6a7a2a5e763c9fb821a8f https://hg.mozilla.org/hgcustom/version-control-tools /version-control-tools/ &&
python -m pytest --cov=./ tests/test_*.py &&
bash <(curl -s https://codecov.io/bash)"
metadata:
name: bugbug tests
description: bugbug tests
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("http_tests_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: compute-smaller
2019-08-01 16:33:20 +03:00
payload:
maxRunTime: 3600
2023-07-07 02:10:57 +03:00
image: python:3.10
2019-08-01 16:33:20 +03:00
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y zstd &&
git clone --quiet ${repository} &&
2021-04-09 20:30:48 +03:00
curl -L https://github.com/mozilla/rust-code-analysis/releases/download/v0.0.23/rust-code-analysis-linux-web-x86_64.tar.gz | tar -C /usr/bin -xzv &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cp infra/hgrc /etc/mercurial/hgrc.d/bugbug.rc &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off . &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r test-requirements.txt &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off ./http_service &&
hg clone -r 7436689a409528730ee6a7a2a5e763c9fb821a8f https://hg.mozilla.org/hgcustom/version-control-tools /version-control-tools/ &&
pytest --cov=http_service http_service/tests/ -vvv &&
bash <(curl -s https://codecov.io/bash)"
2019-08-01 16:33:20 +03:00
metadata:
name: bugbug http service tests
description: bugbug http service tests
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("packaging_test_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: batch
payload:
maxRunTime: 3600
2023-07-07 02:10:57 +03:00
image: python:3.10
2019-06-08 21:50:59 +03:00
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y libhdf5-dev &&
git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off -r test-requirements.txt &&
python -m coverage run setup.py sdist &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off dist/bugbug-$(cat VERSION).tar.gz &&
pip install --disable-pip-version-check --no-cache-dir --progress-bar off dist/bugbug-$(cat VERSION).tar.gz[nlp] &&
bash <(curl -s https://codecov.io/bash)"
metadata:
name: bugbug packaging test
description: bugbug packaging test
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("docker_build") }
created: { $fromNow: "" }
deadline: { $fromNow: "3 hours" }
provisionerId: proj-bugbug
workerType: ci
payload:
capabilities:
privileged: true
maxRunTime: 10800
2019-09-04 13:37:58 +03:00
image: "${taskboot_image}"
2019-06-06 19:06:16 +03:00
env:
REGISTRY: registry.hub.docker.com
VERSION:
$if: 'head_branch[:10] == "refs/tags/"'
then: { $eval: "head_branch[10:]" }
2019-06-06 19:06:16 +03:00
else: "latest"
command:
2019-04-15 18:36:30 +03:00
- "/bin/sh"
- "-lcxe"
2019-06-08 12:19:01 +03:00
- "git clone --quiet ${repository} /code &&
cd /code &&
git -c advice.detachedHead=false checkout ${head_rev} &&
2023-09-21 18:30:47 +03:00
taskboot --target /code build-compose --write /images --build-arg CHECK_MODELS=0 --tag $VERSION --tag latest"
artifacts:
2019-04-15 18:36:30 +03:00
public/bugbug:
expires: { $fromNow: "2 weeks" }
2019-04-15 18:36:30 +03:00
path: /images
type: directory
scopes:
- docker-worker:capability:privileged
metadata:
name: bugbug docker build
description: bugbug docker build
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("frontend_build") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
2020-11-21 02:24:02 +03:00
provisionerId: proj-bugbug
workerType: batch
payload:
maxRunTime: 3600
image: node:lts
2020-11-21 02:24:02 +03:00
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} /bugbug &&
cd /bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cd ui/changes &&
npm install --no-progress &&
npm run release"
2020-11-21 02:24:02 +03:00
artifacts:
public/frontend:
expires: { $fromNow: "2 weeks" }
2020-11-21 02:24:02 +03:00
path: /bugbug/ui/changes/dist
type: directory
metadata:
name: bugbug ui build
description: bugbug ui build
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
dependencies:
- { $eval: as_slugid("lint_task") }
- { $eval: as_slugid("tests_task") }
- { $eval: as_slugid("http_tests_task") }
- { $eval: as_slugid("frontend_build") }
- { $eval: as_slugid("packaging_test_task") }
- { $eval: as_slugid("version_check_task") }
- { $eval: as_slugid("integration_test") }
scopes:
- secrets:get:project/bugbug/deploy
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: batch
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
2019-09-04 13:37:58 +03:00
image: "${taskboot_image}"
command:
2019-09-04 13:37:58 +03:00
- taskboot
- deploy-pypi
env:
TASKCLUSTER_SECRET: project/bugbug/deploy
2019-09-04 13:37:58 +03:00
GIT_REPOSITORY: "${repository}"
GIT_REVISION: "${head_rev}"
metadata:
name: bugbug PyPI release
description: bugbug PyPI release
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
2019-04-18 20:49:12 +03:00
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
dependencies:
- { $eval: as_slugid("docker_build") }
- { $eval: as_slugid("lint_task") }
- { $eval: as_slugid("version_check_task") }
- { $eval: as_slugid("tests_task") }
- { $eval: as_slugid("http_tests_task") }
- { $eval: as_slugid("frontend_build") }
- { $eval: as_slugid("packaging_test_task") }
2019-04-18 20:49:12 +03:00
scopes:
- secrets:get:project/bugbug/deploy
taskId: { $eval: as_slugid("docker_push") }
created: { $fromNow: "" }
deadline: { $fromNow: "4 hours" }
provisionerId: proj-bugbug
workerType: batch
2019-04-18 20:49:12 +03:00
payload:
features:
taskclusterProxy: true
2019-04-18 20:49:12 +03:00
maxRunTime: 3600
2019-09-04 13:37:58 +03:00
image: "${taskboot_image}"
2019-04-18 20:49:12 +03:00
env:
TASKCLUSTER_SECRET: project/bugbug/deploy
2019-04-18 20:49:12 +03:00
command:
- taskboot
- push-artifact
2019-05-03 00:46:01 +03:00
- --exclude-filter
- "*http-service*"
2019-04-18 20:49:12 +03:00
metadata:
name: bugbug docker push
description: bugbug docker push
owner: mcastelluccio@mozilla.com
2019-04-18 20:49:12 +03:00
source: ${repository}/raw/${head_rev}/.taskcluster.yml
# It's the same task integration_test as in data-pipeline.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: { $eval: as_slugid("integration_test") }
dependencies:
- { $eval: as_slugid("docker_push") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-bugbug
workerType: compute-small
scopes:
- secrets:get:project/bugbug/integration
- "docker-worker:cache:bugbug-mercurial-repository"
- "generic-worker:cache:bugbug-mercurial-repository"
payload:
features:
taskclusterProxy: true
maxRunTime: 10800
image: mozilla/bugbug-commit-retrieval:${head_branch[10:]}
env:
TC_SECRET_ID: project/bugbug/integration
CACHE_DIR: "/cache"
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y redis-server &&
git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python -c 'import os; print(os.environ.keys())' &&
bash ./scripts/integration_test.sh"
cache:
bugbug-mercurial-repository: /cache
metadata:
name: bugbug integration test
description: bugbug integration test
owner: ${user}@users.noreply.github.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: { $eval: as_slugid("update_hook_data_pipeline") }
dependencies:
- { $eval: as_slugid("integration_test") }
scopes:
- hooks:modify-hook:project-bugbug/bugbug
- assume:hook-id:project-bugbug/bugbug
- queue:route:project.bugbug.deploy_ending.*
created: { $fromNow: "" }
deadline: { $fromNow: "5 hours" }
provisionerId: proj-bugbug
workerType: batch
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py ${head_branch[10:]} infra/taskcluster-hook-data-pipeline.json &&
taskboot --target . build-hook infra/taskcluster-hook-data-pipeline.json project-bugbug bugbug"
routes:
- project.bugbug.deploy_ending
metadata:
name: bugbug update data hook
description: bugbug update data hook
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml