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

Unexpected interaction between --lockfile-only with --frozen-lockfile modifies the lockfile. #6913

Closed
Zemnmez opened this issue Aug 5, 2023 · 1 comment · Fixed by #6915
Assignees

Comments

@Zemnmez
Copy link

Zemnmez commented Aug 5, 2023

pnpm version:

9.8.0

Code to reproduce the issue:

pnpm i --frozen-lockfile --lockfile-only

Expected behavior:

PNPM checks the lockfile is in sync with package.json, but does not update it or node_modules.

Actual behavior:

PNPM updates the lockfile.

Additional information:

I have had issues in my repo where automation can change package.json but not pnpm-lock.yaml. It seemed the simplest way to test for this is to have PNPM check. pnpm i –frozen-lockfile does as I want but also does the work to populate node_modules, which I do not want. It seemed sensible that specifying --lockfile-only would remedy this, but in fact it then ignores --frozen-lockfile.

@Zemnmez Zemnmez changed the title Unexpected interaction between --frozen-lockfile and --lockfile-only Unexpected interaction between --lockfile-only with --frozen-lockfile modifies the lockfile. Aug 5, 2023
@zkochan zkochan self-assigned this Aug 5, 2023
@zkochan
Copy link
Member

zkochan commented Aug 6, 2023

I was fixing this issue, when this stopped working. I believe my PR should not bring back the --lockfile-only issue on CI as we have this code now:

frozenLockfileIfExists: isCI && !opts.lockfileOnly &&
typeof opts.rawLocalConfig['frozen-lockfile'] === 'undefined' &&
typeof opts.rawLocalConfig['prefer-frozen-lockfile'] === 'undefined',

Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Zemnmez added a commit to zemn-me/monorepo that referenced this issue Aug 18, 2023
…e lockfile is out of date)

Move pnpm test into presubmit (it breaks out of the sandbox)

Amend pnpm lock sync test accounting for upstream fix.

pnpm/pnpm#6913 (comment)



Revert all changes to package.json since lockfile test was broken.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants