CloudMigrations: Add config for alert rules state behavior and remove experimental feature toggle on alerts migration (#97254)

* CloudMigrations: add config for controlling alert rules state behavior

* CloudMigrations: remove experimental 'onPremToCloudMigrationsAlerts' feature toggle
This commit is contained in:
Matheus Macabu
2024-12-17 12:56:18 +01:00
committed by GitHub
parent ae7cb6866d
commit c824f5b9bf
12 changed files with 69 additions and 95 deletions

View File

@ -826,7 +826,9 @@ func ctxWithSignedInUser() context.Context {
return ctx
}
func setUpServiceTest(t *testing.T, withDashboardMock bool) cloudmigration.Service {
type configOverrides func(c *setting.Cfg)
func setUpServiceTest(t *testing.T, withDashboardMock bool, cfgOverrides ...configOverrides) cloudmigration.Service {
sqlStore := db.InitTestDB(t)
secretsService := secretsfakes.NewFakeSecretsService()
rr := routing.NewRouteRegister()
@ -866,7 +868,6 @@ func setUpServiceTest(t *testing.T, withDashboardMock bool) cloudmigration.Servi
featureToggles := featuremgmt.WithFeatures(
featuremgmt.FlagOnPremToCloudMigrations,
featuremgmt.FlagOnPremToCloudMigrationsAlerts,
featuremgmt.FlagDashboardRestore, // needed for skipping creating soft-deleted dashboards in the snapshot.
)
@ -930,6 +931,10 @@ func setUpServiceTest(t *testing.T, withDashboardMock bool) cloudmigration.Servi
require.NoError(t, err)
}
for _, cfgOverride := range cfgOverrides {
cfgOverride(cfg)
}
s, err := ProvideService(
cfg,
httpclient.NewProvider(),