chore : Deprecating FeatureToggles.IsEnabledGlobally (#112885)

* add deprecation on featuremgmt.IsEnabledGlobally

* add nolint reason

* add reasonable deprecation message

* remove junk edits

* add more nolints

* addressing review comments

* Update pkg/services/featuremgmt/models.go

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
Denis Vodopianov
2025-10-24 12:02:53 -04:00
committed by GitHub
co-authored by Dave Henderson
parent 4cea71ee73
commit 81683d554d
88 changed files with 134 additions and 9 deletions
+3
View File
@@ -63,9 +63,11 @@ func RegisterAPIService(
reg prometheus.Registerer,
) (*DataSourceAPIBuilder, error) {
// We want to expose just a limited set of plugins
//nolint:staticcheck // not yet migrated to OpenFeature
explicitPluginList := features.IsEnabledGlobally(featuremgmt.FlagDatasourceAPIServers)
// This requires devmode!
//nolint:staticcheck // not yet migrated to OpenFeature
if !explicitPluginList && !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) {
return nil, nil // skip registration unless opting into experimental apis
}
@@ -111,6 +113,7 @@ func RegisterAPIService(
datasources.GetDatasourceProvider(pluginJSON),
contextProvider,
accessControl,
//nolint:staticcheck // not yet migrated to OpenFeature
features.IsEnabledGlobally(featuremgmt.FlagDatasourceQueryTypes),
false,
)