postgresql: change plugin id (#77444)

* postgres: change plugin id

* fixed cue file

* codeowners update

* fixed backend test
This commit is contained in:
Gábor Farkas 2023-11-13 08:49:26 +01:00 committed by GitHub
parent 675e946b40
commit 2d391c1bf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 21 additions and 18 deletions

4
.github/CODEOWNERS vendored
View File

@ -255,7 +255,7 @@
# BI backend code
/pkg/tsdb/mysql/ @grafana/oss-big-tent
/pkg/tsdb/postgres/ @grafana/oss-big-tent
/pkg/tsdb/grafana-postgresql-datasource/ @grafana/oss-big-tent
/pkg/tsdb/mssql/ @grafana/grafana-bi-squad
# Database migrations
@ -544,7 +544,7 @@ scripts/generate-icon-bundle.js @grafana/plugins-platform-frontend @grafana/graf
/public/app/plugins/datasource/mssql/ @grafana/grafana-bi-squad
/public/app/plugins/datasource/mysql/ @grafana/oss-big-tent
/public/app/plugins/datasource/opentsdb/ @grafana/observability-metrics
/public/app/plugins/datasource/postgres/ @grafana/oss-big-tent
/public/app/plugins/datasource/grafana-postgresql-datasource/ @grafana/oss-big-tent
/public/app/plugins/datasource/prometheus/ @grafana/observability-metrics
/public/app/plugins/datasource/cloud-monitoring/ @grafana/partner-datasources
/public/app/plugins/datasource/zipkin/ @grafana/observability-traces-and-profiling

View File

@ -149,7 +149,7 @@
},
{
"type": "changedfiles",
"matches": [ "public/app/plugins/datasource/postgres/**/*", "pkg/tsdb/postgres/**/*"],
"matches": [ "public/app/plugins/datasource/grafana-postgresql-datasource/**/*", "pkg/tsdb/grafana-postgresql-datasource/**/*"],
"action": "updateLabel",
"addLabel": "datasource/Postgres"
},

View File

