diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 181967464f9..8dce1268c27 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -111,7 +111,6 @@ /pkg/services/org/ @grafana/backend-platform /pkg/services/playlist/ @grafana/backend-platform /pkg/services/plugindashboards/ @grafana/backend-platform -/pkg/services/pluginsettings/ @grafana/backend-platform /pkg/services/preference/ @grafana/backend-platform /pkg/services/provisioning/ @grafana/backend-platform /pkg/services/publicdashboards/ @grafana/dashboards-squad @@ -281,6 +280,7 @@ /pkg/services/pluginsintegration/ @grafana/plugins-platform-backend /pkg/plugins/pfs/ @grafana/plugins-platform-backend @grafana/grafana-as-code /pkg/tsdb/testdatasource/ @grafana/plugins-platform-backend +/pkg/services/pluginsintegration/pluginsettings/ @grafana/plugins-platform-backend # Dashboard previews / crawler (behind feature flag) /pkg/services/thumbs/ @grafana/grafana-app-platform-squad diff --git a/pkg/api/datasources.go b/pkg/api/datasources.go index 49597f4e57b..85f2029a768 100644 --- a/pkg/api/datasources.go +++ b/pkg/api/datasources.go @@ -17,10 +17,10 @@ import ( "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/plugins/adapters" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/datasources/permissions" + "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index cc5ac4594b1..6a83bdc227d 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -11,7 +11,7 @@ import ( contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/licensing" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/secrets/kvstore" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/tsdb/grafanads" diff --git a/pkg/api/frontendsettings_test.go b/pkg/api/frontendsettings_test.go index 8d809418f99..0ab25e49009 100644 --- a/pkg/api/frontendsettings_test.go +++ b/pkg/api/frontendsettings_test.go @@ -20,14 +20,14 @@ import ( accesscontrolmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/licensing" - pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/rendering" "github.com/grafana/grafana/pkg/services/updatechecker" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web" ) -func setupTestEnvironment(t *testing.T, cfg *setting.Cfg, features *featuremgmt.FeatureManager, pstore plugins.Store, psettings pluginSettings.Service) (*web.Mux, *HTTPServer) { +func setupTestEnvironment(t *testing.T, cfg *setting.Cfg, features *featuremgmt.FeatureManager, pstore plugins.Store, psettings pluginsettings.Service) (*web.Mux, *HTTPServer) { t.Helper() db.InitTestDB(t) cfg.IsFeatureToggleEnabled = features.IsEnabled @@ -50,7 +50,7 @@ func setupTestEnvironment(t *testing.T, cfg *setting.Cfg, features *featuremgmt. var pluginsSettings = psettings if pluginsSettings == nil { - pluginsSettings = &pluginSettings.FakePluginSettings{} + pluginsSettings = &pluginsettings.FakePluginSettings{} } hs := &HTTPServer{ @@ -210,7 +210,7 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) { tests := []struct { desc string pluginStore func() plugins.Store - pluginSettings func() pluginSettings.Service + pluginSettings func() pluginsettings.Service expected settings }{ { @@ -230,8 +230,8 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) { }, } }, - pluginSettings: func() pluginSettings.Service { - return &pluginSettings.FakePluginSettings{ + pluginSettings: func() pluginsettings.Service { + return &pluginsettings.FakePluginSettings{ Plugins: newAppSettings("test-app", false), } }, @@ -263,8 +263,8 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) { }, } }, - pluginSettings: func() pluginSettings.Service { - return &pluginSettings.FakePluginSettings{ + pluginSettings: func() pluginsettings.Service { + return &pluginsettings.FakePluginSettings{ Plugins: newAppSettings("test-app", true), } }, @@ -298,8 +298,8 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) { } } -func newAppSettings(id string, enabled bool) map[string]*pluginSettings.DTO { - return map[string]*pluginSettings.DTO{ +func newAppSettings(id string, enabled bool) map[string]*pluginsettings.DTO { + return map[string]*pluginsettings.DTO{ id: { ID: 0, OrgID: 1, diff --git a/pkg/api/http_server.go b/pkg/api/http_server.go index 710d8c3dee6..a24a592e72d 100644 --- a/pkg/api/http_server.go +++ b/pkg/api/http_server.go @@ -32,7 +32,6 @@ import ( "github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/middleware/csrf" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/plugins/pluginscdn" "github.com/grafana/grafana/pkg/registry/corekind" "github.com/grafana/grafana/pkg/services/accesscontrol" @@ -69,7 +68,8 @@ import ( "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/playlist" "github.com/grafana/grafana/pkg/services/plugindashboards" - pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext" + pluginSettings "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" pref "github.com/grafana/grafana/pkg/services/preference" "github.com/grafana/grafana/pkg/services/provisioning" publicdashboardsApi "github.com/grafana/grafana/pkg/services/publicdashboards/api" diff --git a/pkg/api/plugin_proxy.go b/pkg/api/plugin_proxy.go index 0ff09d45bb0..1cec8502e76 100644 --- a/pkg/api/plugin_proxy.go +++ b/pkg/api/plugin_proxy.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/grafana/pkg/api/pluginproxy" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/web" ) diff --git a/pkg/api/plugin_resource_test.go b/pkg/api/plugin_resource_test.go index 90de2bcaebc..b0218997446 100644 --- a/pkg/api/plugin_resource_test.go +++ b/pkg/api/plugin_resource_test.go @@ -27,14 +27,14 @@ import ( "github.com/grafana/grafana/pkg/plugins/manager/signature" "github.com/grafana/grafana/pkg/plugins/manager/sources" "github.com/grafana/grafana/pkg/plugins/manager/store" - "github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/plugins/pluginscdn" "github.com/grafana/grafana/pkg/services/accesscontrol" datasources "github.com/grafana/grafana/pkg/services/datasources/fakes" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/oauthtoken/oauthtokentest" - pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings/service" "github.com/grafana/grafana/pkg/services/pluginsintegration" + "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext" + pluginSettings "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings/service" "github.com/grafana/grafana/pkg/services/quota/quotatest" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/api/pluginproxy/pluginproxy.go b/pkg/api/pluginproxy/pluginproxy.go index a69abb209be..2eac4ac75fd 100644 --- a/pkg/api/pluginproxy/pluginproxy.go +++ b/pkg/api/pluginproxy/pluginproxy.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/plugins" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/api/pluginproxy/pluginproxy_test.go b/pkg/api/pluginproxy/pluginproxy_test.go index 4ac71cb9291..6ad082c2756 100644 --- a/pkg/api/pluginproxy/pluginproxy_test.go +++ b/pkg/api/pluginproxy/pluginproxy_test.go @@ -13,7 +13,7 @@ import ( "github.com/grafana/grafana/pkg/plugins" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/services/secrets/fakes" secretsManager "github.com/grafana/grafana/pkg/services/secrets/manager" diff --git a/pkg/api/plugins.go b/pkg/api/plugins.go index 5bb0e0834c2..952e679e755 100644 --- a/pkg/api/plugins.go +++ b/pkg/api/plugins.go @@ -28,7 +28,7 @@ import ( contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" "github.com/grafana/grafana/pkg/web" diff --git a/pkg/api/plugins_test.go b/pkg/api/plugins_test.go index bcaddeba8c5..5e4946976f4 100644 --- a/pkg/api/plugins_test.go +++ b/pkg/api/plugins_test.go @@ -27,7 +27,7 @@ import ( contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/org/orgtest" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/quota/quotatest" "github.com/grafana/grafana/pkg/services/updatechecker" "github.com/grafana/grafana/pkg/services/user" diff --git a/pkg/cmd/grafana-cli/runner/wire.go b/pkg/cmd/grafana-cli/runner/wire.go index af7bb2e7cda..e43ddece6ad 100644 --- a/pkg/cmd/grafana-cli/runner/wire.go +++ b/pkg/cmd/grafana-cli/runner/wire.go @@ -79,8 +79,6 @@ import ( "github.com/grafana/grafana/pkg/services/playlist/playlistimpl" "github.com/grafana/grafana/pkg/services/plugindashboards" plugindashboardsservice "github.com/grafana/grafana/pkg/services/plugindashboards/service" - "github.com/grafana/grafana/pkg/services/pluginsettings" - pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings/service" "github.com/grafana/grafana/pkg/services/pluginsintegration" "github.com/grafana/grafana/pkg/services/preference/prefimpl" "github.com/grafana/grafana/pkg/services/publicdashboards" @@ -244,8 +242,6 @@ var wireSet = wire.NewSet( dashsnapsvc.ProvideService, datasourceservice.ProvideService, wire.Bind(new(datasources.DataSourceService), new(*datasourceservice.Service)), - pluginSettings.ProvideService, - wire.Bind(new(pluginsettings.Service), new(*pluginSettings.Service)), alerting.ProvideService, ossaccesscontrol.ProvideServiceAccountPermissions, wire.Bind(new(accesscontrol.ServiceAccountPermissionsService), new(*ossaccesscontrol.ServiceAccountPermissionsService)), diff --git a/pkg/expr/nodes.go b/pkg/expr/nodes.go index 82e48d824b9..304f04c8e08 100644 --- a/pkg/expr/nodes.go +++ b/pkg/expr/nodes.go @@ -13,8 +13,8 @@ import ( "github.com/grafana/grafana/pkg/expr/classic" "github.com/grafana/grafana/pkg/expr/mathexp" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/plugins/adapters" "github.com/grafana/grafana/pkg/services/datasources" + "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters" ) var ( diff --git a/pkg/server/wire.go b/pkg/server/wire.go index f98ac36589e..576ea5dfdd7 100644 --- a/pkg/server/wire.go +++ b/pkg/server/wire.go @@ -7,8 +7,6 @@ import ( "github.com/google/wire" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" - "github.com/grafana/grafana/pkg/services/folder" - "github.com/grafana/grafana/pkg/api" "github.com/grafana/grafana/pkg/api/avatar" "github.com/grafana/grafana/pkg/api/routing" @@ -62,6 +60,7 @@ import ( "github.com/grafana/grafana/pkg/services/encryption" encryptionservice "github.com/grafana/grafana/pkg/services/encryption/service" "github.com/grafana/grafana/pkg/services/featuremgmt" + "github.com/grafana/grafana/pkg/services/folder" "github.com/grafana/grafana/pkg/services/folder/folderimpl" "github.com/grafana/grafana/pkg/services/grpcserver" grpccontext "github.com/grafana/grafana/pkg/services/grpcserver/context" @@ -92,8 +91,6 @@ import ( "github.com/grafana/grafana/pkg/services/playlist/playlistimpl" "github.com/grafana/grafana/pkg/services/plugindashboards" plugindashboardsservice "github.com/grafana/grafana/pkg/services/plugindashboards/service" - "github.com/grafana/grafana/pkg/services/pluginsettings" - pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings/service" "github.com/grafana/grafana/pkg/services/pluginsintegration" "github.com/grafana/grafana/pkg/services/preference/prefimpl" "github.com/grafana/grafana/pkg/services/publicdashboards" @@ -280,8 +277,6 @@ var wireBasicSet = wire.NewSet( dashsnapsvc.ProvideService, datasourceservice.ProvideService, wire.Bind(new(datasources.DataSourceService), new(*datasourceservice.Service)), - pluginSettings.ProvideService, - wire.Bind(new(pluginsettings.Service), new(*pluginSettings.Service)), alerting.ProvideService, serviceaccountsretriever.ProvideService, wire.Bind(new(serviceaccountsretriever.ServiceAccountRetriever), new(*serviceaccountsretriever.Service)), diff --git a/pkg/services/live/live.go b/pkg/services/live/live.go index 8e34578396a..c23241020e4 100644 --- a/pkg/services/live/live.go +++ b/pkg/services/live/live.go @@ -31,7 +31,6 @@ import ( "github.com/grafana/grafana/pkg/infra/usagestats" "github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/annotations" "github.com/grafana/grafana/pkg/services/comments/commentmodel" @@ -51,6 +50,7 @@ import ( "github.com/grafana/grafana/pkg/services/live/runstream" "github.com/grafana/grafana/pkg/services/live/survey" "github.com/grafana/grafana/pkg/services/org" + "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext" "github.com/grafana/grafana/pkg/services/query" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/services/user" diff --git a/pkg/services/live/liveplugin/plugin.go b/pkg/services/live/liveplugin/plugin.go index f35302ef12a..562933c1b6d 100644 --- a/pkg/services/live/liveplugin/plugin.go +++ b/pkg/services/live/liveplugin/plugin.go @@ -7,10 +7,10 @@ import ( "github.com/centrifugal/centrifuge" "github.com/grafana/grafana-plugin-sdk-go/backend" - "github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/live/orgchannel" "github.com/grafana/grafana/pkg/services/live/pipeline" + "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext" "github.com/grafana/grafana/pkg/services/user" ) diff --git a/pkg/services/navtree/navtreeimpl/applinks.go b/pkg/services/navtree/navtreeimpl/applinks.go index 0783b6e38e1..3c44c4f245f 100644 --- a/pkg/services/navtree/navtreeimpl/applinks.go +++ b/pkg/services/navtree/navtreeimpl/applinks.go @@ -10,7 +10,7 @@ import ( contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/navtree" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/util" ) diff --git a/pkg/services/navtree/navtreeimpl/applinks_test.go b/pkg/services/navtree/navtreeimpl/applinks_test.go index 32727630992..6646b3f52a1 100644 --- a/pkg/services/navtree/navtreeimpl/applinks_test.go +++ b/pkg/services/navtree/navtreeimpl/applinks_test.go @@ -16,7 +16,7 @@ import ( "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/navtree" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web" diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index 316d9f24cd3..f65b1fc950d 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -16,7 +16,7 @@ import ( "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/navtree" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" pref "github.com/grafana/grafana/pkg/services/preference" "github.com/grafana/grafana/pkg/services/querylibrary" "github.com/grafana/grafana/pkg/services/star" diff --git a/pkg/services/plugindashboards/service/dashboard_updater.go b/pkg/services/plugindashboards/service/dashboard_updater.go index 03cd21907f4..977f8d19b26 100644 --- a/pkg/services/plugindashboards/service/dashboard_updater.go +++ b/pkg/services/plugindashboards/service/dashboard_updater.go @@ -12,7 +12,7 @@ import ( "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/plugindashboards" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" ) func ProvideDashboardUpdater(bus bus.Bus, pluginStore plugins.Store, pluginDashboardService plugindashboards.Service, diff --git a/pkg/services/plugindashboards/service/dashboard_updater_test.go b/pkg/services/plugindashboards/service/dashboard_updater_test.go index 5b9e160e9f6..0b873751769 100644 --- a/pkg/services/plugindashboards/service/dashboard_updater_test.go +++ b/pkg/services/plugindashboards/service/dashboard_updater_test.go @@ -14,8 +14,8 @@ import ( "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/plugindashboards" - "github.com/grafana/grafana/pkg/services/pluginsettings" - "github.com/grafana/grafana/pkg/services/pluginsettings/service" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings/service" ) func TestDashboardUpdater(t *testing.T) { diff --git a/pkg/plugins/adapters/adapters.go b/pkg/services/pluginsintegration/adapters/adapters.go similarity index 100% rename from pkg/plugins/adapters/adapters.go rename to pkg/services/pluginsintegration/adapters/adapters.go diff --git a/pkg/plugins/plugincontext/plugincontext.go b/pkg/services/pluginsintegration/plugincontext/plugincontext.go similarity index 97% rename from pkg/plugins/plugincontext/plugincontext.go rename to pkg/services/pluginsintegration/plugincontext/plugincontext.go index d3de7223cf8..4b43561bace 100644 --- a/pkg/plugins/plugincontext/plugincontext.go +++ b/pkg/services/pluginsintegration/plugincontext/plugincontext.go @@ -11,10 +11,10 @@ import ( "github.com/grafana/grafana/pkg/infra/localcache" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/plugins/adapters" "github.com/grafana/grafana/pkg/plugins/log" "github.com/grafana/grafana/pkg/services/datasources" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/user" ) diff --git a/pkg/services/pluginsettings/fake.go b/pkg/services/pluginsintegration/pluginsettings/fake.go similarity index 100% rename from pkg/services/pluginsettings/fake.go rename to pkg/services/pluginsintegration/pluginsettings/fake.go diff --git a/pkg/services/pluginsettings/models.go b/pkg/services/pluginsintegration/pluginsettings/models.go similarity index 100% rename from pkg/services/pluginsettings/models.go rename to pkg/services/pluginsintegration/pluginsettings/models.go diff --git a/pkg/services/pluginsettings/pluginsettings.go b/pkg/services/pluginsintegration/pluginsettings/pluginsettings.go similarity index 100% rename from pkg/services/pluginsettings/pluginsettings.go rename to pkg/services/pluginsintegration/pluginsettings/pluginsettings.go diff --git a/pkg/services/pluginsettings/service/service.go b/pkg/services/pluginsintegration/pluginsettings/service/service.go similarity index 98% rename from pkg/services/pluginsettings/service/service.go rename to pkg/services/pluginsintegration/pluginsettings/service/service.go index 8c898822da8..4eb86796c9b 100644 --- a/pkg/services/pluginsettings/service/service.go +++ b/pkg/services/pluginsintegration/pluginsettings/service/service.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/secrets" ) diff --git a/pkg/services/pluginsettings/service/service_test.go b/pkg/services/pluginsintegration/pluginsettings/service/service_test.go similarity index 99% rename from pkg/services/pluginsettings/service/service_test.go rename to pkg/services/pluginsintegration/pluginsettings/service/service_test.go index 35b6cd1fe75..10471bde756 100644 --- a/pkg/services/pluginsettings/service/service_test.go +++ b/pkg/services/pluginsintegration/pluginsettings/service/service_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/grafana/pkg/infra/db" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/services/secrets/fakes" secretsManager "github.com/grafana/grafana/pkg/services/secrets/manager" diff --git a/pkg/services/pluginsintegration/pluginsintegration.go b/pkg/services/pluginsintegration/pluginsintegration.go index fa1f53c2056..7dda1f942f4 100644 --- a/pkg/services/pluginsintegration/pluginsintegration.go +++ b/pkg/services/pluginsintegration/pluginsintegration.go @@ -16,11 +16,13 @@ import ( "github.com/grafana/grafana/pkg/plugins/manager/signature" "github.com/grafana/grafana/pkg/plugins/manager/sources" "github.com/grafana/grafana/pkg/plugins/manager/store" - "github.com/grafana/grafana/pkg/plugins/plugincontext" "github.com/grafana/grafana/pkg/plugins/pluginscdn" "github.com/grafana/grafana/pkg/plugins/repo" "github.com/grafana/grafana/pkg/services/oauthtoken" "github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware" + "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" + pluginSettings "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings/service" "github.com/grafana/grafana/pkg/setting" ) @@ -53,6 +55,8 @@ var WireSet = wire.NewSet( wire.Bind(new(plugins.Licensing), new(*licensing.Service)), wire.Bind(new(sources.Resolver), new(*sources.Service)), sources.ProvideService, + pluginSettings.ProvideService, + wire.Bind(new(pluginsettings.Service), new(*pluginSettings.Service)), ) // WireExtensionSet provides a wire.ProviderSet of plugin providers that can be diff --git a/pkg/services/provisioning/plugins/plugin_provisioner.go b/pkg/services/provisioning/plugins/plugin_provisioner.go index c154603eb0c..41c63bd8edf 100644 --- a/pkg/services/provisioning/plugins/plugin_provisioner.go +++ b/pkg/services/provisioning/plugins/plugin_provisioner.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" ) // Provision scans a directory for provisioning config files diff --git a/pkg/services/provisioning/plugins/plugin_provisioner_test.go b/pkg/services/provisioning/plugins/plugin_provisioner_test.go index b805756a048..f63bdcfba8c 100644 --- a/pkg/services/provisioning/plugins/plugin_provisioner_test.go +++ b/pkg/services/provisioning/plugins/plugin_provisioner_test.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/org/orgtest" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" ) func TestPluginProvisioner(t *testing.T) { diff --git a/pkg/services/provisioning/provisioning.go b/pkg/services/provisioning/provisioning.go index 9f7bff61917..6496c9bbb90 100644 --- a/pkg/services/provisioning/provisioning.go +++ b/pkg/services/provisioning/provisioning.go @@ -21,7 +21,7 @@ import ( "github.com/grafana/grafana/pkg/services/ngalert/store" "github.com/grafana/grafana/pkg/services/notifications" "github.com/grafana/grafana/pkg/services/org" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" prov_alerting "github.com/grafana/grafana/pkg/services/provisioning/alerting" "github.com/grafana/grafana/pkg/services/provisioning/dashboards" "github.com/grafana/grafana/pkg/services/provisioning/datasources" diff --git a/pkg/services/query/query.go b/pkg/services/query/query.go index bdbf99dfd79..426843d3ca2 100644 --- a/pkg/services/query/query.go +++ b/pkg/services/query/query.go @@ -13,8 +13,8 @@ import ( "github.com/grafana/grafana/pkg/expr" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/plugins/adapters" "github.com/grafana/grafana/pkg/services/datasources" + "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/validations" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/services/supportbundles/supportbundlesimpl/collectors.go b/pkg/services/supportbundles/supportbundlesimpl/collectors.go index 961933708d1..e5d2346a211 100644 --- a/pkg/services/supportbundles/supportbundlesimpl/collectors.go +++ b/pkg/services/supportbundles/supportbundlesimpl/collectors.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/supportbundles" "github.com/grafana/grafana/pkg/setting" ) diff --git a/pkg/services/supportbundles/supportbundlesimpl/service.go b/pkg/services/supportbundles/supportbundlesimpl/service.go index 54bb5f28b84..1bb71575fd3 100644 --- a/pkg/services/supportbundles/supportbundlesimpl/service.go +++ b/pkg/services/supportbundles/supportbundlesimpl/service.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/grafana/pkg/plugins" ac "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/featuremgmt" - "github.com/grafana/grafana/pkg/services/pluginsettings" + "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings" "github.com/grafana/grafana/pkg/services/supportbundles" "github.com/grafana/grafana/pkg/services/supportbundles/bundleregistry" "github.com/grafana/grafana/pkg/services/user" diff --git a/pkg/tsdb/legacydata/service/service.go b/pkg/tsdb/legacydata/service/service.go index edd998632f4..df6a4f39468 100644 --- a/pkg/tsdb/legacydata/service/service.go +++ b/pkg/tsdb/legacydata/service/service.go @@ -7,9 +7,9 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana/pkg/plugins" - "github.com/grafana/grafana/pkg/plugins/adapters" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/oauthtoken" + "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters" "github.com/grafana/grafana/pkg/tsdb/legacydata" )