Skip to content

[rush] Use --prefer-frozen-lockfile in rush update (without --full) #2525

@dmichon-msft

Description

@dmichon-msft

Summary

When running rush update, I expect it to only change the lockfile if necessary to satisfy new constraints from rush.json, package.json, pnpmfile.js, or common-versions.json.

However, the current command runs pnpm install --no-prefer-frozen-lockfile, which is a bit more permissive of lockfile updates.

Repro steps

Pull latest main branch of a Rush monorepo, run rush update

Expected result:
No changes detected, lockfile remains the same and does equivalent of rush install

Actual result:
Updates made to pnpm-lock.yaml and repo-state.json

Details

Change --no-prefer-frozen-lockfile to --prefer-frozen-lockfile, at least for pnpm >= 5 on workspaces, or just behind an experiment/pnpm config setting.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.40.3
rushVersion from rush.json? 5.40.3
useWorkspaces from rush.json? true
Operating system? Linux
Would you consider contributing a PR? Yes
Node.js version (node -v)? 10.24.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions