Skip to content

Fix #5467: Handle underscores in parenthesized pnpm lockfile dependency values - #5471

Open
shreyaagrawal788-dotcom wants to merge 1 commit into
aboutcode-org:developfrom
shreyaagrawal788-dotcom:fix-5467
Open

shreyaagrawal788-dotcom wants to merge 1 commit into
aboutcode-org:developfrom
shreyaagrawal788-dotcom:fix-5467

Conversation

@shreyaagrawal788-dotcom

Copy link
Copy Markdown

Fixes #5467

Summary of Changes

  • Updated BaseNpmHandler.update_dependencies_by_purl in src/packagedcode/npm.py to only split on _ when '(' is not present in the dependency metadata. This prevents ValueError crashes and truncated requirements on pnpm v6/v9 lockfiles containing underscores inside parenthesized peer dependencies (e.g., 7.3.0(@types/babel__core@7.20.5)) or patch_hash suffixes (e.g., 20.17.7(patch_hash=...)).
  • Added unit test test_update_dependencies_by_purl_pnpm_underscores in tests/packagedcode/test_npm.py covering both parenthesized v6/v9 values and underscore-separated v5 peer dependency values.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

…file dependency values

Signed-off-by: Shreya Agrawal <shreyaagrawal788@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.

pnpm-lock.yaml dependency values with underscores fail or give a truncated requirement

1 participant