Skip to content

Commit

Permalink
kcidb/monitor/subscriptions: add 'linux_stable_rt' subscription
Browse files Browse the repository at this point in the history
Add a subscription script for generating notifications
for Linux `stable-rt` tree.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Aug 28, 2024
1 parent 2c10adc commit 2aaf2f8
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions kcidb/monitor/subscriptions/linux_stable_rt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Linux stable-rt subscription"""
from datetime import (timezone, datetime, timedelta)

from kcidb.monitor.output import NotificationMessage as Message


def match_revision(revision):
"""Match revisions of stable-rt tree"""
# Repo we're interested in
repo_url = "https://git.kernel.org/pub/scm/linux/kernel/git/rt/" \
"linux-stable-rt.git"

# If the revision is not from stable-rt 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 stable-rt: '
'{% include "stable_rt_revision_summary.txt.j2" %}',
to=["Jeny Sadadia <[email protected]>",
"Gustavo Padovan <[email protected]>",
"Shreeya Patel <[email protected]>"],
body='{% include "stable_rt_revision_description.txt.j2" %}',
cc=["KernelCI Results Staging <[email protected]>"],
due=datetime.now(timezone.utc) + timedelta(hours=3)
),)

0 comments on commit 2aaf2f8

Please sign in to comment.