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
+6
View File
@@ -43,18 +43,22 @@ func ProvideAppInstallers(
playlistAppInstaller,
pluginsApplInstaller,
}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesShortURLs) {
installers = append(installers, shorturlAppInstaller)
}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesAlertingRules) && rulesAppInstaller != nil {
installers = append(installers, rulesAppInstaller)
}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesCorrelations) {
installers = append(installers, correlationsAppInstaller)
}
if alertingNotificationAppInstaller != nil {
installers = append(installers, alertingNotificationAppInstaller)
}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesLogsDrilldown) {
installers = append(installers, logsdrilldownAppInstaller)
}
@@ -97,10 +101,12 @@ func ProvideBuilderRunners(
var apiGroupRunner *runner.APIGroupRunner
var err error
providers := []app.Provider{}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagInvestigationsBackend) {
logger.Debug("Investigations backend is enabled")
providers = append(providers, investigationAppProvider)
}
//nolint:staticcheck // not yet migrated to OpenFeature
if features.IsEnabledGlobally(featuremgmt.FlagGrafanaAdvisor) &&
!slices.Contains(grafanaCfg.DisablePlugins, "grafana-advisor-app") {
providers = append(providers, advisorAppProvider)
+1
View File
@@ -44,6 +44,7 @@ func RegisterAppInstaller(
service: p,
}
specificConfig := any(&playlistapp.PlaylistConfig{
//nolint:staticcheck // not yet migrated to OpenFeature
EnableReconcilers: features.IsEnabledGlobally(featuremgmt.FlagPlaylistsReconciler),
})
provider := simple.NewAppProvider(apis.LocalManifest(), specificConfig, playlistapp.New)