chore: remove unused feature flag (#74460)

This commit removes the validateDashboardsOnSave feature flag that is currently not in use.
Closes #70022
This commit is contained in:
Kristin Laemmert 2023-09-06 11:25:44 -04:00 committed by GitHub
parent 34a867b8dc
commit 6ce4af7840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 37 deletions

View File

@ -57,7 +57,6 @@ Some features are enabled by default. You can disable these feature by setting t
| `migrationLocking` | Lock database during migrations |
| `correlations` | Correlations page |
| `newDBLibrary` | Use jmoiron/sqlx rather than xorm for a few backend services |
| `validateDashboardsOnSave` | Validate dashboard JSON POSTed to api/dashboards/db |
| `autoMigrateOldPanels` | Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) |
| `disableAngular` | Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. |
| `grpcServer` | Run the GRPC server |

View File

@ -33,7 +33,6 @@ export interface FeatureToggles {
datasourceQueryMultiStatus?: boolean;
traceToMetrics?: boolean;
newDBLibrary?: boolean;
validateDashboardsOnSave?: boolean;
autoMigrateOldPanels?: boolean;
disableAngular?: boolean;
canvasPanelNesting?: boolean;

View File

@ -392,29 +392,6 @@ func (hs *HTTPServer) PostDashboard(c *contextmodel.ReqContext) response.Respons
if err := web.Bind(c.Req, &cmd); err != nil {
return response.Error(http.StatusBadRequest, "bad request data", err)
}
if hs.Features.IsEnabled(featuremgmt.FlagValidateDashboardsOnSave) {
kind := hs.Kinds.Dashboard()
dashbytes, err := cmd.Dashboard.Bytes()
if err != nil {
return response.Error(http.StatusBadRequest, "unable to parse dashboard", err)
}
// Ideally, coremodel validation calls would be integrated into the web
// framework. But this does the job for now.
schv, err := cmd.Dashboard.Get("schemaVersion").Int()
// Only try to validate if the schemaVersion is at least the handoff version
// (the minimum schemaVersion against which the dashboard schema is known to
// work), or if schemaVersion is absent (which will happen once the kind schema
// becomes canonical).
if err != nil || schv >= dashboard.HandoffSchemaVersion {
if _, _, err := kind.JSONValueMux(dashbytes); err != nil {
return response.Error(http.StatusBadRequest, "invalid dashboard json", err)
}
}
}
return hs.postDashboard(c, cmd)
}

View File

@ -104,13 +104,6 @@ var (
Stage: FeatureStagePublicPreview,
Owner: grafanaBackendPlatformSquad,
},
{
Name: "validateDashboardsOnSave",
Description: "Validate dashboard JSON POSTed to api/dashboards/db",
Stage: FeatureStagePublicPreview,
RequiresRestart: true,
Owner: grafanaAsCodeSquad,
},
{
Name: "autoMigrateOldPanels",
Description: "Migrate old angular panels to supported versions (graph, table-old, worldmap, etc)",

View File

@ -14,7 +14,6 @@ correlations,preview,@grafana/explore-squad,false,false,false,false
datasourceQueryMultiStatus,experimental,@grafana/plugins-platform-backend,false,false,false,false
traceToMetrics,experimental,@grafana/observability-traces-and-profiling,false,false,false,true
newDBLibrary,preview,@grafana/backend-platform,false,false,false,false
validateDashboardsOnSave,preview,@grafana/grafana-as-code,false,false,true,false
autoMigrateOldPanels,preview,@grafana/dataviz-squad,false,false,false,true
disableAngular,preview,@grafana/dataviz-squad,false,false,false,true
canvasPanelNesting,experimental,@grafana/dataviz-squad,false,false,false,true

1 Name Stage Owner requiresDevMode RequiresLicense RequiresRestart FrontendOnly
14 datasourceQueryMultiStatus experimental @grafana/plugins-platform-backend false false false false
15 traceToMetrics experimental @grafana/observability-traces-and-profiling false false false true
16 newDBLibrary preview @grafana/backend-platform false false false false
validateDashboardsOnSave preview @grafana/grafana-as-code false false true false
17 autoMigrateOldPanels preview @grafana/dataviz-squad false false false true
18 disableAngular preview @grafana/dataviz-squad false false false true
19 canvasPanelNesting experimental @grafana/dataviz-squad false false false true

View File

@ -67,10 +67,6 @@ const (
// Use jmoiron/sqlx rather than xorm for a few backend services
FlagNewDBLibrary = "newDBLibrary"
// FlagValidateDashboardsOnSave
// Validate dashboard JSON POSTed to api/dashboards/db
FlagValidateDashboardsOnSave = "validateDashboardsOnSave"
// FlagAutoMigrateOldPanels
// Migrate old angular panels to supported versions (graph, table-old, worldmap, etc)
FlagAutoMigrateOldPanels = "autoMigrateOldPanels"