the code generated from the schemas is slightly different from the code generated using input in grafana/grafana. It's probably related to differences in the schemas themselves, but we should look into it
Suggestions for next steps:
we review and merge this PR. It's safe to do so since the gen.go file hasn't been significantly changed.
we discuss improvements that can be made to the registry (especially for points 1 and 2)
we discuss and decide how to manage dependencies in CUE schemas and how grok can discover and load them (we don't want to hardcode every dependency that a schema can use)
This PR introduces a CLI to generate code (go, jsonschema, jsonnet) from CUE schemas stored in our
kind-registry
.The end goal is to replace the current
gen.go
file and generate everything using the registry instead of depending on grafana/grafana.While the CLI already can run the code generation process on core and composable kinds, there are a few issues:
package
directive, which generates interesting errors when loading them. We work around that by defining a package "in memory"Suggestions for next steps:
gen.go
file hasn't been significantly changed.