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
--- 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)