Plugins: Add inititialization stage to plugin loader pipeline (#72667)

* first pass

* migrate tests

* simplify

* fix comments

* fix linter

* nil checks

* remove comment
This commit is contained in:
Will Browne
2023-08-02 18:29:12 +02:00
committed by GitHub
parent 77e7ae2a1b
commit ad2705fa0b
17 changed files with 1809 additions and 1166 deletions

View File

@ -11,12 +11,13 @@ import (
"github.com/grafana/grafana/pkg/plugins/manager"
"github.com/grafana/grafana/pkg/plugins/manager/client"
"github.com/grafana/grafana/pkg/plugins/manager/filestore"
"github.com/grafana/grafana/pkg/plugins/manager/loader"
pluginLoader "github.com/grafana/grafana/pkg/plugins/manager/loader"
pAngularInspector "github.com/grafana/grafana/pkg/plugins/manager/loader/angular/angularinspector"
"github.com/grafana/grafana/pkg/plugins/manager/loader/assetpath"
"github.com/grafana/grafana/pkg/plugins/manager/loader/finder"
"github.com/grafana/grafana/pkg/plugins/manager/pipeline/bootstrap"
"github.com/grafana/grafana/pkg/plugins/manager/pipeline/discovery"
"github.com/grafana/grafana/pkg/plugins/manager/pipeline/initialization"
"github.com/grafana/grafana/pkg/plugins/manager/process"
"github.com/grafana/grafana/pkg/plugins/manager/registry"
"github.com/grafana/grafana/pkg/plugins/manager/signature"
@ -37,6 +38,7 @@ import (
"github.com/grafana/grafana/pkg/services/pluginsintegration/keyretriever/dynamic"
"github.com/grafana/grafana/pkg/services/pluginsintegration/keystore"
"github.com/grafana/grafana/pkg/services/pluginsintegration/licensing"
"github.com/grafana/grafana/pkg/services/pluginsintegration/loader"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pipeline"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
@ -65,6 +67,8 @@ var WireSet = wire.NewSet(
wire.Bind(new(discovery.Discoverer), new(*discovery.Discovery)),
pipeline.ProvideBootstrapStage,
wire.Bind(new(bootstrap.Bootstrapper), new(*bootstrap.Bootstrap)),
pipeline.ProvideInitializationStage,
wire.Bind(new(initialization.Initializer), new(*initialization.Initialize)),
angularpatternsstore.ProvideService,
angulardetectorsprovider.ProvideDynamic,
@ -72,7 +76,7 @@ var WireSet = wire.NewSet(
wire.Bind(new(pAngularInspector.Inspector), new(*angularinspector.Service)),
loader.ProvideService,
wire.Bind(new(loader.Service), new(*loader.Loader)),
wire.Bind(new(pluginLoader.Service), new(*loader.Loader)),
wire.Bind(new(plugins.ErrorResolver), new(*loader.Loader)),
manager.ProvideInstaller,
wire.Bind(new(plugins.Installer), new(*manager.PluginInstaller)),