Skip to content

fix(vulnfeeds): use canonical URLs for repository comparison in GitVersionsToCommits - #5791

Open
jess-lowe wants to merge 5 commits into
google:masterfrom
jess-lowe:fix/canonical-link
Open

fix(vulnfeeds): use canonical URLs for repository comparison in GitVersionsToCommits#5791
jess-lowe wants to merge 5 commits into
google:masterfrom
jess-lowe:fix/canonical-link

Conversation

@jess-lowe

Copy link
Copy Markdown
Contributor

Should help fix: #4489

Fixes an issue where repository redirects (e.g., facebook/react -> react/react) caused version ranges to remain unresolved.

Previously, GitVersionsToCommits compared raw repository URLs from version ranges against candidate repositories. If a range used a non-canonical URL (e.g., sourced from the CPE dictionary) but the candidate list used the canonicalized URL (or vice versa), the comparison would fail, leaving the range unresolved.

Changes

  • Updated GitVersionsToCommits to canonicalize repository URLs before populating claimedRepos and before comparing ranges with candidate repositories.
  • Introduced a local in-function cache to minimize redundant external lookups (e.g., Redis or network calls) for the same repository URL during a single invocation.

@jess-lowe
jess-lowe requested review from a team and michaelkedar August 6, 2026 01:05
another-rex
another-rex previously approved these changes Aug 6, 2026

@another-rex another-rex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use redis

Comment thread vulnfeeds/conversion/common.go Outdated
Comment thread vulnfeeds/conversion/common.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants