diff --git a/conf/defaults.ini b/conf/defaults.ini index c8a9077c2eb..79ecacdf39b 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -1732,7 +1732,7 @@ install_token = hide_angular_deprecation = # Comma separated list of plugin ids for which environment variables should be forwarded. Used only when feature flag pluginsSkipHostEnvVars is enabled. forward_host_env_vars = -# Comma separated list of plugin ids to install as part of the startup process. Used only when feature flag backgroundPluginInstaller is enabled. +# Comma separated list of plugin ids to install as part of the startup process. preinstall = # Controls whether preinstall plugins asynchronously (in the background) or synchronously (blocking). Useful when preinstalled plugins are used with provisioning. preinstall_async = true diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 70241e18f24..3102a626929 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -194,7 +194,6 @@ Experimental features might be changed or removed without prior notice. | `databaseReadReplica` | Use a read replica for some database queries. | | `alertingApiServer` | Register Alerting APIs with the K8s API server | | `dashboardRestoreUI` | Enables the frontend to be able to restore a recently deleted dashboard | -| `backgroundPluginInstaller` | Enable background plugin installer | | `dataplaneAggregator` | Enable grafana dataplane aggregator | | `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture | | `lokiSendDashboardPanelNames` | Send dashboard and panel names to Loki when querying | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 42583413869..d9997e00dc7 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -203,7 +203,6 @@ export interface FeatureToggles { cloudwatchMetricInsightsCrossAccount?: boolean; prometheusAzureOverrideAudience?: boolean; alertingFilterV2?: boolean; - backgroundPluginInstaller?: boolean; dataplaneAggregator?: boolean; newFiltersUI?: boolean; lokiSendDashboardPanelNames?: boolean; diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 783bb2f8aa0..ceb2cf91357 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -1402,13 +1402,6 @@ var ( Owner: grafanaAlertingSquad, HideFromDocs: true, }, - { - Name: "backgroundPluginInstaller", - Description: "Enable background plugin installer", - Stage: FeatureStageExperimental, - Owner: grafanaPluginsPlatformSquad, - RequiresRestart: true, - }, { Name: "dataplaneAggregator", Description: "Enable grafana dataplane aggregator", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index a2d6581e3f1..34ced336d25 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -184,7 +184,6 @@ bodyScrolling,preview,@grafana/grafana-frontend-platform,false,false,true cloudwatchMetricInsightsCrossAccount,preview,@grafana/aws-datasources,false,false,true prometheusAzureOverrideAudience,deprecated,@grafana/partner-datasources,false,false,false alertingFilterV2,experimental,@grafana/alerting-squad,false,false,false -backgroundPluginInstaller,experimental,@grafana/plugins-platform-backend,false,true,false dataplaneAggregator,experimental,@grafana/grafana-app-platform-squad,false,true,false newFiltersUI,experimental,@grafana/dashboards-squad,false,false,false lokiSendDashboardPanelNames,experimental,@grafana/observability-logs,false,false,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 5fd18a55235..68939c99530 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -747,10 +747,6 @@ const ( // Enable the new alerting search experience FlagAlertingFilterV2 = "alertingFilterV2" - // FlagBackgroundPluginInstaller - // Enable background plugin installer - FlagBackgroundPluginInstaller = "backgroundPluginInstaller" - // FlagDataplaneAggregator // Enable grafana dataplane aggregator FlagDataplaneAggregator = "dataplaneAggregator" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index 036c2eaa02a..21b8b4cf14d 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -580,7 +580,8 @@ "metadata": { "name": "backgroundPluginInstaller", "resourceVersion": "1723202510081", - "creationTimestamp": "2024-08-09T11:21:50Z" + "creationTimestamp": "2024-08-09T11:21:50Z", + "deletionTimestamp": "2024-09-20T13:20:41Z" }, "spec": { "description": "Enable background plugin installer", diff --git a/pkg/services/pluginsintegration/plugininstaller/service.go b/pkg/services/pluginsintegration/plugininstaller/service.go index 458513fef76..b7ff631f8f5 100644 --- a/pkg/services/pluginsintegration/plugininstaller/service.go +++ b/pkg/services/pluginsintegration/plugininstaller/service.go @@ -11,7 +11,6 @@ import ( "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins/repo" - "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore" "github.com/grafana/grafana/pkg/setting" "github.com/prometheus/client_golang/prometheus" @@ -36,21 +35,19 @@ var ( type Service struct { cfg *setting.Cfg - features featuremgmt.FeatureToggles log log.Logger pluginInstaller plugins.Installer pluginStore pluginstore.Store failOnErr bool } -func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, pluginStore pluginstore.Store, pluginInstaller plugins.Installer, promReg prometheus.Registerer) (*Service, error) { +func ProvideService(cfg *setting.Cfg, pluginStore pluginstore.Store, pluginInstaller plugins.Installer, promReg prometheus.Registerer) (*Service, error) { once.Do(func() { promReg.MustRegister(installRequestCounter) promReg.MustRegister(installRequestDuration) }) s := &Service{ - features: features, log: log.New("plugin.backgroundinstaller"), cfg: cfg, pluginInstaller: pluginInstaller, @@ -69,8 +66,7 @@ func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles, plugi // IsDisabled disables background installation of plugins. func (s *Service) IsDisabled() bool { - return !s.features.IsEnabled(context.Background(), featuremgmt.FlagBackgroundPluginInstaller) || - len(s.cfg.PreinstallPlugins) == 0 || + return len(s.cfg.PreinstallPlugins) == 0 || !s.cfg.PreinstallPluginsAsync } diff --git a/pkg/services/pluginsintegration/plugininstaller/service_test.go b/pkg/services/pluginsintegration/plugininstaller/service_test.go index 4a01c328503..054f1d470b5 100644 --- a/pkg/services/pluginsintegration/plugininstaller/service_test.go +++ b/pkg/services/pluginsintegration/plugininstaller/service_test.go @@ -7,7 +7,6 @@ import ( "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins/manager/fakes" "github.com/grafana/grafana/pkg/plugins/manager/registry" - "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore" "github.com/grafana/grafana/pkg/setting" "github.com/prometheus/client_golang/prometheus" @@ -22,7 +21,6 @@ func TestService_IsDisabled(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(featuremgmt.FlagBackgroundPluginInstaller), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{}, prometheus.NewRegistry(), @@ -42,7 +40,6 @@ func TestService_Run(t *testing.T) { &setting.Cfg{ PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}}, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -66,7 +63,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin", Version: "1.0.0"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -98,7 +94,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(), pluginstore.New(preg, &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -131,7 +126,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin", Version: "2.0.0"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(), pluginstore.New(preg, &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -155,7 +149,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin1"}, {ID: "myplugin2"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -179,7 +172,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin1"}, {ID: "myplugin2"}}, PreinstallPluginsAsync: true, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -205,7 +197,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}}, PreinstallPluginsAsync: false, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error { @@ -225,7 +216,6 @@ func TestService_Run(t *testing.T) { PreinstallPlugins: []setting.InstallPlugin{{ID: "myplugin"}}, PreinstallPluginsAsync: false, }, - featuremgmt.WithFeatures(), pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}), &fakes.FakePluginInstaller{ AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.CompatOpts) error {