Skip to content

refactor: migrate vulnerability and license matching end-to-end to scalibr#2935

Open
another-rex wants to merge 3 commits into
google:mainfrom
another-rex:migrate-scalibr-e2e
Open

refactor: migrate vulnerability and license matching end-to-end to scalibr#2935
another-rex wants to merge 3 commits into
google:mainfrom
another-rex:migrate-scalibr-e2e

Conversation

@another-rex

Copy link
Copy Markdown
Collaborator

This PR migrates scanning, filtering, and matching in osv-scanner to use osv-scalibr end-to-end:

  • Matching Offloaded to Scalibr Enrichers: Removed legacy vulnerability and license matchers from osv-scanner, delegating them to osv-scalibr enrichers.
  • Filtering Annotator Plugin: Implemented package filtering as a scalibr annotator plugin (osv-scanner/filter) to handle unscannable packages, container-specific package exclusions, and ignore rules.
  • Client Factories: Introduced ClientFactories implementing scalibrconfig.ClientFactories to inject User-Agent headers and pool client connections.
  • PURL Type Resolution: Updated osvscannerjson extractor to map ecosystem names to valid PURL types (golang, gem, cargo, npm, etc.).
  • Model & Utility Cleanups: Cleaned up imodels package and muffled asynchronous database loading logs in testlogger.

agy

Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
Comment thread cmd/osv-scanner/internal/testcmd/vcr.go Fixed
…alibr

This change completes the migration to use osv-scalibr end-to-end for scanning, filtering, and matching:
- Remove vulnerability and license matchers from osv-scanner, delegating them to scalibr enrichers.
- Move package filtering to a scalibr annotator plugin (osv-scanner/filter).
- Implement scalibr ClientFactories for HTTP client and gRPC connection management.
- Update osvscannerjson extractor to map ecosystem names to valid PURL types.
- Clean up imodels and test logger handlers.

agy
@another-rex another-rex reopened this Jul 23, 2026
Update VCR recorder rules in testcmd to exclude binary file extensions (.zip, .gz, .db, etc.) from being recorded into cassettes, and update test snapshots accordingly.

agy
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.56034% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.24%. Comparing base (83c195f) to head (eb0e391).

Files with missing lines Patch % Lines
cmd/osv-scanner/internal/testcmd/vcr.go 29.41% 12 Missing ⚠️
...brextract/language/osv/osvscannerjson/extractor.go 52.00% 12 Missing ⚠️
internal/scalibr/client_factories.go 78.00% 6 Missing and 5 partials ⚠️
pkg/osvscanner/scan.go 91.73% 9 Missing and 1 partial ⚠️
pkg/osvscanner/osvscanner.go 84.48% 7 Missing and 2 partials ⚠️
internal/scalibrannotator/filter/filter.go 94.04% 4 Missing and 1 partial ⚠️
internal/scalibrplugin/presets.go 20.00% 3 Missing and 1 partial ⚠️
cmd/osv-scanner/fix/command.go 93.10% 1 Missing and 1 partial ⚠️
cmd/osv-scanner/mcp/command.go 0.00% 1 Missing ⚠️
internal/testlogger/handler.go 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2935      +/-   ##
==========================================
+ Coverage   78.82%   79.24%   +0.41%     
==========================================
  Files         122      118       -4     
  Lines        8360     8051     -309     
==========================================
- Hits         6590     6380     -210     
+ Misses       1383     1312      -71     
+ Partials      387      359      -28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants