Bug 1827709: Notify Thunderbird CI Matrix channel after mozilla-central push. r=releng-reviewers,gabriel

This notification will help Thunderbird developers who are tasked with pushing
multiple bugs to comm-central after a mozilla-central push.

Taskgraph tests adjusted to verify the notification is only sent for pushes
to mozilla-central, and to run the tests when .taskcluster.yml is updated.

Differential Revision: https://phabricator.services.mozilla.com/D175290
This commit is contained in:
Rob Lemley 2023-04-18 19:36:49 +00:00
parent 08686a9936
commit bd5c5ef653
3 changed files with 44 additions and 11 deletions

View File

@ -131,7 +131,11 @@ tasks:
# Send a notification email if the push comes from try
- $if: 'repository.project == "try"'
then:
"notify.email.${ownerEmail}.on-completed"
- "notify.email.${ownerEmail}.on-completed"
- $if: 'repository.project == "mozilla-central"'
then:
# Notify #thunderbird-ci
- "notify.matrix-room.!TWztIhgqLawNpRBZTC:mozilla.org.on-completed"
else:
$if: 'tasks_for == "action"'
then:
@ -310,13 +314,16 @@ tasks:
- $if: 'tasks_for == "hg-push"'
then:
notify:
email:
$merge:
- link:
text: "Treeherder Jobs"
href: "https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"
# Email for try pushes should thank you for your revision
- $if: 'repository.project == "try"'
then:
subject: "Thank you for your try submission of ${push.revision}. It's the best!"
content: "Your try push has been submitted. It's the best! Use the link to view the status of your jobs."
$merge:
- email:
$merge:
- link:
text: "Treeherder Jobs"
href: "https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"
- $if: 'repository.project == "try"'
then:
subject: "Thank you for your try submission of ${push.revision}. It's the best!"
content: "Your try push has been submitted. It's the best! Use the link to view the status of your jobs."
- $if: 'repository.project == "mozilla-central"'
then:
matrixBody: "${repository.project} push notification: https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"

View File

@ -45,6 +45,7 @@ firefox-ci:
subsuite: ci
when:
files-changed:
- '.taskcluster.yml'
- 'taskcluster/ci/**'
- 'taskcluster/**/*.py'
- 'tools/tryselect/selectors/auto.py'

View File

@ -41,6 +41,31 @@ class TestTaskclusterYml(unittest.TestCase):
self.assertEqual(
rendered["tasks"][0]["metadata"]["name"], "Gecko Decision Task"
)
self.assertIn("matrixBody", rendered["tasks"][0]["extra"]["notify"])
def test_push_non_mc(self):
context = {
"tasks_for": "hg-push",
"push": {
"revision": "e8d2d9aff5026ef1f1777b781b47fdcbdb9d8f20",
"base_revision": "e8aebe488b2f2e567940577de25013d00e818f7c",
"owner": "dustin@mozilla.com",
"pushlog_id": 1556565286,
"pushdate": 112957,
},
"repository": {
"url": "https://hg.mozilla.org/releases/mozilla-beta",
"project": "mozilla-beta",
"level": "3",
},
"ownTaskId": slugid.nice(),
}
rendered = jsone.render(self.taskcluster_yml, context)
pprint.pprint(rendered)
self.assertEqual(
rendered["tasks"][0]["metadata"]["name"], "Gecko Decision Task"
)
self.assertNotIn("matrixBody", rendered["tasks"][0]["extra"]["notify"])
def test_cron(self):
context = {