oncall-engine/engine/apps/alerts/tasks
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
..
__init__.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
acknowledge_reminder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_web_title_cache.py Improve Jinja Template feedback and error handling (#884) 2022-11-28 09:46:51 -07:00
call_ack_url.py Lint 2022-08-02 15:26:17 -06:00
check_escalation_finished.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
compare_escalations.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
create_contact_points_for_datasource.py Refactor create/update contact points for Alerting integration (#872) 2023-01-25 09:42:42 +01:00
custom_button_result.py Handle JSONDecodeError for outgoing webhooks (#460) 2022-09-01 14:36:34 +01:00
custom_webhook_result.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
delete_alert_group.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
distribute_alert.py Add users_to_be_notified to new webhooks payload (#1798) 2023-04-20 16:13:48 +00:00
escalate_alert_group.py Refactor maintenance (#1340) 2023-02-23 07:13:03 +00:00
invite_user_to_join_incident.py Refactor get_user_verbal_for_team_for_slack. (#809) 2023-03-07 10:09:37 +00:00
maintenance.py Insight logs (#348) 2022-08-24 12:04:44 +05:00
notify_all.py Fix the cause of retry of notify_all and notify_group tasks (#1376) 2023-02-23 09:28:13 +00:00
notify_group.py Fix the cause of retry of notify_all and notify_group tasks (#1376) 2023-02-23 09:28:13 +00:00
notify_ical_schedule_shift.py Matiasb/fix task refresh ical when empty value (#1401) 2023-02-24 21:16:09 +00:00
notify_user.py Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
resolve_alert_group_by_source_if_needed.py Limit number of alertmanager alerts in alert group to autoresolve (#1779) 2023-04-24 05:38:21 +00:00
resolve_by_last_step.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_alert_group_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_update_log_report_signal.py Refactor maintenance (#1340) 2023-02-23 07:13:03 +00:00
send_update_postmortem_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_update_resolution_note_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
sync_grafana_alerting_contact_points.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
task_logger.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
unsilence.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
wipe.py World, meet OnCall! 2022-06-03 08:09:47 -06:00