Skip to content

Resolve CPAN downloads by author and release - #229

Open
tejasng053 wants to merge 1 commit into
aboutcode-org:masterfrom
tejasng053:fix/cpan-author-downloads-181
Open

tejasng053 wants to merge 1 commit into
aboutcode-org:masterfrom
tejasng053:fix/cpan-author-downloads-181

Conversation

@tejasng053

Copy link
Copy Markdown

What's changed?

The CPAN resolver sends the distribution and version as the two path segments of MetaCPAN's release endpoint. That endpoint expects the author and the full release name. For example, pkg:cpan/GDT/URI-PackageURL@2.22 should query /v1/release/GDT/URI-PackageURL-2.22.

Use the author from the PURL namespace or author qualifier and preserve the case of the distribution name. Read the archive URL from the release metadata and keep the existing .tar.gz and .zip checks under the same author's directory. The resolver returns no result for a module name or for a PURL that lacks the author or version needed for this lookup.

Related issue

Fixes #181

Verification

  • The focused CPAN and download routing tests passed (13 tests). The new cases cover both author forms, both observed metadata shapes, and fallback when the release is absent.
  • The live resolver returned the expected archive for URI-PackageURL@2.22 with both author forms and for DateTime@1.55 with its author namespace.
  • With network requests blocked, 159 tests passed. The same three tests made live requests on clean upstream ffbd683: one pub.dev test and two CocoaPods tests tracked in Some unit tests depends on external services #188.
  • The unrestricted suite reached the 55-second time limit without completing.
  • make check and git diff --check passed on Linux with Python 3.12.3.

Checklist

  • I understand the problem and implemented the solution using appropriate functions.
  • I added or updated tests to cover my changes.
  • I verified my changes by running linting, ensuring all local tests pass, and confirming that CI checks succeed.

The final checkbox remains open while upstream CI is unverified. Prepared with Codex assistance and reviewed before publication.

Fixes aboutcode-org#181

Signed-off-by: tejasng053 <tejasng053@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.

Adapt PURL download URL support for CPAN

1 participant