From dd1de388a2b18bf88969d6e3b1aa45928a9078f1 Mon Sep 17 00:00:00 2001 From: Jeny Sadadia Date: Wed, 18 Sep 2024 16:44:00 +0530 Subject: [PATCH] Enable email notifications for `omap` tree The report would contain build and boot failures. Signed-off-by: Jeny Sadadia --- kcidb/monitor/subscriptions/linux_omap.py | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 kcidb/monitor/subscriptions/linux_omap.py diff --git a/kcidb/monitor/subscriptions/linux_omap.py b/kcidb/monitor/subscriptions/linux_omap.py new file mode 100644 index 00000000..3fdf5a42 --- /dev/null +++ b/kcidb/monitor/subscriptions/linux_omap.py @@ -0,0 +1,38 @@ +"""Linux omap subscription""" +from datetime import (timezone, datetime, timedelta) + +from kcidb.monitor.output import NotificationMessage as Message + + +def match_revision(revision): + """Match revisions of omap tree""" + # Repo we're interested in + repo_url = "https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/" \ + "linux-omap.git" + + # If the revision is not from omap repo, + # or there are no finished builds + + if repo_url not in revision.repo_branch_checkouts: + return () + + if revision.builds_valid is None: + return () + + # If the revision is not from 'maestro' or 'broonie' origin + if not {c.origin for c in revision.checkouts} & {'maestro', 'broonie'}: + return () + + # Send notification 3 hours after a revision is created/updated + return (Message( + subject='KernelCI report for omap: ' + '{% include "stable_revision_summary.txt.j2" %}', + to=["Kevin Hilman "], + cc=["KernelCI Results Staging ", + "Jeny Sadadia ", + "Gustavo Padovan ", + "Helen Mae Koike Fornazier "], + body='{% include "stable_rc_revision_description.txt.j2" %}', + due=datetime.now(timezone.utc) + timedelta(hours=3), + context={'main_repo_url': repo_url} + ),)