Skip to content

Event detector slack integration#163

Open
LDiazN wants to merge 13 commits into
mainfrom
changepoints-slack-integration
Open

Event detector slack integration#163
LDiazN wants to merge 13 commits into
mainfrom
changepoints-slack-integration

Conversation

@LDiazN

@LDiazN LDiazN commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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 POST request into a Slack webhook with this message

The slack webhook should be specified as an Airflow variable from the Airflow panel

@LDiazN LDiazN requested a review from hellais June 26, 2026 10:11
@LDiazN LDiazN self-assigned this Jun 26, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.86%. Comparing base (17a4258) to head (b993e51).

❌ 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.

❗ There is a different number of reports uploaded between BASE (17a4258) and HEAD (b993e51). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (17a4258) HEAD (b993e51)
oonipipeline 1 0
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     
Flag Coverage Δ
oonidata 77.86% <ø> (ø)
oonipipeline ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LDiazN LDiazN marked this pull request as ready for review June 26, 2026 11:09
changepoint: Changepoint, base_url: str = "https://explorer.ooni.org/"
) -> str:
start_time = changepoint["ts"] - timedelta(days=5)
end_time = changepoint["ts"] + timedelta(days=5)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants