grafana/pkg/services/ngalert/migration
Matthew Jacobson 3537c5440f
Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719)
Some refactoring that will simplify next changes for dry-run PRs. This should be no-op as far as the created ngalert resources and database state, though it does change some logs.

The key change here is to modify migrateOrg to return pairs of legacy struct + ngalert struct instead of actually persisting the alerts and alertmanager config. This will allow us to capture error information during dry-run migration.

It also moves most persistence-related operations such as title deduplication and folder creation to the right before we persist. This will simplify eventual partial migrations (individual alerts, dashboards, channels, ...).

Additionally it changes channel code to deal with PostableGrafanaReceiver instead of PostableApiReceiver (integration instead of contact point).
2024-01-05 05:37:13 -05:00
..
models Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
store Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
alert_rule_test.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
alert_rule.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
channel_test.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
channel.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
cond_trans_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
cond_trans.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
migration_test.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
models.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
permissions_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
permissions.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
persist.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
securejsondata.go Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
service_test.go Alerting: Add clean_upgrade config and deprecate force_migration (#78324) 2023-11-30 11:01:11 -05:00
service.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
silences.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
template_test.go Alerting: Handle edge cases without panicking during template migration (#76890) 2023-11-02 13:24:54 -04:00
template.go Alerting: Handle edge cases without panicking during template migration (#76890) 2023-11-02 13:24:54 -04:00
testing.go Alerting: Fix flaky SQLITE_BUSY when migrating with provisioned dashboards (#76658) 2023-10-19 10:03:00 -04:00
ualert_test.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00
ualert.go Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719) 2024-01-05 05:37:13 -05:00