Bug 1425571 - fixups for release notifications, r=aki

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.
This commit is contained in:
Nick Thomas 2018-04-30 13:45:53 +12:00
parent 0850bc3ec5
commit 6170e0ae61

View File

@ -56,7 +56,9 @@ def add_notifications(config, jobs):
)
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:
@ -92,6 +94,6 @@ def add_notifications(config, jobs):
}
)
if message:
job['extra']['notify']['email']['message'] = message
job['extra']['notify']['email']['content'] = message
yield job