File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1+ from importlib import import_module
2+
3+
4+ def register (graph_config ):
5+ """Setup for task generation."""
6+ _import_modules (["parameters" ])
7+
8+
9+ def _import_modules (modules ):
10+ for module in modules :
11+ import_module (f".{ module } " , package = __name__ )
Original file line number Diff line number Diff line change 1+ from voluptuous import Optional
2+
3+ from taskgraph .parameters import extend_parameters_schema
4+
5+
6+ extend_parameters_schema (
7+ {
8+ Optional ("channel" ): str ,
9+ },
10+ )
11+
12+
13+ def decision_parameters (graph_config , parameters ):
14+ head_ref = parameters ["head_ref" ]
15+ if head_ref .startswith ("refs/heads/" ):
16+ head_ref = head_ref [len ("refs/heads/" ):]
17+
18+ if head_ref == "production" :
19+ parameters ["channel" ] = "production"
20+ elif head_ref == "testing" :
21+ parameters ["channel" ] = "testing"
22+ else :
23+ parameters ["channel" ] = "dev"
Original file line number Diff line number Diff line change 1+ ---
2+ trust-domain : code-analysis
3+ task-priority : low
4+ taskgraph :
5+ register : code_coverage_taskgraph:register
6+ decision-parameters : code_coverage_taskgraph.parameters:decision_parameters
7+ repositories :
8+ code_coverage :
9+ name : code-coverage
10+ workers :
11+ aliases :
12+ b-linux :
13+ provisioner : ' {trust-domain}-{level}'
14+ implementation : docker-worker
15+ os : linux
16+ worker-type : linux-gw-gcp
17+ images :
18+ provisioner : ' {trust-domain}-{level}'
19+ implementation : docker-worker
20+ os : linux
21+ worker-type : linux-gcp
Original file line number Diff line number Diff line change 1+ FROM python:3.12-slim
2+
3+ # Add worker user
4+ RUN mkdir -p /builds/worker/artifacts && \
5+ groupadd --gid 1000 worker && \
6+ useradd --uid 1000 --gid worker --home-dir /builds/worker --shell /bin/bash worker && \
7+ chown worker:worker /builds/worker/artifacts
8+
9+ # Install build deps (needed for mercurial, grcov setup)
10+ RUN apt-get update && \
11+ apt-get install --no-install-recommends -y \
12+ git \
13+ gcc \
14+ curl \
15+ bzip2 \
16+ python3-dev \
17+ libgoogle-perftools4 && \
18+ rm -rf /var/lib/apt/lists/*
19+
20+ # Install mercurial
21+ RUN pip install --disable-pip-version-check --quiet --no-cache-dir mercurial==7.2
22+
23+ # Install grcov
24+ RUN curl -sL https://github.com/mozilla/grcov/releases/download/v0.10.5/grcov-x86_64-unknown-linux-gnu-tc.tar.bz2 | tar -C /usr/bin -xjv && \
25+ chmod +x /usr/bin/grcov
26+
27+ # Clone version-control-tools
28+ RUN hg clone -r 5b6e8298d035 https://hg.mozilla.org/hgcustom/version-control-tools /src/version-control-tools/ && \
29+ rm -rf /src/version-control-tools/.hg \
30+ /src/version-control-tools/ansible \
31+ /src/version-control-tools/docs \
32+ /src/version-control-tools/testing
33+
34+ # %include-run-task
35+
36+ # Cleanup build-only deps
37+ RUN apt-get purge -y gcc curl bzip2 python3-dev && \
38+ apt-get autoremove -y && \
39+ rm -rf /var/lib/apt/lists/*
40+
41+ ENV SHELL=/bin/bash \
42+ HOME=/builds/worker \
43+ PATH=/builds/worker/.local/bin:$PATH
44+
45+ VOLUME /builds/worker/checkouts
46+ VOLUME /builds/worker/.cache
47+
48+ CMD ["/bin/bash" ]
Original file line number Diff line number Diff line change 1+ loader : taskgraph.loader.transform:loader
2+ transforms :
3+ - taskgraph.transforms.docker_image
4+ - taskgraph.transforms.cached_tasks
5+ - taskgraph.transforms.task
6+ tasks :
7+ python : {}
Original file line number Diff line number Diff line change 1+ base_ref : master
2+ base_repository : https://github.com/mozilla/code-coverage
3+ base_rev : " 0000000000000000000000000000000000000000"
4+ build_date : 1710000000
5+ build_number : 1
6+ channel : dev
7+ do_not_optimize : []
8+ enable_always_target : true
9+ existing_tasks : {}
10+ files_changed : []
11+ filters :
12+ - target_tasks_method
13+ head_ref : some-feature-branch
14+ head_repository : https://github.com/user/code-coverage
15+ head_rev : abc123def456abc123def456abc123def456abc1
16+ head_tag : " "
17+ level : " 1"
18+ moz_build_date : " 20250310120000"
19+ optimize_strategies : null
20+ optimize_target_tasks : true
21+ owner : test@example.com
22+ project : code-coverage
23+ pushdate : 1710000000
24+ pushlog_id : " 0"
25+ repository_type : git
26+ target_tasks_method : default
27+ tasks_for : github-pull-request
28+ version : null
29+ next_version : null
Original file line number Diff line number Diff line change 1+ base_ref : refs/heads/master
2+ base_repository : https://github.com/mozilla/code-coverage
3+ base_rev : " 0000000000000000000000000000000000000000"
4+ build_date : 1710000000
5+ build_number : 1
6+ channel : dev
7+ do_not_optimize : []
8+ enable_always_target : true
9+ existing_tasks : {}
10+ files_changed : []
11+ filters :
12+ - target_tasks_method
13+ head_ref : refs/heads/master
14+ head_repository : https://github.com/mozilla/code-coverage
15+ head_rev : abc123def456abc123def456abc123def456abc1
16+ head_tag : " "
17+ level : " 3"
18+ moz_build_date : " 20250310120000"
19+ optimize_strategies : null
20+ optimize_target_tasks : true
21+ owner : test@example.com
22+ project : code-coverage
23+ pushdate : 1710000000
24+ pushlog_id : " 0"
25+ repository_type : git
26+ target_tasks_method : default
27+ tasks_for : github-push
28+ version : null
29+ next_version : null
Original file line number Diff line number Diff line change 1+ base_ref : " "
2+ base_repository : https://github.com/mozilla/code-coverage
3+ base_rev : " 0000000000000000000000000000000000000000"
4+ build_date : 1710000000
5+ build_number : 1
6+ channel : dev
7+ do_not_optimize : []
8+ enable_always_target : true
9+ existing_tasks : {}
10+ files_changed : []
11+ filters :
12+ - target_tasks_method
13+ head_ref : v1.3.43
14+ head_repository : https://github.com/mozilla/code-coverage
15+ head_rev : abc123def456abc123def456abc123def456abc1
16+ head_tag : " "
17+ level : " 3"
18+ moz_build_date : " 20250310120000"
19+ optimize_strategies : null
20+ optimize_target_tasks : true
21+ owner : test@example.com
22+ project : code-coverage
23+ pushdate : 1710000000
24+ pushlog_id : " 0"
25+ repository_type : git
26+ target_tasks_method : default
27+ tasks_for : github-release
28+ version : null
29+ next_version : null
You can’t perform that action at this time.
0 commit comments