Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Create notification for incidents #543

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions kcidb/monitor/subscriptions/incident_notification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Incident notifications"""

from kcidb.monitor.output import NotificationMessage as Message


def match_incident(incident):
"""Send notification upon incident creation"""

print(f"Generating notification for {incident.id}")
# if not incident.issue.subsriber:
# return ()

# static subscriber for testing
subscriber = "Jeny Sadadia <[email protected]>"

return (Message(
subject='Incident notification for {% include "incident_summary.txt.j2" %}',
to=[subscriber],
body='{% include "incident_description.txt.j2" %}',
),)
Loading