Repository navigation
ci(release): gate releases on a publishable manifest, a real upgrade, and pnpm doctor - #13072
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRelease workflows now reject dependency fields in packed TypeScript manifests and verify self-upgrades for both ChangesRelease verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant npmRegistry
participant TempPnpmEnvironment
participant pnpm
participant PnpmExe
GitHubActions->>npmRegistry: Resolve source version
GitHubActions->>TempPnpmEnvironment: Install source packages
GitHubActions->>pnpm: Verify source version
GitHubActions->>PnpmExe: Verify source version
GitHubActions->>pnpm: Self-update to target version
GitHubActions->>PnpmExe: Self-update to target version
GitHubActions->>pnpm: Verify target version
GitHubActions->>PnpmExe: Verify target version
GitHubActions->>GitHubActions: Update registry tags after verification
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoGate releases on publishable pnpm manifest and real upgrade verification
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/update-latest.yml (1)
63-66: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSilence the
zizmorwarning for ad-hoc package installation.The static analysis tool
zizmorflags thenpm installon line 87 for installing a package outside of a lockfile. Since this step dynamically resolves and installs the previous release version for testing, you can add an ignore directive to the step to suppress this false positive, matching the convention used in.github/workflows/release.yml.♻️ Proposed refactor to add the ignore directive
- name: Verify upgrading onto the new version + # zizmor: ignore[adhoc-packages] -- This step intentionally installs a dynamic older version from the registry to verify upgrades. env: VERSION: ${{ github.event.inputs.version }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/update-latest.yml around lines 63 - 66, Add the repository’s established zizmor ignore directive to the “Verify upgrading onto the new version” workflow step, matching the convention used in release.yml, so the dynamic npm install is excluded from the lockfile warning. Keep the step’s existing version environment and upgrade verification commands unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/update-latest.yml:
- Around line 63-66: Add the repository’s established zizmor ignore directive to
the “Verify upgrading onto the new version” workflow step, matching the
convention used in release.yml, so the dynamic npm install is excluded from the
lockfile warning. Keep the step’s existing version environment and upgrade
verification commands unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 537cdca1-a7f9-4640-8dae-7180d7451d89
📒 Files selected for processing (2)
.github/workflows/release.yml.github/workflows/update-latest.yml
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
PR Code Suggestions ✨Latest suggestions up to 2c22ff2 Warning
Previous suggestionsSuggestions up to commit 4a08e61
Suggestions up to commit 7c15b4e
Suggestions up to commit cc627e5
Suggestions up to commit a6932db
✅ Suggestions up to commit 426a37f
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Confidence Score: 4/5Safe to merge with one targeted fix: the Rust smoke test is missing The workflow additions and the TypeScript pnpm/crates/cli/src/cli_args/doctor.rs — Reviews (10): Last reviewed commit: "ci(release): stop re-deriving the same r..." | Re-trigger Greptile |
Re: "Change global executable path to
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/update-latest.yml:
- Line 127: Update the pnpm version verification command in the workflow to
locate and invoke pnpm from either the v11+ path, $PNPM_HOME/bin/pnpm, or the
v10 path, $PNPM_HOME/pnpm. Preserve the existing comparison against $VERSION and
ensure verification succeeds when either executable location is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 07b89d64-7586-4f89-bc46-cea43dca9911
📒 Files selected for processing (2)
.github/workflows/release.yml.github/workflows/update-latest.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/release.yml
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Re: "Npm config not isolated"Addressed in 57119ea, though I'd split your two concerns — they don't carry equal weight here. Wrong-artifact risk: valid, and fixed. This gate's entire premise is that it resolves what users will resolve. Reading ambient npm config meant a runner-level npm_config_registry: https://registry.npmjs.org/
npm_config_userconfig: ${{ runner.temp }}/absent-npmrcThis isn't hypothetical — it reproduces locally. My Credential exfiltration: largely already closed. As of 99198a8 this runs in Registry results are unchanged after the isolation: 11.13.1 and 10.34.4 pass; 11.12.0 and 11.13.0 are rejected. Written by an agent (Claude Code, claude-opus-4-8). |
|
Code review by qodo was updated up to the latest commit 57119ea |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Two published v11 releases were broken in ways nothing in the release pipeline checked, and both only surfaced once users upgraded onto them:
[email protected]declared its bundled dependencies in the published manifest. It was packed by a pnpm that ignores the.pnpmfile.cjsbeforePackinghook, so the dependency fields survived. Resolvingnode-gypthen pulledtinyglobby→[email protected]([email protected])— a peer-suffixed snapshot — into the env lockfile, andbuildLockfileFromEnvLockfiledoesn't strip the peer suffix when looking the key up inpackages. The merged snapshot has noresolution, and every upgrade onto 11.12.0 died increateFullPkgIdwithCannot use 'in' operator to search for 'integrity' in undefined(11.12.0 release fails to install from tarball #12955, self-update crashes withCannot use 'in' operator to search for 'integrity' in undefineddue to peer dependencies #12959). Fixed for new releases by fix: keep bundled dependency fields out of the published pnpm manifest #12964, but 11.12.0 is immutable on npm.@pnpm/[email protected]and@pnpm/[email protected]shipped platform packages with no native binary.@pnpm/[email protected]contains only CHANGELOG/LICENSE/README/package.json.setup.jsdoesif (!fs.existsSync(bin)) process.exit(0), so the placeholder bin survives silently and the wrapper is non-functional. Fixed in 11.13.1 by fix(release): verify and package TypeScript CLI artifacts #13063.Neither wrapper's failure would have caught the other's, and neither was caught before
latestmoved. This adds two gates.Preflight assert (
release.yml,verify-ts-release): on the packed tarball, the publishedpnpmmanifest must declare nodependencies/devDependencies. It asserts on the artifact rather than trusting either stripper —bundle-deps.ts's on-disk strip is explicitly marked temporary ("Remove this once the release runs a pnpm that applies the hook"), so removing it while the hook still isn't honored would silently reintroduce #12955. npm publishes are immutable, so this has to fail before the first upload.Upgrade gate (
update-latest.yml, beforedist-tag add): upgrade from the release line's current version onto the new one, for both thepnpmand@pnpm/exewrappers, and then run the resulting binary. The release workflow has already published undernext-<major>at that point, so this exercises the real registry artifact instead of a local reproduction of it, and it runs before the dist-tags move — the last gate before a version reaches everyone. It runs the binary rather than trustingself-update's exit code, because an@pnpm/exeself-update onto a release with missing natives still exits 0.Both were verified against the real registry rather than only reasoned about:
[email protected][email protected],[email protected]pnpm11.13.0 → 11.13.1pnpm11.11.0 → 11.12.0@pnpm/exe11.13.1 → 11.11.0@pnpm/exe11.11.0 → 11.12.0@pnpm/exe11.13.1 → 11.13.0Related to #12959. The latent
buildLockfileFromEnvLockfilebug that made the bad manifest fatal is addressed separately in #12960; this PR stops a broken artifact from being published or promoted in the first place.Squash Commit Body
pnpm doctorThe gate above reproduced what a user does — install the release, then exercise
it — in shell only CI ran. A reproduction drifts from the thing it stands in
for, and it could assert only what shell can see: that the binary prints a
version.
So the gate now calls a real command.
pnpm doctorreports the versions andinstall method, whether the global bin directory is on PATH, whether the store
and cache are writable, which link strategies the store's filesystem supports,
registry reachability, and — the part the gate turns on — an offline
file:install that drives the resolve/store/link path end to end in ~600ms. That is
the path a manifest declaring its bundled dependencies breaks.
verify-upgraderuns
pnpm doctor --offlineon the upgraded binary, so what gates a release iswhat ships, and every check the command gains is one releases are verified
against.
--jsonmakes it machine-readable and--benchmarktimes it; it exitsnon-zero when any check fails.
The command postdates the release lines this workflow can still tag, so the gate
probes for it and reports when it ran
--versionalone instead, rather thanfailing a v10 promotion on a v11 command.
Verified by running it, not only by typechecking — which caught three real bugs:
the global-bin check was reading the local
node_modules/.bin(never on PATH);the reflink probe used Node's
COPYFILE_FICLONE_FORCE, which returns ENOSYS onmacOS and Windows, so it told every Mac user their installs would copy and
advised moving the store — it now clones the way the importer does, via
@reflink/reflink; and pacquet's smoke test passed flags that CLI does not have.Both stacks now report identically on the same machine.
The Tag workflow runs on pnpm
The workflow drove pnpm's own registry with npm — reading pnpm's dist-tags,
installing pnpm, moving pnpm's tags — which left
view,addanddist-tagunexercised by the pipeline that depends on them. npm was only ever there
because the job installs no pnpm and npm arrives free with Node. It now
installs pnpm with
pnpm/setup(the action the rest of the release alreadyuses) and runs the pnpm CLI.
Tagging uses the version being released. It is published under
next-<major>by then andverify-upgradehas just exercised it, so every tagis one more thing the release had to do correctly — an authenticated registry
write — before it reaches anyone. This cannot deadlock the way tagging with
latestwould: a release that fails here blocks only itself, and its successorcarries its own tagger. The jobs that set up the comparison stay on a pinned
pnpm, since letting the version under test build its own starting point would
let a bug in it be blamed on the version it replaces.
Two details are load-bearing and were measured rather than assumed:
npm_config_registry--registrynpm_config_userconfig.npmrcoutnpm_config_//…/:_authTokenpn config set(as release.yml's publish steps already do)pn add--allow-build=@pnpm/exe: pnpm blocks dependency build scripts, and@pnpm/exe'ssetup.jsis what replaces its placeholder bin with the native. Without it the starting point reproduces the exact breakage this gate exists to catch, and blames the release for it.Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-4-8).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
dependencies,devDependencies,optionalDependencies, orpeerDependencies).self-updateproduces the requested pnpm version before tags are published.