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

reject mismatched corepack and detected package managers #11603

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

EndangeredMassa
Copy link
Contributor

@EndangeredMassa EndangeredMassa commented May 15, 2024

When corepack is used and the package manager or version does not match the inferred package manager or version from the lockfile, we should throw an error. Right now, this can happen with pnpm (for example) where pnpm only logs a warning, causing indeterministic builds.

This PR mostly updates getPathOverrideForPackageManager to not care about corepack, allowing the calling code to compare the detected values to the corepack values.

Copy link

changeset-bot bot commented May 15, 2024

🦋 Changeset detected

Latest commit: 5a1aa63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@vercel/build-utils Patch
vercel Patch
@vercel/client Patch
@vercel/gatsby-plugin-vercel-builder Patch
@vercel/node Patch
@vercel/static-build Patch
@vercel-internals/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@EndangeredMassa EndangeredMassa marked this pull request as ready for review May 15, 2024 22:12
trek
trek previously approved these changes May 15, 2024
trek
trek previously approved these changes May 29, 2024
args: {
cliType: 'pnpm',
nodeVersion: { major: 16, range: '16.x', runtime: 'nodejs16.x' },
packageJsonPackageManager: 'pnpm@7.x',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (blocking): change test setup

The packageJsonPackageManager value is only used if corepack is enabled. Because corepack is not enabled for this test, the lockfile is used to determine the pnpm version, which would be pnpm@6 in this case. The test description here implies it would be pnpm@7.

This test is currently testing that having a packageJsonPackageManager doesn't change the result, which is also a useful test, but doesn't match the description.

I think we should walk through these tests together to make sure we testing the different conditions we need.‏

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
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.

None yet

4 participants