Skip to content

Commit

Permalink
feat: add originated supervisor ID to slack alert messages and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Dec 6, 2024
1 parent 6298b6f commit 590bf6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/enrgdaq/daq/alert/alert_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def send_webhook(self, alert: DAQJobMessageAlert):
else "-",
"short": True,
},
{
"title": "Originated Supervisor ID",
"value": alert.originated_supervisor_id,
"short": True,
},
{
"title": "Severity",
"value": alert.alert_info.severity,
Expand Down
7 changes: 6 additions & 1 deletion src/tests/test_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_send_alert(self):
message="Test error message",
),
date=datetime(2023, 10, 1, 12, 0, 0),
originated_supervisor_id="mock",
originated_supervisor_id="mock2",
)
self.daq_job.send_webhook(alert)
assert alert.daq_job_info is not None
Expand All @@ -46,6 +46,11 @@ def test_send_alert(self):
"value": "mock",
"short": True,
},
{
"title": "Originated Supervisor ID",
"value": "mock2",
"short": True,
},
{
"title": "Severity",
"value": DAQAlertSeverity.ERROR,
Expand Down

0 comments on commit 590bf6e

Please sign in to comment.