Bug 1551738: Set snapcraft track for esr68; r=jlorenzo
authorTom Prince <mozilla@hocat.ca>
Sun, 30 Jun 2019 21:10:14 +0000
changeset 540393 7d964bfcda0e0aded01a4fb05a8405b9cb61bafd
parent 540392 199bcb54e5122b5e7ac2476c90288b2169db2013
child 540394 696aa5fa31ea5c39cee412a6cecfd4af19f845fd
push id11529
push userarchaeopteryx@coole-files.de
push dateThu, 04 Jul 2019 15:22:33 +0000
treeherdermozilla-beta@ebb510a784b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlorenzo
bugs1551738
milestone69.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 1551738: Set snapcraft track for esr68; r=jlorenzo Differential Revision: https://phabricator.services.mozilla.com/D36226
taskcluster/ci/release-secondary-snap-push/kind.yml
taskcluster/ci/release-snap-push/kind.yml
taskcluster/taskgraph/transforms/release_snap_push.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/ci/release-secondary-snap-push/kind.yml
+++ b/taskcluster/ci/release-secondary-snap-push/kind.yml
@@ -11,28 +11,28 @@ transforms:
 
 kind-dependencies:
     - release-snap-repackage
 
 job-defaults:
     description: Pushes (Ubuntu) Snaps onto Snap Store
     run-on-projects: []  # to make sure this never runs as part of CI
     shipping-phase: ship  # ship-rc phase
-    scopes:
-        by-project:
-            mozilla-release: ["project:releng:snapcraft:firefox:beta"]  # ship-rc pushes to beta
-            default: ["project:releng:snapcraft:firefox:mock"]
     treeherder:
         platform: linux64/opt
         kind: build
         tier: 2
     worker-type:
         by-release-level:
             production: scriptworker-prov-v1/pushsnap-v1
             staging: scriptworker-prov-v1/dep-pushsnap
     worker:
         implementation: push-snap
+        channel:
+            by-release-type:
+                release: "beta"
+                default: "mock"
 
 jobs:
     firefox-rc:
         shipping-product: firefox
         treeherder:
             symbol: Snap(push-beta)
--- a/taskcluster/ci/release-snap-push/kind.yml
+++ b/taskcluster/ci/release-snap-push/kind.yml
@@ -11,30 +11,31 @@ transforms:
 
 kind-dependencies:
     - release-snap-repackage
 
 job-defaults:
     description: Pushes (Ubuntu) Snaps onto Snap Store
     run-on-projects: []  # to make sure this never runs as part of CI
     shipping-phase: push
-    scopes:
-        by-project:
-            mozilla-beta: ["project:releng:snapcraft:firefox:beta"]
-            mozilla-release: ["project:releng:snapcraft:firefox:candidate"]
-            mozilla-esr60: ["project:releng:snapcraft:firefox:esr"]
-            default: ["project:releng:snapcraft:firefox:mock"]
     treeherder:
         platform: linux64/opt
         kind: build
         tier: 2
     worker-type:
         by-release-level:
             production: scriptworker-prov-v1/pushsnap-v1
             staging: scriptworker-prov-v1/dep-pushsnap
     worker:
         implementation: push-snap
+        channel:
+            by-release-type:
+                beta: beta
+                release: candidate
+                esr60: esr/stable
+                esr68: esr/candidate
+                default: mock
 
 jobs:
     firefox:
         shipping-product: firefox
         treeherder:
             symbol: Snap(push)
--- a/taskcluster/taskgraph/transforms/release_snap_push.py
+++ b/taskcluster/taskgraph/transforms/release_snap_push.py
@@ -5,29 +5,30 @@
 Transform the release-snap-push kind into an actual task description.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.transforms.task import task_description_schema
 from taskgraph.util.schema import optionally_keyed_by, resolve_keyed_by, Schema
+from taskgraph.util.scriptworker import add_scope_prefix
 
 from voluptuous import Optional, Required
 
 push_snap_description_schema = Schema({
     Required('name'): basestring,
     Required('job-from'): task_description_schema['job-from'],
     Required('dependencies'): task_description_schema['dependencies'],
     Required('description'): task_description_schema['description'],
     Required('treeherder'): task_description_schema['treeherder'],
     Required('run-on-projects'): task_description_schema['run-on-projects'],
     Required('worker-type'): optionally_keyed_by('release-level', basestring),
     Required('worker'): object,
-    Required('scopes'): optionally_keyed_by('project', [basestring]),
+    Optional('scopes'): [basestring],
     Required('shipping-phase'): task_description_schema['shipping-phase'],
     Required('shipping-product'): task_description_schema['shipping-product'],
     Optional('extra'): task_description_schema['extra'],
     Optional('attributes'): task_description_schema['attributes'],
 })
 
 transforms = TransformSequence()
 transforms.add_validate(push_snap_description_schema)
@@ -36,21 +37,31 @@ transforms.add_validate(push_snap_descri
 @transforms.add
 def make_task_description(config, jobs):
     for job in jobs:
         if len(job['dependencies']) != 1:
             raise Exception('Exactly 1 dependency is required')
 
         job['worker']['upstream-artifacts'] = generate_upstream_artifacts(job['dependencies'])
 
-        resolve_keyed_by(job, 'scopes', item_name=job['name'], project=config.params['project'])
+        resolve_keyed_by(
+            job, 'worker.channel', item_name=job['name'],
+            **{'release-type': config.params['release_type']}
+        )
         resolve_keyed_by(
             job, 'worker-type', item_name=job['name'],
             **{'release-level': config.params.release_level()}
         )
+        if config.params.release_level() == 'production':
+            job.setdefault('scopes', []).append(
+                add_scope_prefix(
+                    config,
+                    "snapcraft:firefox:{}".format(job['worker']['channel'].split('/')[0]),
+                )
+            )
 
         yield job
 
 
 def generate_upstream_artifacts(dependencies):
     return [{
         'taskId': {'task-reference': '<{}>'.format(task_kind)},
         # TODO bug 1417960
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -1154,26 +1154,28 @@ def build_push_apk_payload(config, task,
         'google_play_track': worker['google-play-track'],
     }
 
     if worker.get('rollout-percentage', None):
         task_def['payload']['rollout_percentage'] = worker['rollout-percentage']
 
 
 @payload_builder('push-snap', schema={
+    Required('channel'): basestring,
     Required('upstream-artifacts'): [{
         Required('taskId'): taskref_or_string,
         Required('taskType'): basestring,
         Required('paths'): [basestring],
     }],
 })
 def build_push_snap_payload(config, task, task_def):
     worker = task['worker']
 
     task_def['payload'] = {
+        'channel': worker['channel'],
         'upstreamArtifacts':  worker['upstream-artifacts'],
     }
 
 
 @payload_builder('shipit-shipped', schema={
     Required('release-name'): basestring,
 })
 def build_ship_it_shipped_payload(config, task, task_def):