Skip to content

Commit 3f34ff7

Browse files
committed
Add build kind
1 parent 8a1c1bf commit 3f34ff7

6 files changed

Lines changed: 76 additions & 3 deletions

File tree

taskcluster/code_coverage_taskgraph/transforms/__init__.py

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from taskgraph.transforms.base import TransformSequence
2+
3+
transforms = TransformSequence()
4+
5+
6+
@transforms.add
7+
def add_index_routes(config, tasks):
8+
for task in tasks:
9+
params = config.params
10+
head_rev = params["head_rev"]
11+
head_ref = params["head_ref"]
12+
13+
if params["tasks_for"] == "github-pull-request":
14+
index_prefix = "code-coverage-pr"
15+
else:
16+
index_prefix = "code-coverage"
17+
18+
trust_domain = config.graph_config["trust-domain"]
19+
task.setdefault("routes", []).extend(
20+
[
21+
f"index.{trust_domain}.v2.{index_prefix}.revision.{head_rev}",
22+
f"index.{trust_domain}.v2.{index_prefix}.branch.{head_ref}",
23+
]
24+
)
25+
26+
yield task

taskcluster/kinds/build/kind.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
loader: taskgraph.loader.transform:loader
2+
3+
transforms:
4+
- code_coverage_taskgraph.transforms.build
5+
- taskgraph.transforms.task_context
6+
- taskgraph.transforms.run
7+
- taskgraph.transforms.task
8+
9+
kind-dependencies:
10+
- lint
11+
- test
12+
13+
task-defaults:
14+
description: Build bot Docker image
15+
run-on-tasks-for:
16+
- github-pull-request
17+
- github-push
18+
worker-type: b-linux
19+
worker:
20+
docker-image: { in-tree: taskboot }
21+
max-run-time: 3600
22+
artifacts:
23+
- type: file
24+
name: public/code-coverage-bot.tar.zst
25+
path: /builds/worker/artifacts/bot.tar.zst
26+
run:
27+
using: run-task
28+
cwd: "{checkout}"
29+
run-as-root: true
30+
dependencies:
31+
lint: lint-pre-commit
32+
test: test-bot
33+
task-context:
34+
from-parameters:
35+
channel: channel
36+
head_rev: head_rev
37+
substitution-fields:
38+
- run.command
39+
40+
tasks:
41+
bot:
42+
run:
43+
command: >-
44+
taskboot --target /builds/worker/checkouts/vcs
45+
build --image mozilla/code-coverage
46+
--tag {channel} --tag {head_rev}
47+
--write /builds/worker/artifacts/bot.tar bot/Dockerfile

taskcluster/test/params/github-push-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enable_always_target: true
99
existing_tasks: {}
1010
files_changed: []
1111
filters: [target_tasks_method]
12-
head_ref: refs/heads/master
12+
head_ref: master
1313
head_repository: https://github.com/mozilla/code-coverage
1414
head_rev: abc123def456abc123def456abc123def456abc1
1515
head_tag: ""

taskcluster/test/params/github-push-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enable_always_target: true
99
existing_tasks: {}
1010
files_changed: []
1111
filters: [target_tasks_method]
12-
head_ref: refs/heads/production
12+
head_ref: production
1313
head_repository: https://github.com/mozilla/code-coverage
1414
head_rev: abc123def456abc123def456abc123def456abc1
1515
head_tag: ""

taskcluster/test/params/github-push-testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enable_always_target: true
99
existing_tasks: {}
1010
files_changed: []
1111
filters: [target_tasks_method]
12-
head_ref: refs/heads/testing
12+
head_ref: testing
1313
head_repository: https://github.com/mozilla/code-coverage
1414
head_rev: abc123def456abc123def456abc123def456abc1
1515
head_tag: ""

0 commit comments

Comments
 (0)