mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 06:32:17 +08:00
Plugins Remove failWrongDSUID feature toggle (#107308)
* remove failWrongDSUID FT * undo go.mod changes
This commit is contained in:
@ -67,7 +67,6 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general-
|
|||||||
| `azureMonitorPrometheusExemplars` | Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars | Yes |
|
| `azureMonitorPrometheusExemplars` | Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars | Yes |
|
||||||
| `pinNavItems` | Enables pinning of nav items | Yes |
|
| `pinNavItems` | Enables pinning of nav items | Yes |
|
||||||
| `ssoSettingsLDAP` | Use the new SSO Settings API to configure LDAP | Yes |
|
| `ssoSettingsLDAP` | Use the new SSO Settings API to configure LDAP | Yes |
|
||||||
| `failWrongDSUID` | Throws an error if a data source has an invalid UIDs | Yes |
|
|
||||||
| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
|
| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
|
||||||
| `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture | Yes |
|
| `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture | Yes |
|
||||||
| `alertingQueryAndExpressionsStepMode` | Enables step mode for alerting queries and expressions | Yes |
|
| `alertingQueryAndExpressionsStepMode` | Enables step mode for alerting queries and expressions | Yes |
|
||||||
|
@ -610,11 +610,6 @@ export interface FeatureToggles {
|
|||||||
*/
|
*/
|
||||||
ssoSettingsLDAP?: boolean;
|
ssoSettingsLDAP?: boolean;
|
||||||
/**
|
/**
|
||||||
* Throws an error if a data source has an invalid UIDs
|
|
||||||
* @default true
|
|
||||||
*/
|
|
||||||
failWrongDSUID?: boolean;
|
|
||||||
/**
|
|
||||||
* Use openFGA as authorization engine.
|
* Use openFGA as authorization engine.
|
||||||
*/
|
*/
|
||||||
zanzana?: boolean;
|
zanzana?: boolean;
|
||||||
|
@ -252,9 +252,7 @@ func (ss *SqlStore) AddDataSource(ctx context.Context, cmd *datasources.AddDataS
|
|||||||
cmd.UID = uid
|
cmd.UID = uid
|
||||||
} else if err := util.ValidateUID(cmd.UID); err != nil {
|
} else if err := util.ValidateUID(cmd.UID); err != nil {
|
||||||
logDeprecatedInvalidDsUid(ss.logger, cmd.UID, cmd.Name, "create", err)
|
logDeprecatedInvalidDsUid(ss.logger, cmd.UID, cmd.Name, "create", err)
|
||||||
if ss.features != nil && ss.features.IsEnabled(ctx, featuremgmt.FlagFailWrongDSUID) {
|
return datasources.ErrDataSourceUIDInvalid.Errorf("invalid UID for datasource %s: %w", cmd.Name, err)
|
||||||
return datasources.ErrDataSourceUIDInvalid.Errorf("invalid UID for datasource %s: %w", cmd.Name, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ds = &datasources.DataSource{
|
ds = &datasources.DataSource{
|
||||||
@ -329,9 +327,7 @@ func (ss *SqlStore) UpdateDataSource(ctx context.Context, cmd *datasources.Updat
|
|||||||
if cmd.UID != "" {
|
if cmd.UID != "" {
|
||||||
if err := util.ValidateUID(cmd.UID); err != nil {
|
if err := util.ValidateUID(cmd.UID); err != nil {
|
||||||
logDeprecatedInvalidDsUid(ss.logger, cmd.UID, cmd.Name, "update", err)
|
logDeprecatedInvalidDsUid(ss.logger, cmd.UID, cmd.Name, "update", err)
|
||||||
if ss.features != nil && ss.features.IsEnabled(ctx, featuremgmt.FlagFailWrongDSUID) {
|
return datasources.ErrDataSourceUIDInvalid.Errorf("invalid UID for datasource %s: %w", cmd.Name, err)
|
||||||
return datasources.ErrDataSourceUIDInvalid.Errorf("invalid UID for datasource %s: %w", cmd.Name, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/infra/db"
|
"github.com/grafana/grafana/pkg/infra/db"
|
||||||
"github.com/grafana/grafana/pkg/infra/log"
|
"github.com/grafana/grafana/pkg/infra/log"
|
||||||
"github.com/grafana/grafana/pkg/services/datasources"
|
"github.com/grafana/grafana/pkg/services/datasources"
|
||||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIntegrationDataAccess(t *testing.T) {
|
func TestIntegrationDataAccess(t *testing.T) {
|
||||||
@ -102,9 +101,8 @@ func TestIntegrationDataAccess(t *testing.T) {
|
|||||||
t.Run("fails to create a datasource with an invalid uid", func(t *testing.T) {
|
t.Run("fails to create a datasource with an invalid uid", func(t *testing.T) {
|
||||||
db := db.InitTestDB(t)
|
db := db.InitTestDB(t)
|
||||||
ss := SqlStore{
|
ss := SqlStore{
|
||||||
db: db,
|
db: db,
|
||||||
logger: log.NewNopLogger(),
|
logger: log.NewNopLogger(),
|
||||||
features: featuremgmt.WithFeatures(featuremgmt.FlagFailWrongDSUID),
|
|
||||||
}
|
}
|
||||||
cmd := defaultAddDatasourceCommand
|
cmd := defaultAddDatasourceCommand
|
||||||
cmd.UID = "test/uid"
|
cmd.UID = "test/uid"
|
||||||
@ -236,9 +234,8 @@ func TestIntegrationDataAccess(t *testing.T) {
|
|||||||
db := db.InitTestDB(t)
|
db := db.InitTestDB(t)
|
||||||
ds := initDatasource(db)
|
ds := initDatasource(db)
|
||||||
ss := SqlStore{
|
ss := SqlStore{
|
||||||
db: db,
|
db: db,
|
||||||
logger: log.NewNopLogger(),
|
logger: log.NewNopLogger(),
|
||||||
features: featuremgmt.WithFeatures(featuremgmt.FlagFailWrongDSUID),
|
|
||||||
}
|
}
|
||||||
require.NotEmpty(t, ds.UID)
|
require.NotEmpty(t, ds.UID)
|
||||||
|
|
||||||
|
@ -1042,13 +1042,6 @@ var (
|
|||||||
RequiresRestart: true,
|
RequiresRestart: true,
|
||||||
Expression: "true", // enabled by default
|
Expression: "true", // enabled by default
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "failWrongDSUID",
|
|
||||||
Description: "Throws an error if a data source has an invalid UIDs",
|
|
||||||
Stage: FeatureStageGeneralAvailability,
|
|
||||||
Owner: grafanaPluginsPlatformSquad,
|
|
||||||
Expression: "true", // enabled by default
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "zanzana",
|
Name: "zanzana",
|
||||||
Description: "Use openFGA as authorization engine.",
|
Description: "Use openFGA as authorization engine.",
|
||||||
|
@ -135,7 +135,6 @@ azureMonitorPrometheusExemplars,GA,@grafana/partner-datasources,false,false,fals
|
|||||||
pinNavItems,GA,@grafana/grafana-frontend-platform,false,false,false
|
pinNavItems,GA,@grafana/grafana-frontend-platform,false,false,false
|
||||||
authZGRPCServer,experimental,@grafana/identity-access-team,false,false,false
|
authZGRPCServer,experimental,@grafana/identity-access-team,false,false,false
|
||||||
ssoSettingsLDAP,GA,@grafana/identity-access-team,false,true,false
|
ssoSettingsLDAP,GA,@grafana/identity-access-team,false,true,false
|
||||||
failWrongDSUID,GA,@grafana/plugins-platform-backend,false,false,false
|
|
||||||
zanzana,experimental,@grafana/identity-access-team,false,false,false
|
zanzana,experimental,@grafana/identity-access-team,false,false,false
|
||||||
reloadDashboardsOnParamsChange,experimental,@grafana/dashboards-squad,false,false,false
|
reloadDashboardsOnParamsChange,experimental,@grafana/dashboards-squad,false,false,false
|
||||||
enableScopesInMetricsExplore,experimental,@grafana/dashboards-squad,false,false,false
|
enableScopesInMetricsExplore,experimental,@grafana/dashboards-squad,false,false,false
|
||||||
|
|
@ -551,10 +551,6 @@ const (
|
|||||||
// Use the new SSO Settings API to configure LDAP
|
// Use the new SSO Settings API to configure LDAP
|
||||||
FlagSsoSettingsLDAP = "ssoSettingsLDAP"
|
FlagSsoSettingsLDAP = "ssoSettingsLDAP"
|
||||||
|
|
||||||
// FlagFailWrongDSUID
|
|
||||||
// Throws an error if a data source has an invalid UIDs
|
|
||||||
FlagFailWrongDSUID = "failWrongDSUID"
|
|
||||||
|
|
||||||
// FlagZanzana
|
// FlagZanzana
|
||||||
// Use openFGA as authorization engine.
|
// Use openFGA as authorization engine.
|
||||||
FlagZanzana = "zanzana"
|
FlagZanzana = "zanzana"
|
||||||
|
@ -1161,7 +1161,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "failWrongDSUID",
|
"name": "failWrongDSUID",
|
||||||
"resourceVersion": "1750434297879",
|
"resourceVersion": "1750434297879",
|
||||||
"creationTimestamp": "2024-06-20T10:56:39Z"
|
"creationTimestamp": "2024-06-20T10:56:39Z",
|
||||||
|
"deletionTimestamp": "2025-06-27T12:51:00Z"
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"description": "Throws an error if a data source has an invalid UIDs",
|
"description": "Throws an error if a data source has an invalid UIDs",
|
||||||
|
Reference in New Issue
Block a user