Skip to content

Preserve affected packages when OSV range has only introduced:0 (#2535) - #2543

Open
sumitkhond111-del wants to merge 1 commit into
aboutcode-org:mainfrom
sumitkhond111-del:fix-osv-v2-introduced-zero-2535
Open

sumitkhond111-del wants to merge 1 commit into
aboutcode-org:mainfrom
sumitkhond111-del:fix-osv-v2-introduced-zero-2535

Conversation

@sumitkhond111-del

Copy link
Copy Markdown

No description provided.

@sumitkhond111-del

Copy link
Copy Markdown
Author

Fixes #2535

Summary

  • Updated get_version_ranges_constraints() in vulnerabilities/pipes/osv_v2.py to retain introduced == "0" and emit VersionConstraint(comparator=">=", version=zero_intro_v_obj) (vers:<ecosystem>/>=0) when a range has no other affected constraints (no fixed, last_affected, or non-zero introduced events), preventing parse_advisory_data_v3() from dropping AffectedPackageV2 entries.
  • Preserved existing behavior when fixed or last_affected events are present.
  • Added test_parse_advisory_data_v3_introduced_zero_only in vulnerabilities/tests/pipes/test_osv_v2.py.

Testing

  • pytest vulnerabilities/tests/pipes/test_osv_v2.py -q → 19 passed.

This branch has not been deployed

No deployments
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.

1 participant