diff options
author | Josh Matthews <josh@joshmatthews.net> | 2021-01-24 15:41:41 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2021-01-24 18:37:29 -0500 |
commit | 5d923c0a95c38373594e8a014148331237fb361e (patch) | |
tree | 6dc8f67b0fed80da15b3b479818aee5d7608d8f3 /etc/taskcluster/decisionlib.py | |
parent | 500cb865bd174f40e8e7d96fd17ddcdef4692ae4 (diff) | |
download | servo-5d923c0a95c38373594e8a014148331237fb361e.tar.gz servo-5d923c0a95c38373594e8a014148331237fb361e.zip |
Disallow duplicate taskcluster artifacts.
Diffstat (limited to 'etc/taskcluster/decisionlib.py')
-rw-r--r-- | etc/taskcluster/decisionlib.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index 32e8d63b464..13fc2b75bfc 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -387,7 +387,10 @@ class GenericWorkerTask(Task): Paths are relative to the task’s home directory. """ - self.artifacts.extend((type, path) for path in paths) + for path in paths: + if (type, path) in self.artifacts: + raise ValueError("Duplicate artifact: " + path) # pragma: no cover + self.artifacts.append(tuple((type, path))) return self def with_features(self, *names): @@ -736,13 +739,19 @@ class DockerWorkerTask(UnixTaskMixin, Task): with_docker_image = chaining(setattr, "docker_image") with_max_run_time_minutes = chaining(setattr, "max_run_time_minutes") - with_artifacts = chaining(append_to_attr, "artifacts") with_script = chaining(append_to_attr, "scripts") with_early_script = chaining(prepend_to_attr, "scripts") with_caches = chaining(update_attr, "caches") with_env = chaining(update_attr, "env") with_capabilities = chaining(update_attr, "capabilities") + def with_artifacts(self, *paths): + for path in paths: + if path in self.artifacts: + raise ValueError("Duplicate artifact: " + path) # pragma: no cover + self.artifacts.append(path) + return self + def build_worker_payload(self): """ Return a `docker-worker` worker payload. |