Skip to content

Commit 1cae7e6

Browse files
committed
refactor!: default to only use the 'checkout' cache
We shouldn't set up a cache for every conceivable tool that's going to be added to the `CACHES` config. Instead tasks should list out the ones they need. The checkout cache is going to be pretty standard and is a reasonable default.
1 parent db2ec2d commit 1cae7e6

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

src/taskgraph/transforms/run/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def support_caches(
175175
use_caches = (
176176
config.graph_config.get("taskgraph", {})
177177
.get("run", {})
178-
.get("use-caches", True)
178+
.get("use-caches", ["checkout"])
179179
)
180180

181181
for name, cache_cfg in CACHES.items():

test/test_transforms_run_run_task.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,12 @@ def assert_docker_worker(task):
5555
"soft-dependencies": [],
5656
"worker": {
5757
"caches": [
58-
{
59-
'mount-point': '/builds/worker/.task-cache/cargo',
60-
'name': 'cargo',
61-
'skip-untrusted': False,
62-
'type': 'persistent',
63-
},
6458
{
6559
"mount-point": "/builds/worker/checkouts",
6660
"name": "checkouts",
6761
"skip-untrusted": False,
6862
"type": "persistent",
6963
},
70-
{
71-
'mount-point': '/builds/worker/.task-cache/npm',
72-
'name': 'npm',
73-
'skip-untrusted': False,
74-
'type': 'persistent',
75-
},
76-
{
77-
'mount-point': '/builds/worker/.task-cache/pip',
78-
'name': 'pip',
79-
'skip-untrusted': False,
80-
'type': 'persistent',
81-
},
82-
{
83-
'mount-point': '/builds/worker/.task-cache/uv',
84-
'name': 'uv',
85-
'skip-untrusted': False,
86-
'type': 'persistent',
87-
},
8864
],
8965
"command": [
9066
"/usr/local/bin/run-task",
@@ -95,19 +71,15 @@ def assert_docker_worker(task):
9571
"echo hello world",
9672
],
9773
"env": {
98-
"CARGO_HOME": "/builds/worker/.task-cache/cargo",
9974
"CI_BASE_REPOSITORY": "http://hg.example.com",
10075
"CI_HEAD_REF": "default",
10176
"CI_HEAD_REPOSITORY": "http://hg.example.com",
10277
"CI_HEAD_REV": "abcdef",
10378
"CI_REPOSITORY_TYPE": "hg",
10479
"HG_STORE_PATH": "/builds/worker/checkouts/hg-store",
10580
"MOZ_SCM_LEVEL": "1",
106-
"PIP_CACHE_DIR": "/builds/worker/.task-cache/pip",
10781
"REPOSITORIES": '{"ci": "Taskgraph"}',
108-
"UV_CACHE_DIR": "/builds/worker/.task-cache/uv",
10982
"VCS_PATH": "/builds/worker/checkouts/vcs",
110-
"npm_config_cache": "/builds/worker/.task-cache/npm",
11183
},
11284
"implementation": "docker-worker",
11385
"os": "linux",
@@ -134,39 +106,19 @@ def assert_generic_worker(task):
134106
'world"'
135107
],
136108
"env": {
137-
"CARGO_HOME": "{task_workdir}/.task-cache/cargo",
138109
"CI_BASE_REPOSITORY": "http://hg.example.com",
139110
"CI_HEAD_REF": "default",
140111
"CI_HEAD_REPOSITORY": "http://hg.example.com",
141112
"CI_HEAD_REV": "abcdef",
142113
"CI_REPOSITORY_TYPE": "hg",
143114
"HG_STORE_PATH": "y:/hg-shared",
144115
"MOZ_SCM_LEVEL": "1",
145-
"PIP_CACHE_DIR": "{task_workdir}/.task-cache/pip",
146116
"REPOSITORIES": '{"ci": "Taskgraph"}',
147-
"UV_CACHE_DIR": "{task_workdir}/.task-cache/uv",
148117
"VCS_PATH": "{task_workdir}/build/src",
149-
"npm_config_cache": "{task_workdir}/.task-cache/npm",
150118
},
151119
"implementation": "generic-worker",
152120
"mounts": [
153-
{
154-
"cache-name": "cargo",
155-
"directory": ".task-cache/cargo",
156-
},
157121
{"cache-name": "checkouts", "directory": "build"},
158-
{
159-
"cache-name": "npm",
160-
"directory": ".task-cache/npm",
161-
},
162-
{
163-
"cache-name": "pip",
164-
"directory": ".task-cache/pip",
165-
},
166-
{
167-
"cache-name": "uv",
168-
"directory": ".task-cache/uv",
169-
},
170122
{
171123
"content": {
172124
"url": "https://tc-tests.localhost/api/queue/v1/task/<TASK_ID>/artifacts/public/run-task"

0 commit comments

Comments
 (0)