Skip to content

Commit 5d4f050

Browse files
committed
Back out "feat(caches): support opting into or out of specific name caches"
This backs out commit a70a57c.
1 parent 588dc4f commit 5d4f050

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

src/taskgraph/transforms/run/common.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import hashlib
1111
import json
12-
import re
1312

1413
from taskgraph.util.taskcluster import get_artifact_prefix
1514

@@ -32,11 +31,7 @@ def add_cache(task, taskdesc, name, mount_point, skip_untrusted=False):
3231
skip_untrusted (bool): Whether cache is used in untrusted environments
3332
(default: False). Only applies to docker-worker.
3433
"""
35-
use_caches = task["run"].get("use-caches", True)
36-
if isinstance(use_caches, list):
37-
use_caches = any(re.match(pattern, name) for pattern in use_caches)
38-
39-
if not use_caches:
34+
if not task["run"].get("use-caches", True):
4035
return
4136

4237
worker = task["worker"]

src/taskgraph/transforms/run/run_task.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
# tend to hide their caches. This cache is never added for level-1 tasks.
2929
# TODO Once bug 1526028 is fixed, this and 'use-caches' should be merged.
3030
Required("cache-dotcache"): bool,
31-
# Whether or not to use caches. If a boolean, all caches will be
32-
# enabled or disabled. If a list, entries are regexes. Only cache names
33-
# that match one of the listed regexes are enabled.
34-
Optional("use-caches"): Any(bool, [str]),
31+
# Whether or not to use caches.
32+
Optional("use-caches"): bool,
3533
# if true (the default), perform a checkout on the worker
3634
Required("checkout"): Any(bool, {str: dict}),
3735
Optional(

test/test_transforms_run.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,6 @@ def test_caches_generic_worker(run_caches):
109109
]
110110

111111

112-
def test_caches_regex(run_caches):
113-
task = {
114-
"run": {
115-
"use-caches": ["cache[^1]"],
116-
},
117-
"worker-type": "t-win",
118-
}
119-
caches = run_caches(task)
120-
assert len(caches) == 1
121-
assert caches[0]["cache-name"] == "cache2"
122-
123-
124112
@pytest.mark.parametrize("worker_type", ("t-linux", "t-win"))
125113
def test_caches_disabled(run_caches, worker_type):
126114
assert (

0 commit comments

Comments
 (0)