Skip to content

Commit db2ec2d

Browse files
committed
refactor!: remove 'cache-dotcache' key
1 parent 6473b75 commit db2ec2d

File tree

7 files changed

+23
-27
lines changed

7 files changed

+23
-27
lines changed

docs/reference/migrations.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ Migration Guide
33

44
This page can help when migrating Taskgraph across major versions.
55

6+
12.x -> 13.x
7+
------------
8+
9+
* Remove all ``run.cache-dotcache`` keys. If it was set to ``true``, replace it
10+
with:
11+
12+
.. code-block:: yaml
13+
14+
run:
15+
use-caches: [checkout, <caches>]
16+
17+
Where caches can be any of ``cargo``, ``pip``, ``uv`` or ``npm``. If the task
18+
was setting up ``.cache`` for another tool, a mount will need to be created
19+
for it manually. If ``use-caches`` was previously set to ``false``, omit
20+
``checkout`` in the example above. If ``use-caches`` was previously set to
21+
``true``, replace ``true`` with the value above (including ``checkout``).
22+
623
11.x -> 12.x
724
------------
825

@@ -110,7 +127,7 @@ This page can help when migrating Taskgraph across major versions.
110127
5.x -> 6.x
111128
----------
112129

113-
* Replace all uses of ``command-context` with the more generalized ``task-context``
130+
* Replace all uses of ``command-context`` with the more generalized ``task-context``
114131

115132
4.x -> 5.x
116133
----------

src/taskgraph/transforms/run/run_task.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
run_task_schema = Schema(
2929
{
3030
Required("using"): "run-task",
31-
# if true, add a cache at ~worker/.cache, which is where things like pip
32-
# tend to hide their caches. This cache is never added for level-1 tasks.
33-
# TODO Once bug 1526028 is fixed, this and 'use-caches' should be merged.
34-
Required("cache-dotcache"): bool,
3531
# Which caches to use. May take a boolean in which case either all
3632
# (True) or no (False) caches will be used. Alternatively, it can
3733
# accept a list of caches to enable. Defaults to only the checkout cache
@@ -115,7 +111,6 @@ def common_setup(config, task, taskdesc, command):
115111

116112

117113
worker_defaults = {
118-
"cache-dotcache": False,
119114
"checkout": True,
120115
"sparse-profile": None,
121116
"run-as-root": False,
@@ -142,16 +137,6 @@ def docker_worker_run_task(config, task, taskdesc):
142137
command = run.pop("run-task-command", ["/usr/local/bin/run-task"])
143138
common_setup(config, task, taskdesc, command)
144139

145-
if run.get("cache-dotcache"):
146-
worker["caches"].append(
147-
{
148-
"type": "persistent",
149-
"name": "{project}-dotcache".format(**config.params),
150-
"mount-point": "{workdir}/.cache".format(**run),
151-
"skip-untrusted": True,
152-
}
153-
)
154-
155140
run_command = run["command"]
156141

157142
# dict is for the case of `{'task-reference': str}`.
@@ -184,13 +169,6 @@ def generic_worker_run_task(config, task, taskdesc):
184169
common_setup(config, task, taskdesc, command)
185170

186171
worker.setdefault("mounts", [])
187-
if run.get("cache-dotcache"):
188-
worker["mounts"].append(
189-
{
190-
"cache-name": "{project}-dotcache".format(**config.params),
191-
"directory": "{workdir}/.cache".format(**run),
192-
}
193-
)
194172
worker["mounts"].append(
195173
{
196174
"content": {

taskcluster/docker/python/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM debian:bookworm-slim
66
LABEL maintainer="Release Engineering <release@mozilla.com>"
77

88
VOLUME /builds/worker/checkouts
9-
VOLUME /builds/worker/.cache
9+
VOLUME /builds/worker/.task-cache/uv
1010

1111
# Add worker user
1212
RUN mkdir -p /builds && \

taskcluster/kinds/check/kind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ task-defaults:
2929
run:
3030
using: run-task
3131
cwd: '{checkout}'
32-
cache-dotcache: true
32+
use-caches: [checkout, uv]
3333

3434
tasks:
3535
type:

taskcluster/kinds/codecov/kind.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ tasks:
4444
run:
4545
using: run-task
4646
cwd: '{checkout}'
47+
use-caches: [checkout, uv]
4748
command: >-
4849
uv run coverage combine --data-file $MOZ_FETCHES_DIR/coverage $MOZ_FETCHES_DIR &&
4950
uv run coverage xml --data-file $MOZ_FETCHES_DIR/coverage -o $MOZ_FETCHES_DIR/coverage.xml &&

taskcluster/kinds/doc/kind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ task-defaults:
2121
run:
2222
using: run-task
2323
cwd: '{checkout}'
24-
cache-dotcache: true
24+
use-caches: [checkout, uv]
2525

2626
tasks:
2727
generate:

taskcluster/kinds/test/kind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ task-defaults:
3434
run:
3535
using: run-task
3636
cwd: '{checkout}'
37-
cache-dotcache: true
37+
use-caches: [checkout, uv]
3838

3939
tasks:
4040
unit:

0 commit comments

Comments
 (0)