File tree Expand file tree Collapse file tree
code_coverage_taskgraph/transforms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ enable_always_target: true
99existing_tasks : {}
1010files_changed : []
1111filters : [target_tasks_method]
12- head_ref : refs/heads/ master
12+ head_ref : master
1313head_repository : https://github.com/mozilla/code-coverage
1414head_rev : abc123def456abc123def456abc123def456abc1
1515head_tag : " "
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ enable_always_target: true
99existing_tasks : {}
1010files_changed : []
1111filters : [target_tasks_method]
12- head_ref : refs/heads/ production
12+ head_ref : production
1313head_repository : https://github.com/mozilla/code-coverage
1414head_rev : abc123def456abc123def456abc123def456abc1
1515head_tag : " "
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ enable_always_target: true
99existing_tasks : {}
1010files_changed : []
1111filters : [target_tasks_method]
12- head_ref : refs/heads/ testing
12+ head_ref : testing
1313head_repository : https://github.com/mozilla/code-coverage
1414head_rev : abc123def456abc123def456abc123def456abc1
1515head_tag : " "
You can’t perform that action at this time.
0 commit comments