Skip to content

Distinguish ghost packages from ghost package versions in improver reports - #2494

Open
Prachi194agrawal wants to merge 1 commit into
aboutcode-org:mainfrom
Prachi194agrawal:fix/2355-distinguish-ghost-packages
Open

Prachi194agrawal wants to merge 1 commit into
aboutcode-org:mainfrom
Prachi194agrawal:fix/2355-distinguish-ghost-packages

Conversation

@Prachi194agrawal

Copy link
Copy Markdown

Fixes #2355

The v2 ghost-package improver currently reports missing packages and missing versions under the same label. This change introduces separate counts and log messages so these cases can be distinguished.

  • Report a missing package once per base PURL when a registry lookup returns HTTP 404 before yielding any versions, excluding ambiguous Go and GitHub lookups.
  • Report missing versions individually for PurlDB verification.
  • Avoid interpreting an empty release list as proof that the package itself is missing.
  • Preserve existing flags when lookups fail or return incomplete results.
  • Avoid classifying unversioned entries as ghost versions, and clear previous ghost flags when a version is found upstream.

Both missing packages and missing versions retain is_ghost=True so unavailable versions remain excluded from suggested fixes. The distinction is recorded in pipeline logs and counts; this change does not add persistent classification fields or submit verification requests to PurlDB.

Adds regression coverage for separate reporting, empty release lists, unversioned packages, version-prefix normalization, lookup failures, and ambiguous or partial HTTP 404 responses.

Validation

venv/bin/python -m pytest \
  vulnerabilities/tests/pipelines/v2_improvers/test_flag_ghost_packages_v2.py \
  vulnerabilities/tests/pipelines/test_flag_ghost_packages.py \
  --reuse-db -q

Result: 25 passed, 7 warnings.
Screenshot from 2026-11-11 22-32-27

Fixes aboutcode-org#2355

Signed-off-by: Prachi Agrawal <prachi194agrawal@gmail.com>

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.

Ensure improver reports a ghost package and a ghost package version differently

1 participant