mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 08:18:10 -05:00
schema: Generate Go and Typescript from Thema coremodels (#49193)
* Add go code generator for coremodels * Just generate the entire coremodel for now Maybe we'll need more flexibility as more coremodels are added, but for now this is fine. * Add note on type comment about stability, grodkit * Remove local replace directive for thema * Generate typescript from coremodel * Update pkg/coremodel/dashboard/addenda.go Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Update cuetsy to new release * Update thema to latest * Fix enum generation for FieldColorModeId * Put main generated object at the end of the file * Tweaks to generated Go output * Retweak back to var * Add generated coremodel test * Remove local replace statement again * Add Make target and call into cuetsy cmd from gen * Rename and comment linsrc for readability * Move key codegen bits into reusable package * Move body of cuetsifier into codegen pkg Also genericize the diffing output into reusable WriteDiffer. * Refactor coremodel generator to use WriteDiffer * Add gen-cue step to CI * Whip all the codegen automation into shape * Add simplistic coremodel canonicality controls * Remove erroneously committed test * Bump thema version * Remove dead code * Improve wording of non-canonicality comment Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
a641949a05
commit
be06d37a20
@@ -41,6 +41,7 @@ load(
|
||||
'upload_cdn_step',
|
||||
'validate_scuemata_step',
|
||||
'ensure_cuetsified_step',
|
||||
'verify_gen_cue_step',
|
||||
'test_a11y_frontend_step',
|
||||
'trigger_oss'
|
||||
)
|
||||
@@ -136,6 +137,7 @@ def get_steps(edition):
|
||||
build_plugins_step(edition=edition, sign=True),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
verify_gen_cue_step(),
|
||||
]
|
||||
integration_test_steps = [
|
||||
postgres_integration_tests_step(edition=edition, ver_mode=ver_mode),
|
||||
|
||||
@@ -31,6 +31,7 @@ load(
|
||||
'benchmark_ldap_step',
|
||||
'validate_scuemata_step',
|
||||
'ensure_cuetsified_step',
|
||||
'verify_gen_cue_step',
|
||||
'test_a11y_frontend_step',
|
||||
'enterprise_downstream_step',
|
||||
)
|
||||
@@ -126,6 +127,7 @@ def pr_pipelines(edition):
|
||||
build_plugins_step(edition=edition),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
verify_gen_cue_step(),
|
||||
]
|
||||
integration_test_steps = [
|
||||
postgres_integration_tests_step(edition=edition, ver_mode=ver_mode),
|
||||
|
||||
@@ -41,6 +41,7 @@ load(
|
||||
'upload_cdn_step',
|
||||
'validate_scuemata_step',
|
||||
'ensure_cuetsified_step',
|
||||
'verify_gen_cue_step',
|
||||
'publish_images_step',
|
||||
'trigger_oss'
|
||||
)
|
||||
@@ -183,6 +184,7 @@ def get_steps(edition, ver_mode):
|
||||
build_plugins_step(edition=edition, sign=True),
|
||||
validate_scuemata_step(),
|
||||
ensure_cuetsified_step(),
|
||||
verify_gen_cue_step(),
|
||||
]
|
||||
|
||||
integration_test_steps = [
|
||||
|
||||
@@ -1167,6 +1167,16 @@ def ensure_cuetsified_step():
|
||||
],
|
||||
}
|
||||
|
||||
def verify_gen_cue_step():
|
||||
return {
|
||||
'name': 'verify-gen-cue',
|
||||
'image': build_image,
|
||||
'commands': [
|
||||
'# It is required that code generated from Thema/CUE be committed and in sync with its inputs.',
|
||||
'# The following command will fail if running code generators produces any diff in output.',
|
||||
'CODEGEN_VERIFY=1 make gen-cue',
|
||||
],
|
||||
}
|
||||
|
||||
def end_to_end_tests_deps(edition):
|
||||
if disable_tests:
|
||||
|
||||
Reference in New Issue
Block a user