Settings: Actually deprecate access to feature flags (#78073)

This commit is contained in:
Ryan McKinley
2023-11-13 11:39:01 -08:00
committed by GitHub
parent 4a3c148298
commit dec9a07738
15 changed files with 37 additions and 21 deletions

View File

@@ -68,6 +68,7 @@ func ProvideService(cfg *setting.Cfg, cacheService *localcache.CacheService, mig
return nil, err
}
// nolint:staticcheck
if err := s.Migrate(cfg.IsFeatureToggleEnabled(featuremgmt.FlagMigrationLocking)); err != nil {
return nil, err
}
@@ -306,10 +307,12 @@ func (ss *SQLStore) buildConnectionString() (string, error) {
cnnstr += fmt.Sprintf("&transaction_isolation=%s", val)
}
// nolint:staticcheck
if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagMysqlAnsiQuotes) || ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagNewDBLibrary) {
cnnstr += "&sql_mode='ANSI_QUOTES'"
}
// nolint:staticcheck
if ss.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagNewDBLibrary) {
cnnstr += "&parseTime=true"
}
@@ -638,6 +641,7 @@ func initTestDB(testCfg *setting.Cfg, migration registry.DatabaseMigrator, opts
// set test db config
cfg := setting.NewCfg()
// nolint:staticcheck
cfg.IsFeatureToggleEnabled = func(key string) bool {
for _, enabledFeature := range features {
if enabledFeature == key {
@@ -732,6 +736,7 @@ func initTestDB(testCfg *setting.Cfg, migration registry.DatabaseMigrator, opts
return testSQLStore, nil
}
// nolint:staticcheck
testSQLStore.Cfg.IsFeatureToggleEnabled = func(key string) bool {
for _, enabledFeature := range features {
if enabledFeature == key {