Skip to content

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

Merged
frgfm merged 12 commits intomainfrom
frgfm/telegram
Nov 1, 2024
Merged

feat(organizations): add optional Telegram notifications for detections#381
frgfm merged 12 commits intomainfrom
frgfm/telegram

Conversation

@frgfm
Copy link
Copy Markdown
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
@socket-security
Copy link
Copy Markdown

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/httpcore@0.17.3 environment, filesystem, network 0 319 kB tomchristie
pypi/httpx@0.24.1 environment 0 359 kB florimondmanca, tomchristie, yeraydiazdiaz

🚮 Removed packages: pypi/httpcore@0.18.0, pypi/httpx@0.25.0

View full report↗︎

@codecov
Copy link
Copy Markdown

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
@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