Skip to content

Commit

Permalink
Bug 1827709: Notify Thunderbird CI Matrix channel after mozilla-centr…
Browse files Browse the repository at this point in the history
…al 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
  • Loading branch information
jfx2006 committed Apr 18, 2023
1 parent 08686a9 commit bd5c5ef
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}"
1 change: 1 addition & 0 deletions taskcluster/ci/source-test/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ firefox-ci:
subsuite: ci
when:
files-changed:
- '.taskcluster.yml'
- 'taskcluster/ci/**'
- 'taskcluster/**/*.py'
- 'tools/tryselect/selectors/auto.py'
Expand Down
25 changes: 25 additions & 0 deletions taskcluster/gecko_taskgraph/test/test_taskcluster_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,31 @@ def test_push(self):
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": "[email protected]",
"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 = {
Expand Down

0 comments on commit bd5c5ef

Please sign in to comment.