Bug 1405408 - Part 0: Let toolchain tasks create non-public/build artifacts. r=dustin
There's code that carefully uses `setdefault('artifacts', [])` in the
same file, but then stomps on 'artifacts' before that's invoked. This
allows tasks to change where public/build is sourced from, and to add
additional artifact locations (including private locations).
MozReview-Commit-ID: JqyHew5bGv5
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -107,20 +107,24 @@ def add_optimization(config, run, taskde
@run_job_using("docker-worker", "toolchain-script", schema=toolchain_run_schema)
def docker_worker_toolchain(config, job, taskdesc):
run = job['run']
taskdesc['run-on-projects'] = ['trunk', 'try']
worker = taskdesc['worker']
- worker['artifacts'] = []
worker['chain-of-trust'] = True
- docker_worker_add_public_artifacts(config, job, taskdesc)
+ # Allow the job to specify where artifacts come from, but add
+ # public/build if it's not there already.
+ artifacts = worker.setdefault('artifacts', [])
+ if not any(artifact.get('name') == 'public/build' for artifact in artifacts):
+ docker_worker_add_public_artifacts(config, job, taskdesc)
+
docker_worker_add_tc_vcs_cache(config, job, taskdesc)
docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc)
support_vcs_checkout(config, job, taskdesc, sparse=True)
env = worker['env']
env.update({
'MOZ_BUILD_DATE': config.params['moz_build_date'],
'MOZ_SCM_LEVEL': config.params['level'],