Merged
Conversation
The getVulnsAtRef function was hitting the OSV API for every commit it checked, making vulns log and vulns exposure commands very slow (14s and 70s respectively). Now it uses the already-synced vulnerability data from the database via scanCached, reducing times to ~0.5s and ~2.5s.
Use versionless PURLs consistently for cache keys. The cache stores packages by versionless PURL (pkg:gem/rails) but lookups were using versioned PURLs (pkg:gem/rails@8.1.2), causing cache misses. Now uses purl.MakePURLString to construct versionless cache keys while keeping versioned PURLs in the SBOM output. SBOM generation now uses cached license data properly, dropping from ~21s to ~0.5s on subsequent runs.
713bb5b to
ecb5a9e
Compare
- purl v0.1.4: Map github-actions to githubactions PURL type - manifests v0.3.1: Generate correct PURLs for GitHub Actions Fixes #70
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.
Two performance fixes for commands that were hitting the network unnecessarily:
vulns log/exposure - The
getVulnsAtReffunction was hitting the OSV API for every commit it checked, even though we have synced vulnerability data. Now uses cached data viascanCached. Times on octobox (5236 commits):vulns log: 14.5s -> 0.5svulns exposure --all-time: 70s -> 2.5ssbom - Was hitting ecosyste.ms for all dependencies including github-actions and docker (which can't be enriched). Also had a PURL version mismatch between cache keys and lookups. Now: