question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider requiring PRs to update pnpm-lock.yaml

See original GitHub issue

For background, there are 3 “levels” of the rush update command, which is used to update the pnpm-lock.yaml file:

  1. rush update: Only makes the minimum updates needed to satisfy the package.json files.
  2. rush update --recheck: Additional updates to ensure the pnpm-lock.yaml file is consistent with the package.json files.
  3. rush update --full: Updates all dependencies to the latest SemVer-compatible version.

rush update -full should be run in a dedicated PR to update all dependencies, so is unrelated to this issue.

This table summarizes the differences between rush update and rush update --recheck. Given a particular source change, is pnpm-lock.yaml updated?

rush update rush update --recheck
Add new dependency yes yes
Add existing dependency no yes
Remove dependency no yes

If a new dependency (not use by any other project) is added, both commands will update pnpm-lock.yaml. But if an existing dependency is added or a dependency is removed, then only rush update --recheck will update pnpm-lock.yaml. I believe this is by design and why both commands exist.

Our current workflow is that developers run rush update as part of any PR which might update pnpm-lock.yaml. If a PR adds an existing dependency or removes a dependency, this change will not be reflected in pnpm-lock.yaml until a later time, when another PR adds a new dependency or runs rush update --full.

A “stricter” alternative would be:

  1. Developers are expected to run rush update --recheck in any PR that might cause updates to pnpm-lock.yaml.
  2. Our pipelines will also run rush update --recheck, and fail if any changes were detected (meaning the PR was missing the changes).

The upside to the stricter version is that pnpm-lock.yaml changes should always be in the same PR as the code changes. The downside is pnpm-lock.yaml will be updated more often, and developers may need to re-submit more PRs with fixes.

I don’t think there is any impact on our shipping packages or validation either way.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xirzeccommented, Feb 2, 2021

Interesting thing I just discovered. Running rush update --recheck puts our node types up to 10.x, but rush update --full sets it back to 8.x. Not sure why that’s happening, but that could cause us not to want to use recheck in the short term.

0reactions
ramya-rao-acommented, Feb 3, 2021

@praveenkuttappan For completeness sake, we should document similar comparison between the --full and --recheck like how we did above between rush update and rush update --recheck

Regarding the pending issue you referred to, is that being tracked in a separate issue. If not, we can use this issue to do so

Read more comments on GitHub >

github_iconTop Results From Across the Web

pnpm install
pnpm install is used to install all dependencies for a project. In a CI environment, installation fails if a lockfile is present but...
Read more >
configuration-options.md - renovatebot/renovate - Sourcegraph
"Maintaining" a lock file means recreating it so that every dependency version within it is updated to the latest. Supported lock files are:...
Read more >
rushstack/rushstack - Gitter
My goal is to have developers run rush change on a PR, have that PR get merged ... Deleting /Users/gliba/src/tmp/kittik/common/config/rush/pnpm-lock.yaml ...
Read more >
Automating Dependency Updates in Practice: An Exploratory ...
One promising solution for this dilemma is to use bots to automate all dependency updates. Therefore, dependency management bots are invented to ...
Read more >
An Exploratory Study on GitHub Dependabot - arXiv
yml, such as which dependency to update or not update, update interval, the maximum number of simultaneous Dependabot PRs, etc. • Security Update...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found