api: Validate dashboards on save via coremodels, behind feature toggle (#48252)

* Add coremodelValidation feature flag

* coremodels: use stubs when feature flag is off

* api: validate dashboards on save

* Need pointer receiver for FeatureManager

* Update dashboard Go model

* Align doc comments

* Include CoremodelRegistry in test

* Wedge coremodel in on all test cases, ugh

* Ugh fix comment again

* Update pkg/framework/coremodel/staticregistry/provide.go

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Update Thema (and its deps) for better errs

* omg whitespace

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
This commit is contained in:
sam boyer
2022-05-22 02:44:12 +02:00
committed by GitHub
co-authored by Artur Wierzbicki
parent 03fe1435a0
commit a3402641d6
11 changed files with 111 additions and 15 deletions
+5 -4
View File
@@ -103,7 +103,7 @@ require (
go.opentelemetry.io/otel/trace v1.6.3
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29
golang.org/x/exp v0.0.0-20210220032938-85be41e4509f
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
@@ -153,7 +153,7 @@ require (
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/emicklei/proto v1.6.15 // indirect
github.com/emicklei/proto v1.10.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-kit/log v0.1.0
github.com/go-logfmt/logfmt v0.5.1 // indirect
@@ -211,7 +211,7 @@ require (
github.com/prometheus/exporter-toolkit v0.7.0 // indirect
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
@@ -247,7 +247,7 @@ require (
github.com/blugelabs/bluge v0.1.9
github.com/golang-migrate/migrate/v4 v4.7.0
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f
github.com/grafana/thema v0.0.0-20220413232647-fc54c169b508
github.com/grafana/thema v0.0.0-20220427204245-a557e8970249
go.etcd.io/etcd v3.3.25+incompatible
go.opentelemetry.io/contrib/propagators/jaeger v1.6.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.6.3
@@ -298,6 +298,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pierrec/lz4/v4 v4.1.8 // indirect