Bug 1639065 - show comm repo revision in Thunderbird release-notify-started emails. r=darktrojan a=wsmwk
☠☠ backed out by a0cb982a0bd2 ☠ ☠
authorRob Lemley <rob@thunderbird.net>
Wed, 17 Jun 2020 19:26:59 +0000
changeset 38524 1346aaf4d966114172667f66d60042b371aeab3d
parent 38523 6e5152df0c915a190e5c908ace2fa191dc105050
child 38525 0a887f3b2a7a27d5e5ca9b96c425292e646159ba
push id2625
push userthunderbird@calypsoblue.org
push dateFri, 19 Jun 2020 19:52:35 +0000
treeherdercomm-beta@1346aaf4d966 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan, wsmwk
bugs1639065
Bug 1639065 - show comm repo revision in Thunderbird release-notify-started emails. r=darktrojan a=wsmwk This is a copy of the transform from mozilla-central. The only change is to pass comm_head_rev and comm_head_repository instead of the mozilla repo information. Differential Revision: https://phabricator.services.mozilla.com/D79408
taskcluster/ci/release-notify-started/kind.yml
taskcluster/comm_taskgraph/transforms/release_started.py
--- a/taskcluster/ci/release-notify-started/kind.yml
+++ b/taskcluster/ci/release-notify-started/kind.yml
@@ -1,17 +1,17 @@
 # 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/.
 ---
 loader: taskgraph.loader.transform:loader
 
 transforms:
     - taskgraph.transforms.release_deps:transforms
-    - taskgraph.transforms.release_started:transforms
+    - comm_taskgraph.transforms.release_started:transforms
     - taskgraph.transforms.job:transforms
     - taskgraph.transforms.task:transforms
 
 job-defaults:
     name: notify-release-drivers-started
     description: Sends email to release-drivers telling release was started.
     run-on-projects: []
     shipping-phase: promote
new file mode 100644
--- /dev/null
+++ b/taskcluster/comm_taskgraph/transforms/release_started.py
@@ -0,0 +1,50 @@
+# 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/.
+"""
+Add notifications via taskcluster-notify for release tasks
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+from pipes import quote as shell_quote
+
+from taskgraph.transforms.base import TransformSequence
+from taskgraph.util.schema import resolve_keyed_by
+
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def add_notifications(config, jobs):
+    for job in jobs:
+        label = '{}-{}'.format(config.kind, job['name'])
+
+        resolve_keyed_by(job, 'emails', label, project=config.params['project'])
+        emails = [email.format(config=config.__dict__) for email in job.pop('emails')]
+
+        command = [
+            'release',
+            'send-buglist-email',
+            '--version', config.params['version'],
+            '--product', job['shipping-product'],
+            '--revision', config.params['comm_head_rev'],
+            '--build-number', str(config.params['build_number']),
+            '--repo', config.params['comm_head_repository'],
+        ]
+        for address in emails:
+            command += ['--address', address]
+        command += [
+            # We wrap this in `{'task-reference': ...}` below
+            '--task-group-id', '<decision>',
+        ]
+
+        job['scopes'] = ['notify:email:{}'.format(address) for address in emails]
+        job['run'] = {
+            'using': 'mach',
+            'sparse-profile': 'mach',
+            'mach': {'task-reference': ' '.join(map(shell_quote, command))},
+        }
+
+        yield job