Plugins: Hide version information when plugin is managed (#88065)

* first pass

* fixup

* fix linter issues

* fix API test

* update naming

* rework

* update var name

* empty check

* prettier

* fix test

* fix lint
This commit is contained in:
Will Browne
2024-07-29 11:18:43 +01:00
committed by GitHub
parent e2ee7f06eb
commit 1b3fa8c47f
22 changed files with 108 additions and 20 deletions

View File

@@ -12,12 +12,12 @@ import (
"strings"
"testing"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/log/logtest"
@@ -39,6 +39,7 @@ import (
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/org/orgtest"
"github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginerrs"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
@@ -99,6 +100,7 @@ func Test_PluginsInstallAndUninstall(t *testing.T) {
ID: pluginID,
},
})
hs.managedPluginsService = managedplugins.NewNoop()
expectedIdentity := &authn.Identity{
OrgID: tc.permissionOrg,
@@ -641,6 +643,7 @@ func Test_PluginsList_AccessControl(t *testing.T) {
hs.PluginSettings = &pluginSettings
hs.pluginStore = pluginstore.New(pluginRegistry, &fakes.FakeLoader{})
hs.pluginFileStore = filestore.ProvideService(pluginRegistry)
hs.managedPluginsService = managedplugins.NewNoop()
var err error
hs.pluginsUpdateChecker, err = updatechecker.ProvidePluginsService(hs.Cfg, nil, tracing.InitializeTracerForTest())
require.NoError(t, err)