oncall-engine/grafana-plugin
Matias Bordese 20ec6f52bc
Add is_legacy column to handle webhook migration (#1813)
Legacy webhooks won't be editable at first. Keep data templates
compatibility.

Possible migration code:
```python
from apps.webhooks.models import Webhook
from apps.alerts.models import CustomButton, EscalationPolicy

custom_buttons = CustomButton.objects.all()
for cb in custom_buttons:
    webhook, _ = Webhook.objects.get_or_create(
        organization=cb.organization,
        team=cb.team,
        name=cb.name,
        is_legacy=True,
        defaults=dict(
            created_at=cb.created_at,
            url=cb.webhook,
            username=cb.user,
            password=cb.password,
            authorization_header=cb.authorization_header,
            trigger_type=Webhook.TRIGGER_ESCALATION_STEP,
            forward_all=cb.forward_whole_payload,
            data=cb.data,
        )
    )
    # migrate related escalation policies
    policies = EscalationPolicy.objects.filter(
        step=EscalationPolicy.STEP_TRIGGER_CUSTOM_BUTTON,
        custom_button_trigger=cb,
    ).update(
        step=EscalationPolicy.STEP_TRIGGER_CUSTOM_WEBHOOK,
        custom_webhook=webhook,
    )

```
2023-04-25 11:22:56 -03:00
..
integration-tests fix safari scroll (#1663) 2023-03-30 18:17:58 +00:00
provisioning World, meet OnCall! 2022-06-03 08:09:47 -06:00
src Add is_legacy column to handle webhook migration (#1813) 2023-04-25 11:22:56 -03: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 One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
grafana-plugin.yml.example World, meet OnCall! 2022-06-03 08:09:47 -06:00
jest.config.js first UI integration test - phone verification + receive SMS alert flow (#900) 2023-03-06 16:28:52 +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 Revert "Revert "speed up ci builds from 15 to <7 minutes"" (#1643) 2023-03-28 09:34:03 +02:00
playwright.config.ts fix safari scroll (#1663) 2023-03-30 18:17:58 +00: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 Revert "Revert "speed up ci builds from 15 to <7 minutes"" (#1643) 2023-03-28 09:34:03 +02:00