#32527 introduces the skeleton of the "scuemata" system for schematizing Grafana objects (primarily dashboards and their constituent parts to start). There's lots of work left to do before the whole system is actually mature enough to power Grafana 8. This epic is intended to enumerate the remaining work.
This doc contains background on the architecture of the system. As indicated in the original PR, the goal of the system is to create patterns for defining canonical schemas for Grafana config objects, such that those schema can be consumed for a variety of purposes across the three target languages - TypeScript, Go, and CUE.
The outstanding TODOs are broken down into some categories.
Automation
We need commands to perform some tasks automatically. Some of these need to work for plugin authors, as well.
Docs
We'd like to avoid much direct user-facing interaction with this system. A side effect of that would be that, at least for Grafana 8, this system ought not require a big user-facing section in our docs. But still, we need some things.
Backend
The backend is a, and initially the, key consumer of the system's Go API.
Frontend
The frontend will be insulated from details of families and lineages, dealing only with the most recent version of schemas.
CUE
Scuemata system
Verification
Most things above are assumed to include tests. This is more about systems for testing than individual tests themselves.
#32527 introduces the skeleton of the "scuemata" system for schematizing Grafana objects (primarily dashboards and their constituent parts to start). There's lots of work left to do before the whole system is actually mature enough to power Grafana 8. This epic is intended to enumerate the remaining work.
This doc contains background on the architecture of the system. As indicated in the original PR, the goal of the system is to create patterns for defining canonical schemas for Grafana config objects, such that those schema can be consumed for a variety of purposes across the three target languages - TypeScript, Go, and CUE.
The outstanding TODOs are broken down into some categories.
Automation
We need commands to perform some tasks automatically. Some of these need to work for plugin authors, as well.
cue fmtstep for catching syntax/format errors (git pre-commit hook)Docs
We'd like to avoid much direct user-facing interaction with this system. A side effect of that would be that, at least for Grafana 8, this system ought not require a big user-facing section in our docs. But still, we need some things.
models.cue/whatever files for plugin authors to followBackend
The backend is a, and initially the, key consumer of the system's Go API.
InstanceDashboardFamily()to accompany Base and Dist loader implementations (requires registry, plugin dir, etc.)Frontend
The frontend will be insulated from details of families and lineages, dealing only with the most recent version of schemas.
CUE
#PanelFamilyScuemata system
ApplyDefaults()(can it be a func instead of a method? 🙏)TrimDefaults()(can it be a func instead of a method? 🙏)Migrate()implementationsVerification
Most things above are assumed to include tests. This is more about systems for testing than individual tests themselves.