codegen: remove CLI flags and provide error on their usage#1278
Merged
codegen: remove CLI flags and provide error on their usage#1278
Conversation
amalavet
commented
Mar 5, 2026
Comment on lines
-74
to
-86
| - name: Generate code (backwards compatibility) | ||
| run: | | ||
| cd codegen-tests | ||
| # NOTE: These four are here for backwards compatibility testing using now deprecated cli flags | ||
| grafana-app-sdk generate --grouping=kind --gogenpath=pkg/gen1 --tsgenpath=ts/gen1 --gomodgenpath="pkg/generated" --defencoding=json --manifest=customManifest --crdmanifest | ||
| grafana-app-sdk generate --grouping=kind --gogenpath=pkg/gen1 --tsgenpath=ts/gen1 --gomodgenpath="pkg/generated" --defencoding=json --manifest=testManifest --crdmanifest | ||
| grafana-app-sdk generate --grouping=group --gogenpath=pkg/gen2 --tsgenpath=ts/gen2 --gomodgenpath="pkg/generated" --defencoding=yaml --manifest=customManifest --crdmanifest | ||
| grafana-app-sdk generate --grouping=group --gogenpath=pkg/gen2 --tsgenpath=ts/gen2 --gomodgenpath="pkg/generated" --defencoding=yaml --manifest=testManifest --crdmanifest | ||
| sed -i 's/codegen\-tests\/pkg\/gen2/codegen\-tests\/pkg\/generated/g' pkg/gen2/manifestdata/*.go | ||
| diff pkg/gen1/customkind cmp/go/groupbykind/customkind > diff.txt | ||
| sed -i '/^Common subdirectories/d' diff.txt | ||
| difflines=$(wc -l diff.txt | awk '{ print $1 }') | ||
| echo "GoGroupByKindDiff=${difflines}" >> $GITHUB_ENV |
Contributor
Author
There was a problem hiding this comment.
this test was just here as a backwards compatibility sanity check for the CLI flags still working
Contributor
Author
There was a problem hiding this comment.
below is the up to date test which relies on cue configs
IfSentient
approved these changes
Mar 9, 2026
Contributor
IfSentient
left a comment
There was a problem hiding this comment.
Approved with a couple of small changes to the docs on the CUE
IfSentient
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed? Why?
Removes the CLI flags that have been replaced with a config cue block. If someone attempts to use the flags, they will get an error like below:
grafana-app-sdk generate --grouping=kind --gogenpath=pkg/gen1 --tsgenpath=ts/gen1 --gomodgenpath="pkg/generated" --defencoding=json --manifest=customManifest --crdmanifestHow was it tested?
Unit, integration tests pass, no change to existing generated code.