Skip to content

feat: run the pnpm self-update before the dependency update - #4

Merged
zkochan merged 1 commit into
mainfrom
self-update-first
Jul 30, 2026
Merged

feat: run the pnpm self-update before the dependency update#4
zkochan merged 1 commit into
mainfrom
self-update-first

Conversation

@zkochan

@zkochan zkochan commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

Moves the pnpm self-update step from the end of update.sh to the beginning. Once the pin is bumped, every later pnpm invocation delegates to the freshly pinned version via the package-manager check, so the runtime bump, the dependency update, and the resulting lockfile are all produced by the pnpm version the pull request moves the repository onto — rather than the old version writing a lockfile that the new pin then has to reinterpret on the PR's CI.

The update-pnpm-minimum-release-age override changes from an export to a per-invocation env prefix: it previously relied on self-update being the last step for its scoping, and it must not leak into the dependency update (which keeps the repository's own release-age settings).

Testing

  • bats test/ — 32 tests pass, including a new one asserting self-update precedes update --recursive in the invocation log, and the existing scoping test confirming PNPM_CONFIG_MINIMUM_RELEASE_AGE reaches only the self-update invocation.

Written by an agent (Claude Code, claude-fable-5).

Updating the pin first means every later pnpm invocation delegates to
the freshly pinned version through the package-manager check, so the
runtime bump, the dependency update, and the lockfile in the pull
request are all produced by the pnpm version the PR moves the
repository onto — instead of the old version writing a lockfile that
the new pin then has to reinterpret.

The release-age override moves from an export to a per-invocation env
prefix: it previously relied on self-update being the last step for its
scoping, and it must not leak into the dependency update, which keeps
the repository's own release-age settings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zkochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63a26686-a2dd-4a83-972c-902e896b7a41

📥 Commits

Reviewing files that changed from the base of the PR and between 9a25617 and 3f727de.

📒 Files selected for processing (4)
  • README.md
  • action.yml
  • scripts/update.sh
  • test/update.bats

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Run pnpm self-update before dependency updates

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Run pnpm self-update before runtime/dependency updates to ensure consistent lockfile generation.
• Scope PNPM_CONFIG_MINIMUM_RELEASE_AGE to self-update only, avoiding leakage into dependency
 updates.
• Add/adjust docs and tests to enforce ordering and env scoping behavior.
Diagram

graph TD
  A["GitHub Action inputs"] --> B["scripts/update.sh"] --> C["pnpm self-update"] --> D["Set Node runtime"] --> E["pnpm update/install"] --> F[("pnpm-lock.yaml")]
  B --> G{"UPDATE_PNPM != false"} --> C
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use Corepack to activate the target pnpm version (vs `pnpm self-update`)
  • ➕ More deterministic version activation (corepack prepare pnpm@ --activate) without relying on the currently installed pnpm behavior
  • ➕ Avoids pnpm self-update semantics that may differ across pnpm versions
  • ➖ Requires Corepack availability/enablement and careful interaction with repo packageManager checks
  • ➖ May not match the action’s current contract/expectations around pnpm self-update and its flags/config behaviors
2. Keep self-update last, then rerun dependency update under the new pnpm
  • ➕ Preserves current ordering while still ensuring lockfile is produced by the new pnpm
  • ➖ More CI time and additional complexity (rerun logic, idempotency, and conditional behavior)
  • ➖ Harder to reason about which outputs belong to which pnpm version if earlier steps already mutated the workspace

Recommendation: The PR’s approach (self-update first, plus per-invocation scoping for PNPM_CONFIG_MINIMUM_RELEASE_AGE) is the simplest way to ensure all subsequent pnpm invocations—including lockfile generation—use the newly pinned pnpm. Alternatives either add operational complexity (double-running updates) or change the action’s dependency/runtime assumptions (Corepack activation).

Files changed (4) +40 / -23

Enhancement (1) +26 / -21
update.shMove pnpm self-update to the beginning and scope release-age override +26/-21

Move pnpm self-update to the beginning and scope release-age override

• Reorders the workflow to run 'pnpm self-update' before Node/runtime pinning and dependency updates so subsequent pnpm calls delegate to the freshly pinned version. Changes 'PNPM_CONFIG_MINIMUM_RELEASE_AGE' from an exported variable to a per-invocation env prefix to prevent affecting the dependency update step.

scripts/update.sh

Tests (1) +10 / -0
update.batsAdd test asserting self-update happens before dependency update +10/-0

Add test asserting self-update happens before dependency update

• Adds a Bats test that checks invocation ordering in the pnpm log to ensure self-update occurs before 'pnpm update --recursive'. Provides coverage for the new orchestration guarantee and prevents regressions.

test/update.bats

Documentation (1) +1 / -1
README.mdDocument that pnpm self-update runs before dependency updates +1/-1

Document that pnpm self-update runs before dependency updates

• Clarifies 'update-pnpm' behavior so users understand the pnpm bump happens first. Reinforces that the dependency update and lockfile are generated by the newly pinned pnpm version.

README.md

Other (1) +3 / -1
action.ymlUpdate action input description for early pnpm self-update +3/-1

Update action input description for early pnpm self-update

• Extends the 'update-pnpm' input documentation to state that self-update runs before all other steps. Aligns action metadata with the new execution order.

action.yml

@zkochan
zkochan merged commit fcaa952 into main Jul 30, 2026
4 checks passed
zkochan added a commit to pnpm/pnpm that referenced this pull request Jul 30, 2026
…13516)

Picks up pnpm/update#4: the pin bump now happens first, so the
dependency update and the refreshed lockfile are produced by the pnpm
version the update PR moves the repository onto.

Co-authored-by: Claude Fable 5 <noreply@anthropic.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.

1 participant