bug 1456620 - move check_if_partners_enabled call. r=nthomas draft
authorAki Sasaki <asasaki@mozilla.com>
Mon, 23 Apr 2018 13:53:19 -0700
changeset 788106 51406b39c358ff99690e073920a2e3f66cb39c83
parent 788105 df3571f12016a631d8e967eaed37780e6674584a
child 788107 320e9b51061b57d65d08aed1e621983e911c7b6d
push id107906
push userasasaki@mozilla.com
push dateWed, 25 Apr 2018 22:52:11 +0000
reviewersnthomas
bugs1456620
milestone61.0a1
bug 1456620 - move check_if_partners_enabled call. r=nthomas Because the transforms are generators, we actually call them from the bottom up. The previous transforms don't get called until the `for task in tasks:` or `for job in jobs:` in the following transform. Moving the `check_if_partners_enabled` transform to the end means we never try to access `config.params['release_partner_config'].values()` in `add_command_arguments` when `release_partner_config` is None. Otherwise, we hit errors when we run taskgraph-gen.py. MozReview-Commit-ID: Ho2odPL9FxS
taskcluster/taskgraph/transforms/partner_repack.py
--- a/taskcluster/taskgraph/transforms/partner_repack.py
+++ b/taskcluster/taskgraph/transforms/partner_repack.py
@@ -10,18 +10,16 @@ from __future__ import absolute_import, 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.schema import resolve_keyed_by
 from taskgraph.util.scriptworker import get_release_config
 from taskgraph.util.partners import check_if_partners_enabled
 
 
 transforms = TransformSequence()
 
-transforms.add(check_if_partners_enabled)
-
 
 @transforms.add
 def resolve_properties(config, tasks):
     for task in tasks:
         for property in ("REPACK_MANIFESTS_URL", ):
             property = "worker.env.{}".format(property)
             resolve_keyed_by(task, property, property, **config.params)
 
@@ -56,8 +54,13 @@ def add_command_arguments(config, tasks)
         # The upstream taskIds are stored a special environment variable, because we want to use
         # task-reference's to resolve dependencies, but the string handling of MOZHARNESS_OPTIONS
         # blocks that. It's space-separated string of ids in the end.
         task['worker']['env']['UPSTREAM_TASKIDS'] = {
             'task-reference': ' '.join(['<{}>'.format(dep) for dep in task['dependencies']])
         }
 
         yield task
+
+
+# This needs to be run at the *end*, because the generators are called in
+# reverse order, when each downstream transform references `tasks`.
+transforms.add(check_if_partners_enabled)