Bug 1458700: [release] Allow passing extra-config to bouncer-check from taskcluster; r=jlorenzo
authorTom Prince <mozilla@hocat.ca>
Fri, 01 Jun 2018 09:10:54 +0000
changeset 421002 171f9e5d15784910428d5680dc8c17f55d8f970a
parent 420859 69d43b0517a9a651dabe48fb6e9fb1ee4bdc7516
child 421003 ebe99842f5f8d543e5453ce78b1eae3641830b13
push id34088
push userdluca@mozilla.com
push dateMon, 04 Jun 2018 17:56:32 +0000
treeherdermozilla-central@5b15326286d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlorenzo
bugs1458700
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1458700: [release] Allow passing extra-config to bouncer-check from taskcluster; r=jlorenzo This allows passing configuration like `bouncer_prefix` per-branch, without needing multiple mozharness configs. Differential Revision: https://phabricator.services.mozilla.com/D1483
taskcluster/taskgraph/transforms/bouncer_check.py
--- a/taskcluster/taskgraph/transforms/bouncer_check.py
+++ b/taskcluster/taskgraph/transforms/bouncer_check.py
@@ -1,14 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 import copy
+import json
 import subprocess
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.scriptworker import get_release_config
 from taskgraph.util.schema import (
     resolve_keyed_by,
 )
 
@@ -51,27 +52,34 @@ def add_previous_versions(config, jobs):
             yield job
 
 
 @transforms.add
 def handle_keyed_by(config, jobs):
     """Resolve fields that can be keyed by project, etc."""
     fields = [
         "run.config",
+        "run.extra-config",
     ]
     for job in jobs:
         job = copy.deepcopy(job)  # don't overwrite dict values here
         for field in fields:
             resolve_keyed_by(item=job, field=field, item_name=job['name'],
                              project=config.params['project'])
 
         for cfg in job["run"]["config"]:
             job["run"]["command"].extend(["--config", cfg])
 
         del job["run"]["config"]
+
+        if 'extra-config' in job['run']:
+            env = job['worker'].setdefault('env', {})
+            env['EXTRA_MOZHARNESS_CONFIG'] = json.dumps(job['run']['extra-config'])
+            del job["run"]["extra-config"]
+
         yield job
 
 
 @transforms.add
 def command_to_string(config, jobs):
     """Convert command to string to make it work properly with run-task"""
     for job in jobs:
         job = copy.deepcopy(job)  # don't overwrite dict values here