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

feat(organizations): add optional Telegram notifications for detections #381

Merged
merged 12 commits into from
Nov 1, 2024

Conversation

frgfm
Copy link
Member

@frgfm frgfm commented Oct 27, 2024

This PR is greatly inspired from #272 by @blenzi 🙏
It introduces the following modifications:

  • add Telegram as a service + test cases (verifying token, channel access, etc.)
  • add the possibility for each org to have a dedicated telegram channel ID (created by human admins, where the bot has to be invited)
  • when a detection is created, on top of webhooks, we send the detection payload to the channel (unformatted for now)

Here is the updated DB schema: https://dbdiagram.io/d/Pyronear-DB-671e1b9897a66db9a3673d76

cc @MateoLostanlen

@github-actions github-actions bot added the topic: build Related to build, installation & CI label Oct 27, 2024
Copy link

socket-security bot commented Oct 27, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] environment, filesystem, network 0 319 kB tomchristie
pypi/[email protected] environment 0 359 kB florimondmanca, tomchristie, yeraydiazdiaz

🚮 Removed packages: pypi/[email protected], pypi/[email protected]

View full report↗︎

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 71.15385% with 15 lines in your changes missing coverage. Please review.

Project coverage is 85.51%. Comparing base (0248df7) to head (d9b93ab).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/app/services/telegram.py 75.86% 7 Missing ⚠️
src/app/api/api_v1/endpoints/detections.py 50.00% 4 Missing ⚠️
src/app/api/api_v1/endpoints/organizations.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #381      +/-   ##
==========================================
- Coverage   86.39%   85.51%   -0.89%     
==========================================
  Files          34       35       +1     
  Lines         941      987      +46     
==========================================
+ Hits          813      844      +31     
- Misses        128      143      +15     
Flag Coverage Δ
backend 85.06% <71.15%> (-0.93%) ⬇️
client 92.06% <ø> (ø)

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

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

@frgfm frgfm requested a review from a team October 27, 2024 11:57
@frgfm frgfm merged commit b11d217 into main Nov 1, 2024
27 of 29 checks passed
@frgfm frgfm deleted the frgfm/telegram branch November 1, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant