Bug 1386539 - Throw an error when trying to use a toolchain job name as a toolchain alias. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 02 Aug 2017 17:20:00 +0900
changeset 619689 5ca84351087356510da9d227d6bb20cfe6a7a54b
parent 619688 f2486093e2a3517ea12084eeddc24475fdd04260
child 619726 7d7ae8db030184619de0c7b7194ef8dc9936711f
push id71777
push userbmo:mh+mozilla@glandium.org
push dateWed, 02 Aug 2017 12:34:07 +0000
reviewersdustin
bugs1386539
milestone56.0a1
Bug 1386539 - Throw an error when trying to use a toolchain job name as a toolchain alias. r?dustin
taskcluster/taskgraph/transforms/toolchain.py
--- a/taskcluster/taskgraph/transforms/toolchain.py
+++ b/taskcluster/taskgraph/transforms/toolchain.py
@@ -43,16 +43,20 @@ def use_toolchains(config, jobs):
             get_attribute(aliases_by_job, name, task.attributes, 'toolchain-alias')
 
     aliases = {}
     for job, alias in aliases_by_job.items():
         if alias in aliases:
             raise Exception(
                 "Cannot use the alias %s for %s, it's already used for %s"
                 % (alias, job, aliases[alias]))
+        if alias in artifacts:
+            raise Exception(
+                "Cannot use the alias %s for %s, it's already a toolchain job"
+                % (alias, job))
         aliases[alias] = job
 
     for job in jobs:
         env = job.setdefault('worker', {}).setdefault('env', {})
 
         toolchains = [aliases.get(t, t)
                       for t in job.pop('toolchains', [])]