Skip to content

feat: use go types generated by cue exp gengotypes#21

Closed
trumant wants to merge 2 commits intoossf:mainfrom
trumant:use-generated-types
Closed

feat: use go types generated by cue exp gengotypes#21
trumant wants to merge 2 commits intoossf:mainfrom
trumant:use-generated-types

Conversation

@trumant
Copy link
Contributor

@trumant trumant commented 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

trumant added 2 commits April 9, 2025 12:02
This PR adds additional test coverage to the Read func and
verifies that the presence of `header.project-si-source` results
in the correct SI data overrides

Signed-off-by: Travis Truman <trumant@gmail.com>
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>

package si

type URL string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, somewhat unexpectedly...

Logs from running pvtr-github-repo with a replace to my local copy of this branch
evaluation_plans/osps/build_release/steps.go:180:3: cannot use si.Header.URL (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:181:3: cannot use si.Header.ProjectSISource (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:182:3: cannot use si.Project.Homepage (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:183:3: cannot use si.Project.Roadmap (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:184:3: cannot use si.Project.Funding (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:185:3: cannot use si.Project.Documentation.DetailedGuide (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:186:3: cannot use si.Project.Documentation.CodeOfConduct (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:187:3: cannot use si.Project.Documentation.QuickstartGuide (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:188:3: cannot use si.Project.Documentation.ReleaseProcess (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:189:3: cannot use si.Project.Documentation.SignatureVerification (variable of string type si.URL) as string value in array or slice literal
evaluation_plans/osps/build_release/steps.go:189:3: too many errors

I haven't yet investigated what needs done when importing the SI library after this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm - let me dig in there. Thanks for your review.

@trumant
Copy link
Contributor Author

trumant commented May 6, 2025

Closing in favor of #26

@trumant trumant closed this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants