Commit Graph

17 Commits

Author SHA1 Message Date
sam boyer
f8d79d301c
Rename Family to Panel in models.cue (#39111) 2021-09-12 14:34:33 -04:00
sam boyer
96473004db
Refactor dashboard scuemata to introduce composition slots, allow unspecified panels to validate, and re-enable devenv validation (#38727)
* Re-enable devenv dashboard validation

* Open up dashboard schema composition points

* Introduce composition space at front of scuemata

* Refactor go code to use new composition structure

* Bunch of small cleanups in dashboard.cue

* Enable both base and dist tests of devenv

* Get rid of obsolete CUE loading hacks

* Skip weird failures on these tests

Really don't seem to be testing for what we intend them to be testing
for.
2021-09-06 18:53:42 -04:00
Serge Zaitsev
643c7fa0cb
Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
Marcus Efraimsson
2f07af1b54
Chore: Skip test TestDevenvDashboardValidity for now (#38577)
Skipping TestDevenvDashboardValidity test for now to resolve broken 
test-backend step in main/branches. Did also run scripts/stripnulls.sh 
hence the devenv dashboard changes.
2021-08-26 11:45:57 +02:00
sam boyer
e61bc33163
Move dashboard scuemata to grafana-schema (#38470)
* Relocate dashboard scuemata to grafana-schema

* Update assorted tests, vars with dashboard path

* Remove crufty commented var

* Not sure...why that failed

* Remove prefix from base dashboard path var

* Move cue/ui remnants into grafana-schema

* Update import paths in plugin models

* Remove mudball, add package statements

* Remove cuegen.sh

Wooooo we ain't got no codegen

* Revert "Remove mudball, add package statements"

This reverts commit 9bed3098f1.

* Tidy up all the cue files

* Move dashboard scuemata into scuemata/ subdir

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-25 06:55:04 -04:00
sam boyer
6aba592741
Schema: get all devenv dashboards passing validation (#37857)
* Strip nulls (again)

* Add stripnulls script

* Add transformations field

* Close FieldConfig struct; proper plugin validating

* s/graph/viz/ field in histogram dashboard

* Use ui.GraphFieldConfig in histogram model

* Add models for stat, gauge, barguage panel plugins

Also toss necessary shared types into cue/ui/gen.cue, with TODOs to move
them appropriately later.

* Add required license headers

* Heap of updates to cue UI components

* Fix barchart types and one old devenv input

* Use the GraphFieldConfig directly for timeseries

* Add models.cue for a few panel plugins

Barchart, state-timeline, and status-history

* Enable the test validating all devenv dashboards!!

* Fix effects of not checking after making comments

* Update packages/grafana-ui/src/options/models.gen.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Realign and unalign cue with ts types

* Update devenv test to sniff for null errors

Best option we have right now for helping people to know they need to
strip nulls from devenv dashboards.

* Add speculative default for barchart stacking

* Fixup some dated devenv dashboards

timeline-modes needed to be regenerated with the appropriate tooltip
values included, per typing requirements, and timeline-demo needed to
have the `mode` field removed, as it is not intended to be persisted.

* Add necessary missing options for various panels

* Regenerate devenv dashboards

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-17 07:11:57 -04:00
Dimitris Sotirakis
2e0dc835cf
Scuemata: Add test to validate devenv resources (#35810)
* Add test for devenv resources

* Refactor validation tests for grokkability

* Devenv dashboards error-tracking script

* Refactor to use cueerrors.Details()

* Further test refinement

* Close major elements of dashboard schema

* Centralize dashboard validation tests

General dashboard validation testing belongs in the load package.

* Better names for error context on glue CUE code

* Fixup validate-resource

Do only one of base or dist, and fix copied docs.

* Skip the devenv test

* Remove test for validateResources

* Fix shellcheck

* Backend linter

Co-authored-by: sam boyer <sdboyer@grafana.com>
2021-07-15 20:08:03 -04:00
ying-jeanne
edf2029b52
[Scuemeta] Fix cue schema load on windows (#35185)
* fix the load basic schema

* fix windows unittest

* fix error return for get current path

* fix windows notation
2021-06-07 18:58:47 +08:00
Dimitris Sotirakis
4c8ce8a450
Scuemata: Checking json validity by enabling skipped tests (#34385)
* Make sure we don't skip any tests - refactoring

* Remove commented lines

* Move test folder
2021-06-04 08:18:03 +02:00
Dimitris Sotirakis
2b1e6c136f
Scuemata: Add error wrapper for CUE sanity errors (#33934)
* Add error wrapper for CUE sanity errors

* Fix error

* Fix linting

* Update test

* Update TestCueErrorWrapper assertions
2021-05-14 09:02:41 +02:00
ying-jeanne
a7ea0ca849
refactory to move trim/apply default into schema.go (#33754)
* refactory to move trim/apply default into schema.go

* fix comments

* move schema test outside of load folder
2021-05-12 15:38:00 +08:00
sam boyer
8fe7da5183
Models: Properly indicate Apache licensing of CUE files (#33960) 2021-05-11 21:44:57 -07:00
Dimitris Sotirakis
47af158ddb
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
2021-05-06 18:21:08 +02:00
ying-jeanne
22b2d3c38a
frontend for trim/apply defaults and some bug fixing (#33561)
* remove empty object and workaround on list

* frontend

* add toggle on frontend
2021-05-04 15:03:42 +08:00
sam boyer
806761fe70
Schema: Change Subsume check so optionality is respected (#33650) 2021-05-03 10:24:28 -07:00
ying-jeanne
748778fff0
new endpoint to post/get trimmed dashboard json (#33465)
* new endpoint to post/get trimed dashboard json

* add isdisabled check in dashboard.go
2021-04-28 19:38:33 +08:00
sam boyer
bba4d9bd7f
Introduce "scuemata" system for CUE-based specification of Grafana objects (#32527) 2021-04-08 01:11:11 -07:00