Scuemata: Add grafana-cli command to validate basic scuemata (#33523)

* Add grafana-cli command to validate basic scuemata

* Fix c/p outdated message

* Fix linting - naming

* Add basic testing

* Add cue schema validation

* Add tests

* Fix linting errors

* Remove code - refactored tests

* Remove unnecessary files - leftovers

* Fix linting

* Try adding public folder in testdata
This commit is contained in:
Dimitris Sotirakis
2021-05-06 18:21:08 +02:00
committed by GitHub
parent 03e91eb1a6
commit 47af158ddb
15 changed files with 787 additions and 0 deletions
+8
View File
@@ -8,6 +8,7 @@ import (
"cuelang.org/go/cue"
"cuelang.org/go/cue/load"
"github.com/grafana/grafana"
)
var rt = &cue.Runtime{}
@@ -39,6 +40,13 @@ type BaseLoadPaths struct {
InstanceCueFS fs.FS
}
func GetDefaultLoadPaths() BaseLoadPaths {
return BaseLoadPaths{
BaseCueFS: grafana.CoreSchema,
DistPluginCueFS: grafana.PluginSchema,
}
}
// toOverlay converts all .cue files in the fs.FS into Source entries in an
// overlay map, as expected by load.Config.
//