oncall-engine/grafana-plugin
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
..
integration-tests e2e tests on CI - actually await k8s resources to be ready before starting tests (#1997) 2023-05-23 20:20:46 -04:00
provisioning World, meet OnCall! 2022-06-03 08:09:47 -06:00
src Phone provider refactoring (#1713) 2023-05-24 06:27:48 +00:00
tools Merge dev to main (#54) 2022-06-13 16:39:58 -06:00
.dockerignore One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
.env.example add IS_OPEN_SOURCE env var to UI integration tests (#1546) 2023-03-15 06:56:03 +01:00
.eslintignore World, meet OnCall! 2022-06-03 08:09:47 -06:00
.eslintrc.js added dotenv to read env variables, pass faro instance to this.faro 2022-12-15 17:47:30 +02:00
.gitignore improve e2e tests authentication flow (#1470) 2023-03-10 06:45:15 +01:00
.prettierrc.js World, meet OnCall! 2022-06-03 08:09:47 -06:00
.release-it.js World, meet OnCall! 2022-06-03 08:09:47 -06:00
.stylelintignore World, meet OnCall! 2022-06-03 08:09:47 -06:00
.stylelintrc add selector-max-type stylelint rule 2022-11-02 11:44:42 +00:00
babel.config.json add precommit rules for markdown/json files (#915) 2022-12-01 14:26:54 +01:00
Dockerfile.dev Feat(Dev): Improve Building of Grafana Plugin in Development Env + update node version (#1890) 2023-05-17 16:12:51 -04:00
grafana-plugin.yml.example World, meet OnCall! 2022-06-03 08:09:47 -06:00
jest.config.js Iskhakov/fix frontend tests (#1878) 2023-05-12 02:20:27 +00:00
jest.setup.ts Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
LICENSE World, meet OnCall! 2022-06-03 08:09:47 -06:00
package.json Feat(Dev): Improve Building of Grafana Plugin in Development Env + update node version (#1890) 2023-05-17 16:12:51 -04:00
playwright.config.ts e2e tests on CI - actually await k8s resources to be ready before starting tests (#1997) 2023-05-23 20:20:46 -04:00
plopfile.js Merge dev to main (#54) 2022-06-13 16:39:58 -06:00
tsconfig.json first UI integration test - phone verification + receive SMS alert flow (#900) 2023-03-06 16:28:52 +00:00
webpack.config.js review 2022-12-22 13:38:47 +02:00
yarn.lock Feat(Dev): Improve Building of Grafana Plugin in Development Env + update node version (#1890) 2023-05-17 16:12:51 -04:00