Bug 1666379 - Allow job notifications to be delivered for all outcome types r=aki DONTBUILD
authorTom Ritter <tom@mozilla.com>
Tue, 22 Sep 2020 03:43:22 +0000
changeset 549555 7a80ee82cde5717df25ab17ce9665c61cf939e67
parent 549554 a4c430e03eca7137007717722b2d6ad52aa1005a
child 549556 21f2328e14fc4f85b8f73f7548ac84a998ac5828
push id37802
push userrmaries@mozilla.com
push dateTue, 22 Sep 2020 09:45:38 +0000
treeherdermozilla-central@726dc76332b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
bugs1666379
milestone83.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 1666379 - Allow job notifications to be delivered for all outcome types r=aki DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D90943
taskcluster/ci/source-test/codeql.yml
taskcluster/taskgraph/transforms/release_notifications.py
--- a/taskcluster/ci/source-test/codeql.yml
+++ b/taskcluster/ci/source-test/codeql.yml
@@ -29,13 +29,17 @@ javascript:
     fetches:
         fetch:
             - codeql-2.0.3
         toolchain:
             - linux64-node
     notifications:
         subject: '{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]} linux64 codeql-javascript status'
         message: '{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]} linux64 codeql-javascript status'
+        status-types:
+            - on-completed
+            - on-failed
+            - on-exception
         emails:
             by-project:
                 mozilla-release: ["tom@mozilla.com", "freddy@mozilla.com"]
                 try: ["{config[params][owner]}"]
                 default: []
--- a/taskcluster/taskgraph/transforms/release_notifications.py
+++ b/taskcluster/taskgraph/transforms/release_notifications.py
@@ -43,21 +43,23 @@ def add_notifications(config, jobs):
                 task=job,
                 config=config.__dict__,
                 release_config=release_config,
             )
             subject = titleformatter.format(notifications['subject'], **format_kwargs)
             message = titleformatter.format(notifications['message'], **format_kwargs)
             emails = [email.format(**format_kwargs) for email in emails]
 
-            # We only send mail on success to avoid messages like 'blah is in the
+            # By default, we only send mail on success to avoid messages like 'blah is in the
             # candidates dir' when cancelling graphs, dummy job failure, etc
-            job.setdefault('routes', []).extend(
-                ['notify.email.{}.on-completed'.format(email) for email in emails]
-            )
+            status_types = notifications.get('status-types', ['on-completed'])
+            for s in status_types:
+                job.setdefault('routes', []).extend(
+                    ['notify.email.{}.{}}'.format(email, s) for email in emails]
+                )
 
             # Customize the email subject to include release name and build number
             job.setdefault('extra', {}).update(
                 {
                    'notify': {
                        'email': {
                             'subject': subject,
                         }