Skip to content

Fix #613: avoid selecting unrelated repositories as source repo#841

Open
Monal-Reddy wants to merge 3 commits intoaboutcode-org:mainfrom
Monal-Reddy:fix-unrelated-package-set
Open

Fix #613: avoid selecting unrelated repositories as source repo#841
Monal-Reddy wants to merge 3 commits intoaboutcode-org:mainfrom
Monal-Reddy:fix-unrelated-package-set

Conversation

@Monal-Reddy
Copy link
Contributor

@Monal-Reddy Monal-Reddy commented Mar 13, 2026

Fixes #613

Problem

When running the collect endpoint for npm package inherits@2.0.0, purldb incorrectly detected pkg:github/substack/node-browserify as the source repository.

This happens because repository URLs extracted from metadata, homepages, or descriptions may include unrelated GitHub links, which are then treated as valid source repositories.

Solution

Add a filter in get_source_repo() to prefer repository candidates whose repository name overlaps with the package name. If at least one such candidate exists, unrelated repositories are ignored. If none match, the original behavior is preserved.

…ce repo

Signed-off-by: Monal-Reddy <monalreddy001@gmail.com>
Signed-off-by: Monal-Reddy <monalreddy001@gmail.com>
Signed-off-by: Monal-Reddy <monalreddy001@gmail.com>
@Monal-Reddy
Copy link
Contributor Author

hey @JonoYang could you please review this when you find time, i will make the necessary changes

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.

Package sets can have unrelated packages

1 participant