refactor: Migrate to new OSV bindings#2328
Conversation
|
/gemini summary |
|
Thank you for the request! I've reviewed the pull request and generated a summary below. Pull Request SummaryThis pull request primarily focuses on migrating the codebase to use new bindings for the
These changes are essential for keeping the project aligned with the latest ReviewOverall, the changes in this pull request are a necessary and well-executed migration to the new Maintainability
Correctness
Efficiency
Testing
No critical or high-severity issues were found. The changes are primarily refactoring and dependency updates, which are well-handled. |
|
protojson output being unstable is so annoying :( |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2328 +/- ##
==========================================
- Coverage 68.03% 67.74% -0.29%
==========================================
Files 172 172
Lines 12835 13057 +222
==========================================
+ Hits 8732 8846 +114
- Misses 3434 3517 +83
- Partials 669 694 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
another-rex
left a comment
There was a problem hiding this comment.
Didn't go through every file, but spot checking looks good to me.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request migrates the codebase to the new OSV bindings, which is a significant and well-executed refactoring. The changes are consistent across the project, and the use of protojson for custom marshalling of osvschema.Vulnerability is a good approach. The updates to test data and helpers, including the use of protocmp, are also well done.
I've found a few potential issues, mostly related to safe access of nested fields in the new protobuf structures, which could lead to panics. I've also identified a pre-existing bug that could be fixed as part of this refactoring. My comments provide specific suggestions for these points.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a large refactoring to migrate to the new OSV bindings. The changes are extensive, touching many parts of the codebase to adapt to the new protobuf-based structures. The migration appears to be handled well, with updates to use getter methods, new constant types, and custom JSON marshaling for protobuf messages. I've found one potential bug in the logic for handling fixed versions that I've commented on. Overall, this is a solid effort to modernize the dependency bindings.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a significant refactoring to migrate the codebase to new OSV bindings. The changes are extensive but well-executed, consistently applying the new API across many files. Key changes include using getter methods for field access, adopting new enum types, handling pointer types for vulnerability data, and implementing custom JSON marshalling for protobuf messages. The test suite has been updated accordingly, including the use of protocmp for comparisons and refactoring test data. I've identified a minor improvement opportunity in a test data generation script to enhance readability, but overall, this is a solid and necessary migration.
Fixes #2314 and unblocks #2286
This PR migrates to the new OSV bindings
osv.dev/bindings/goandgithub.com/ossf/osv-schema/bindings/go:osvconstants.Ecosystemto improve separation of concerns.osv.dev/bindings/go/apifor batch queries and version determination.MarshalJSONandUnmarshalJSONmethods withprotojsonto correctly handle the serialization ofosvschema.Vulnerability.protocmp.Transformfor comparisons.