-
Couldn't load subscription status.
- Fork 246
fix(vulnfeeds): Migrate to latest OSV schema bindings #4241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
/gemini summary |
|
Hello @cuixq, Thank you for submitting this pull request! I've reviewed the changes and generated a summary and a detailed review below. Pull Request SummaryThis pull request migrates the Key changes include:
This migration is essential for unblocking Code ReviewOverall, the changes in this pull request represent a thorough and well-executed migration to the new OSV schema bindings. The adoption of getter methods, General Feedback
No specific issues were found that require immediate action. The changes are primarily mechanical and correctly implemented to adapt to the new schema bindings. |
| cweList := make([]*structpb.Value, 0, len(cwes)) | ||
| for _, cwe := range cwes { | ||
| cweList = append(cweList, structpb.NewStringValue(cwe)) | ||
| } | ||
| v.DatabaseSpecific.Fields["cwe_ids"] = structpb.NewListValue(&structpb.ListValue{Values: cweList}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate this 😭 Are we going to have to do this for every field we want to add to database_specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably factor out to a helper function that takes the key and the list of strings to construct the struct, so we don't need to repeat this every time.
do we expect to see more variation of fields in database_specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be neater to call ds := v.DatabaseSpecific.AsMap() at the beginning, then v.DatabaseSpecific, err = structpb.NewStruct(ds) at the end of these functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, use NewValue(cwes) instead of NewXValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that at the very least I also want to add the programFiles info to database_specific
Unblocks #4190
This PR updates
vulnfeedsto use the latest version ofgithub.com/ossf/osv-schema/bindings/go.