oncall-engine/engine/apps/alerts
Innokentii Konstantinov 1f786e8d2a
Phone provider refactoring (#1713)
# What this PR does
This PR moves phone notification logic into separate object PhoneBackend
and introduces PhoneProvider interface to hide actual implementation of
external phone services provider. It should allow add new phone
providers just by implementing one class (See SimplePhoneProvider for
example).
# Why 
[Asterisk PR](https://github.com/grafana/oncall/pull/1282) showed that
our phone notification system is not flexible. However this is one of
the most frequent community questions - how to add "X" phone provider.
Also, this refactoring move us one step closer to unifying all
notification backends, since with PhoneBackend all phone notification
logic is collected in one place and independent from concrete
realisation.
# Highligts
1. PhoneBackend object - contains all phone notifications business
logic.
2. PhoneProvider - interface to  external phone services provider.
3. TwilioPhoneProvider and SimplePhoneProvider - two examples of
PhoneProvider implementation.
4. PhoneCallRecord and SMSRecord models. I introduced these models to
keep phone notification limits logic decoupled from external providers.
Existing TwilioPhoneCall and TwilioSMS objects will be migrated to the
new table to not to reset limits counter. To be able to receive status
callbacks and gather from Twilio TwilioPhoneCall and TwilioSMS still
exists, but they are linked to PhoneCallRecord and SMSRecord via fk, to
not to leat twilio logic into core code.

---------

Co-authored-by: Yulia Shanyrova <yulia.shanyrova@grafana.com>
2023-05-24 06:27:48 +00:00
..
escalation_snapshot add several new database columns + emit two new Django signals (#1522) 2023-04-14 09:15:57 +02:00
grafana_alerting_sync_manager Refactor create/update contact points for Alerting integration (#872) 2023-01-25 09:42:42 +01:00
incident_appearance Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
incident_log_builder modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
migrations add missing alertgroup db migration (#1894) 2023-05-08 12:51:27 -04:00
models Remove template editor from Slack (#1847) 2023-05-02 14:06:20 +08:00
tasks Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
terraform_renderer World, meet OnCall! 2022-06-03 08:09:47 -06:00
tests Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
admin.py Alert group search (#488) 2022-09-06 11:30:12 +01:00
constants.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
integration_options_mixin.py Restore email notifications (#621) 2022-10-19 12:32:56 +01:00
paging.py Keep track of direct paging schedule/importance in logs (#1269) 2023-02-02 09:21:31 -03:00
representative.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
signals.py Add users_to_be_notified to new webhooks payload (#1798) 2023-04-20 16:13:48 +00:00
utils.py Fix outgoing webhook to resolve IP from parsed hostname 2022-09-22 14:35:37 -03:00