bug 1398793: set channel list correctly for updates builder. r=jlorenzo
authorBen Hearsum <bhearsum@mozilla.com>
Tue, 09 Jan 2018 10:06:40 -0500
changeset 452678 f2a923fb26cf1c8cce139458d11dff4bf7d8dae1
parent 452677 0cdbe30a073a44ee5325fc62a55770f122a1e37b
child 452679 21c347b469e76a6ab4a1cb328248fc560ceab6c8
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlorenzo
bugs1398793
milestone59.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 1398793: set channel list correctly for updates builder. r=jlorenzo
taskcluster/ci/release-balrog-publishing/kind.yml
taskcluster/ci/release-updates-builder/kind.yml
taskcluster/taskgraph/transforms/job/buildbot.py
--- a/taskcluster/ci/release-balrog-publishing/kind.yml
+++ b/taskcluster/ci/release-balrog-publishing/kind.yml
@@ -69,18 +69,28 @@ job-defaults:
 
 jobs:
    firefox:
       name: release-firefox_schedule_publishing_in_balrog
       shipping-product: firefox
       run:
          product: firefox
          buildername: release-{branch}-firefox_schedule_publishing_in_balrog
+         channels:
+            by-project:
+               birch: release
+               maple: beta
+               mozilla-beta: beta
+               mozilla-release: release
+               mozilla-esr52: esr
+               mozilla-esr59: esr
+               default: unknown
       index:
          product: firefox
    devedition:
       name: release-devedition_schedule_publishing_in_balrog
       shipping-product: devedition
       run:
          product: devedition
          buildername: release-{branch}-devedition_schedule_publishing_in_balrog
+         channels: aurora
       index:
          product: devedition
--- a/taskcluster/ci/release-updates-builder/kind.yml
+++ b/taskcluster/ci/release-updates-builder/kind.yml
@@ -97,16 +97,17 @@ jobs:
                   mozilla-beta: "beta"
                   # beta gets removed for non RCs by the
                   # release_updates transform
                   mozilla-release: "beta,release"
                   mozilla-esr52: "esr"
                   default: "default"
             repo_path:
                by-project:
+                  birch: "projects/birch"
                   jamun: "projects/jamun"
                   maple: "projects/maple"
                   mozilla-beta: "releases/mozilla-beta"
                   mozilla-release: "releases/mozilla-release"
                   mozilla-esr52: "releases/mozilla-esr52"
                   default: "default"
 
    devedition:
--- a/taskcluster/taskgraph/transforms/job/buildbot.py
+++ b/taskcluster/taskgraph/transforms/job/buildbot.py
@@ -6,76 +6,66 @@
 Support for running jobs via buildbot.
 
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 import slugid
 from urlparse import urlparse
 
-from taskgraph.util.schema import Schema
+from taskgraph.util.schema import Schema, optionally_keyed_by, resolve_keyed_by
 from taskgraph.util.scriptworker import get_release_config
 from voluptuous import Optional, Required, Any
 
 from taskgraph.transforms.job import run_job_using
 
 
 buildbot_run_schema = Schema({
     Required('using'): 'buildbot',
 
     # the buildername to use for buildbot-bridge, will expand {branch} in name from
     # the current project.
     Required('buildername'): basestring,
 
     # the product to use
     Required('product'): Any('firefox', 'mobile', 'fennec', 'devedition', 'thunderbird'),
 
+    Optional('channels'): optionally_keyed_by('project', basestring),
+
     Optional('release-promotion'): bool,
 })
 
 
 def _get_balrog_api_root(branch):
     if branch in ('mozilla-beta', 'mozilla-release') or branch.startswith('mozilla-esr'):
         return 'https://aus4-admin.mozilla.org/api'
     else:
         return 'https://balrog-admin.stage.mozaws.net/api'
 
 
-def _get_balrog_channel(product, branch):
-    if product == 'devedition':
-        return 'aurora'
-    elif product == 'firefox':
-        if branch in ('mozilla-beta', 'maple'):
-            return 'beta'
-        elif branch == 'mozilla-release':
-            return 'release'
-        elif branch.startswith('mozilla-esr'):
-            return 'esr'
-    # Unsupported channels are filtered out after the task is generated. Then, we must
-    # provide a dummy value for them, otherwise the Decision task breaks.
-    return 'unknown'
-
-
 def bb_release_worker(config, worker, run):
     # props
     release_props = get_release_config(config)
     repo_path = urlparse(config.params['head_repository']).path.lstrip('/')
     revision = config.params['head_rev']
     branch = config.params['project']
     product = run['product']
 
     release_props.update({
         'release_promotion': True,
         'repo_path': repo_path,
         'revision': revision,
     })
 
+    if 'channels' in run:
+        release_props['channels'] = run['channels']
+        resolve_keyed_by(release_props, 'channels', 'channels', **config.params)
+
     if product in ('devedition', 'firefox'):
         release_props['balrog_api_root'] = _get_balrog_api_root(branch)
-        release_props['channels'] = _get_balrog_channel(product, branch)
 
     worker['properties'].update(release_props)
     # Setting script_repo_revision to the gecko revision doesn't work for
     # jobs that clone build/tools or other repos instead of gecko.
     if 'script_repo_revision' not in worker['properties']:
         worker['properties']['script_repo_revision'] = revision