Bug 1425571 - fixups for release notifications, r=aki, a=release DONTBUILD
authorNick Thomas <nthomas@mozilla.com>
Mon, 30 Apr 2018 13:45:53 +1200
changeset 790946 aed520e7ef1df0cb23ecce2243f0f760be013f2d
parent 790945 7055a4f07f2df099a8963556b333904184eb7786
child 790947 de5397e462da7d44220e96a2d0cedd52a76cb781
push id108656
push userbmo:jlorenzo@mozilla.com
push dateThu, 03 May 2018 08:03:49 +0000
reviewersaki, release
bugs1425571
milestone60.0
Bug 1425571 - fixups for release notifications, r=aki, a=release DONTBUILD Sends 'in the candidates directory', 'pushed to cdntest', etc emails only when the underlying dummy tasks succeed, avoiding false messages when graphs are cancelled or the dummy job fails for infrastructure reasons. Also sets the body of the email to be the same string as the subject, as we used to do, to avoid unnecessary information about the dummy task.
taskcluster/taskgraph/transforms/release_notifications.py
--- a/taskcluster/taskgraph/transforms/release_notifications.py
+++ b/taskcluster/taskgraph/transforms/release_notifications.py
@@ -51,17 +51,19 @@ def add_notifications(config, jobs):
             emails = notifications['emails']
             format_kwargs = dict(
                 task=job,
                 config=config.__dict__,
                 release_config=release_config,
             )
             subject = notifications['subject'].format(**format_kwargs)
             message = notifications['message'].format(**format_kwargs)
-            routes = ['notify.email.{email_dest}.on-any']
+            # we only send these on succces to avoid messages like 'blah is in the
+            # candidates dir' when cancelling graphs, dummy job failure, etc
+            routes = ['notify.email.{email_dest}.on-success']
             # Don't need this any more
             del job['notifications']
         else:
             emails = email_dest
             format_kwargs = dict(
                 label=label,
                 shipping_product=shipping_product,
                 config=config.__dict__,
@@ -87,11 +89,11 @@ def add_notifications(config, jobs):
                    'notify': {
                        'email': {
                             'subject': subject,
                         }
                     }
                 }
             )
             if message:
-                job['extra']['notify']['email']['message'] = message
+                job['extra']['notify']['email']['content'] = message
 
         yield job