Skip to content

Commit

Permalink
Codec summary subscription script
Browse files Browse the repository at this point in the history
Script for generating email notifications for codec
summary report.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Aug 28, 2024
1 parent d7935f9 commit 18e5158
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions kcidb/monitor/subscriptions/codec_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Codec summary subscription"""
from datetime import (timezone, datetime, timedelta)

from kcidb.monitor.output import NotificationMessage as Message


def match_revision(revision):
"""Match revisions for codec summary report from Maestro"""

if revision.builds_valid is None:
return ()

# If the revision is not from 'maestro' origin
if not {c.origin for c in revision.checkouts} & {'maestro'}:
return ()

# If fluster tests not found
if not revision.tests_root["fluster"].nodes:
return ()

# Send notification 3 hours after a revision is created/updated
return (Message(
subject='KernelCI report for fluster tests: '
'{% include "fluster_revision_summary.txt.j2" %}',
to=["Denis Yuji Shimizu <[email protected]>"],
body='{% include "fluster_revision_description.txt.j2" %}',
cc=["KernelCI Results Staging <[email protected]>",
"Helen Mae Koike Fornazier <[email protected]>",
"Gustavo Padovan <[email protected]>",
"Jeny Sadadia <[email protected]>"],
due=datetime.now(timezone.utc) + timedelta(hours=3)
),)

0 comments on commit 18e5158

Please sign in to comment.