feat: support cue exp gengotypes#125
Merged
eddie-knight merged 1 commit intoossf:mainfrom Apr 28, 2025
Merged
Conversation
289992b to
2d431ac
Compare
This PR adds comments and `@go` annotations to the schema so we can use [cue exp gengotypes](https://cuelang.org/docs/reference/command/cue-help-exp-gengotypes/) to generate the code in `ossf/si-tooling`. A Makefile is added and integrated in the CI workflow to ensure the cue schema and example files can be consistently validated by contributors and in CI. Signed-off-by: Travis Truman <trumant@gmail.com>
2d431ac to
997afbc
Compare
cue exp gengotypescue exp gengotypes
trumant
added a commit
to trumant/si-tooling
that referenced
this pull request
Apr 27, 2025
This PR updates the v2 go source to use the results of running `cue exp gengotypes` against the canonical schema in ossf/security-insights-spec Additional supporting changes added in this PR are: - Makefile for common CI/contributor tasks - replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml - CI workflows to run the tests The generated code here is based on the changes in ossf/security-insights#125 Signed-off-by: Travis Truman <trumant@gmail.com>
trumant
commented
Apr 27, 2025
| @@ -1,4 +1,5 @@ | |||
| //// Definitions //// | |||
| package security_insights_spec | |||
| @go("si") // this doesn't appropriately override the package name in the generated code currently due to a bug in cue | |||
Contributor
Author
There was a problem hiding this comment.
eddie-knight
approved these changes
Apr 28, 2025
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.
This PR adds
make cuegenwhich when run will produce output like> Generating types from cue schema ...and the filecue_types_gen.goAdditional tasks:
make lintcueandmake lintymlare added to ensure that contributors and CI are able to run the same linting processes easily inside and outside of GitHub Actions.