perf(local): exclude withdrawn advisories as part of checking if packages are affected#2219
Merged
another-rex merged 4 commits intogoogle:mainfrom Sep 5, 2025
Merged
Conversation
cuixq
approved these changes
Sep 4, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2219 +/- ##
==========================================
- Coverage 67.63% 67.55% -0.08%
==========================================
Files 170 170
Lines 16337 16338 +1
==========================================
- Hits 11049 11037 -12
- Misses 4609 4621 +12
- Partials 679 680 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
another-rex
approved these changes
Sep 5, 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.
Currently when doing local matching we remove withdrawn advisories before any further checks by building a dedicated new slice, which results in huge memory usage - see this comment for some profiles, but e.g. scanning our own
go.modtakes up 1.5gb of memory.I originally implemented it like this back in
osv-detectoras I found it interesting to include withdrawn advisories to review data quality and have their count in the output, but it's not worth this. I have actually since ended up optimizing this out of the detector anyway via G-Rath/osv-detector#216 which switched to using a map for vulnerabilities meaning I calculated the count differently, but for now this just brings over the change for fixing the memory issue.Resolves #2217