Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manager/npm): use --config.ignore-scripts=true for pnpm dedupe #25210

Merged
merged 6 commits into from Oct 15, 2023

Conversation

liby
Copy link
Contributor

@liby liby commented Oct 14, 2023

Changes

  • Reverted the revert commit 3609cdd.
  • Adjusted the pnpm dedupe command to use --config.ignore-scripts=true to circumvent potential issues brought about by having to determine the pnpm version.

Context

The initial strategy was to employ semver.coerce to manage version ranges when verifying the pnpm version. The goal was to apply pnpm dedupe --ignore-scripts only for pnpm versions 8.8.0 and above, as lower versions would throw an error.

However, a new approach was discovered which allows for script ignoring during deduplication in all pnpm versions by using the --config.ignore-scripts=true flag with the pnpm dedupe command.

Not only does this prevent the aforementioned error in versions lower than 8.8.0, but it also ensures consistent behavior across different pnpm versions regarding script execution during the pnpm dedupe process.

This approach eliminates the need for additional checks to determine the pnpm version, reducing the potential for other issues that might arise from unhandled special cases. The inspiration for this solution came from a comment on a related pnpm GitHub issue.

Relevant Issues:

I have tested the changes in a separate repository to ensure the fix works as expected. The test repository can be found here: Test Repository.

Please let me know if there are any additional changes needed or if there's anything else I can do to assist.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@liby liby changed the title fix(manager/npm): handle version strings and re-apply pnpmDedupe ignore scripts fix(manager/npm): use --config.ignore-scripts=true for pnpm dedupe Oct 14, 2023
@liby liby requested a review from viceice October 14, 2023 21:37
@rarkins rarkins added this pull request to the merge queue Oct 15, 2023
Merged via the queue into renovatebot:main with commit 526ebe6 Oct 15, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.19.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@liby liby deleted the fix/pnpm-version-and-dedupe branch October 15, 2023 06:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants