Event detector slack integration#163
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (77.86%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
- Coverage 84.06% 77.86% -6.20%
==========================================
Files 85 33 -52
Lines 5271 1938 -3333
==========================================
- Hits 4431 1509 -2922
+ Misses 840 429 -411
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| changepoint: Changepoint, base_url: str = "https://explorer.ooni.org/" | ||
| ) -> str: | ||
| start_time = changepoint["ts"] - timedelta(days=5) | ||
| end_time = changepoint["ts"] + timedelta(days=5) |
There was a problem hiding this comment.
I think the explorer URL should include more days in the past and less in the future, since it's probably going to alert very much in proximity to the current time.
I would suggest putting a start_time of -13 days and an end_time of maybe +2 days
| message += ( | ||
| f"• :flag-{cp['probe_cc'].lower()}: [{cp['probe_cc']}/AS{cp['probe_asn']}] " | ||
| f"*{cp['domain']}* {dir_to_str(cp['change_dir'])} - `{cp['block_type']}` " | ||
| f"| <{explorer}|explorer>\n" |
There was a problem hiding this comment.
Can we include also links to the alert pages which are currently hosted only on the test infrastructure, for example: https://explorer.test.ooni.org/chart/alerts?probe_asn=AS8632&probe_cc=LU&domain=elpha.com&since=2026-06-15&until=2026-07-13
There was a problem hiding this comment.
Sure, I didn't include it since we only have it deployed on test, but I can add that in the meanwhile one as well
This PR will implement a slack integration to publish the results of the event detector to a dedicated Slack channel.
It works by composing a message with the list of detected changes after an hourly detector run, and sending a
POSTrequest into a Slack webhook with this messageThe slack webhook should be specified as an Airflow variable from the Airflow panel