@ -15,6 +15,7 @@ import (
cloudmonitoring "github.com/grafana/grafana/pkg/tsdb/cloud-monitoring"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch"
postgres "github.com/grafana/grafana/pkg/tsdb/grafana-postgresql-datasource"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads"
@ -25,7 +26,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/mysql"
"github.com/grafana/grafana/pkg/tsdb/opentsdb"
"github.com/grafana/grafana/pkg/tsdb/parca"
"github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo"
)
@ -42,7 +42,7 @@ const (
Prometheus = "prometheus"
Tempo = "tempo"
TestData = "grafana-testdata-datasource"
PostgreSQL = "postgres"
PostgreSQL = "grafana-postgresql-datasource"
MySQL = "mysql"
MSSQL = "mssql"
Grafana = "grafana"

View File

@ -39,6 +39,7 @@ func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin {
parsePluginOrPanic("public/app/plugins/datasource/dashboard", "dashboard", rt),
parsePluginOrPanic("public/app/plugins/datasource/elasticsearch", "elasticsearch", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana", "grafana", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana-postgresql-datasource", "grafana_postgresql_datasource", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana-pyroscope-datasource", "grafana_pyroscope_datasource", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana-testdata-datasource", "grafana_testdata_datasource", rt),
parsePluginOrPanic("public/app/plugins/datasource/graphite", "graphite", rt),
@ -47,7 +48,6 @@ func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin {
parsePluginOrPanic("public/app/plugins/datasource/mssql", "mssql", rt),
parsePluginOrPanic("public/app/plugins/datasource/mysql", "mysql", rt),
parsePluginOrPanic("public/app/plugins/datasource/parca", "parca", rt),
parsePluginOrPanic("public/app/plugins/datasource/postgres", "postgres", rt),
parsePluginOrPanic("public/app/plugins/datasource/prometheus", "prometheus", rt),
parsePluginOrPanic("public/app/plugins/datasource/tempo", "tempo", rt),
parsePluginOrPanic("public/app/plugins/datasource/zipkin", "zipkin", rt),

View File

@ -137,6 +137,8 @@ func ReadPluginJSON(reader io.Reader) (JSONData, error) {
fallthrough
case "grafana-testdata-datasource":
fallthrough
case "grafana-postgresql-datasource":
fallthrough
case "annolist":
fallthrough
case "debug":

View File

@ -156,6 +156,7 @@ import (
cloudmonitoring "github.com/grafana/grafana/pkg/tsdb/cloud-monitoring"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch"
postgres "github.com/grafana/grafana/pkg/tsdb/grafana-postgresql-datasource"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads"
@ -168,7 +169,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/mysql"
"github.com/grafana/grafana/pkg/tsdb/opentsdb"
"github.com/grafana/grafana/pkg/tsdb/parca"
"github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo"
)

View File

@ -23,7 +23,7 @@ const (
DS_TEMPO = "tempo"
DS_ZIPKIN = "zipkin"
DS_MYSQL = "mysql"
DS_POSTGRES = "postgres"
DS_POSTGRES = "grafana-postgresql-datasource"
DS_MSSQL = "mssql"
DS_ACCESS_DIRECT = "direct"
DS_ACCESS_PROXY = "proxy"

View File

@ -27,6 +27,7 @@ import (
cloudmonitoring "github.com/grafana/grafana/pkg/tsdb/cloud-monitoring"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch"
postgres "github.com/grafana/grafana/pkg/tsdb/grafana-postgresql-datasource"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads"
@ -37,7 +38,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/mysql"
"github.com/grafana/grafana/pkg/tsdb/opentsdb"
"github.com/grafana/grafana/pkg/tsdb/parca"
"github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo"
)
@ -185,7 +185,7 @@ func verifyCorePluginCatalogue(t *testing.T, ctx context.Context, ps *pluginstor
"prometheus": {},
"tempo": {},
"grafana-testdata-datasource": {},
"postgres": {},
"grafana-postgresql-datasource": {},
"mysql": {},
"mssql": {},
"grafana": {},

View File

@ -1292,7 +1292,7 @@
{
"name": "PostgreSQL",
"type": "datasource",
"id": "postgres",
"id": "grafana-postgresql-datasource",
"enabled": true,
"pinned": false,
"info": {
@ -1303,8 +1303,8 @@
"description": "Data source for PostgreSQL and compatible databases",
"links": null,
"logos": {
"small": "/public/app/plugins/datasource/postgres/img/postgresql_logo.svg",
"large": "/public/app/plugins/datasource/postgres/img/postgresql_logo.svg"
"small": "/public/app/plugins/datasource/grafana-postgresql-datasource/img/postgresql_logo.svg",
"large": "/public/app/plugins/datasource/grafana-postgresql-datasource/img/postgresql_logo.svg"
},
"build": {},
"screenshots": null,
@ -1318,7 +1318,7 @@
},
"latestVersion": "",
"hasUpdate": false,
"defaultNavUrl": "/plugins/postgres/",
"defaultNavUrl": "/plugins/grafana-postgresql-datasource/",
"category": "sql",
"state": "",
"signature": "internal",

View File

@ -166,7 +166,7 @@ func TestIntegrationGenerateConnectionString(t *testing.T) {
}
// To run this test, set runPostgresTests=true
// Or from the commandline: GRAFANA_TEST_DB=postgres go test -tags=integration -v ./pkg/tsdb/postgres
// Or from the commandline: GRAFANA_TEST_DB=postgres go test -tags=integration -v ./pkg/tsdb/grafana-postgresql-datasource
// The tests require a PostgreSQL db named grafanadstest and a user/password grafanatest/grafanatest!
// Use the docker/blocks/postgres_tests/docker-compose.yaml to spin up a
// preconfigured Postgres server suitable for running these tests.

View File

@ -22,7 +22,7 @@ const mixedPlugin = async () =>
const mysqlPlugin = async () =>
await import(/* webpackChunkName: "mysqlPlugin" */ 'app/plugins/datasource/mysql/module');
const postgresPlugin = async () =>
await import(/* webpackChunkName: "postgresPlugin" */ 'app/plugins/datasource/postgres/module');
await import(/* webpackChunkName: "postgresPlugin" */ 'app/plugins/datasource/grafana-postgresql-datasource/module');
const prometheusPlugin = async () =>
await import(/* webpackChunkName: "prometheusPlugin" */ 'app/plugins/datasource/prometheus/module');
const mssqlPlugin = async () =>
@ -94,7 +94,7 @@ const builtInPlugins: Record<string, System.Module | (() => Promise<System.Modul
'core:plugin/zipkin': zipkinPlugin,
'core:plugin/mixed': mixedPlugin,
'core:plugin/mysql': mysqlPlugin,
'core:plugin/postgres': postgresPlugin,
'core:plugin/grafana-postgresql-datasource': postgresPlugin,
'core:plugin/mssql': mssqlPlugin,
'core:plugin/prometheus': prometheusPlugin,
'core:plugin/grafana-testdata-datasource': testDataDSPlugin,

View File

@ -1,7 +1,8 @@
{
"type": "datasource",
"name": "PostgreSQL",
"id": "postgres",
"id": "grafana-postgresql-datasource",
"aliasIDs": ["postgres"],
"category": "sql",
"info": {