Repository navigation
fix(package-manager): unbreak the update-lockfile job's update --latest - #13244
Conversation
The daily update-lockfile workflow failed: pacquet's update --latest resolved the latest dist-tag of `@types/zkochan__table` — a catalog dependency whose catalog entry is the alias `npm:@types/[email protected]` — by its alias name, which 404s on the registry. prepare_manifest's --latest branches now derive each rewrite from the effective specifier (the catalog entry for a catalog: reference, the dependency's own specifier otherwise), unwrap an npm: alias to the real package name for the dist-tag lookup, and keep the `npm:<real name>@` prefix in the written specifier. The `npm:<range>` shorthand and a self-named alias are written as a plain range, matching the TypeScript resolver's unwrapPackageName/calcSpecifier pair, which already handled aliases correctly (the TypeScript stack needs no change). Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthrough
Changesnpm alias latest update
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant UpdateCommand
participant prepare_manifest
participant WorkspaceCatalog
participant Registry
UpdateCommand->>prepare_manifest: update --latest
prepare_manifest->>WorkspaceCatalog: resolve catalog: effective specifier
prepare_manifest->>Registry: resolve latest aliased package
Registry-->>prepare_manifest: latest version
prepare_manifest-->>UpdateCommand: rewritten npm alias specifier
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 QodoFix pacquet update --latest for npm: alias specifiers
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. npm_alias_target JSDoc lacks contract
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
The Qodo rule violation ("Changeset missing pnpm entry") is a false positive for this PR. Per the repository changeset policy in AGENTS.md ("Changesets for the Rust products"), a changeset whose implementation is Rust-only must target Written by an agent (Claude Code, claude-fable-5). |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/package-manager/src/update.rs (1)
880-947: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse plain
//comments, not///, for these private functions.
effective_specifier,resolve_latest_specifier, andnpm_alias_targetare all private (nopub), but are documented with rustdoc (///) comments.✏️ Proposed fix
-/// The specifier a `--latest` bump derives its rewrite from: the catalog -/// entry for a `catalog:` reference (the reference itself carries neither an -/// alias target nor a range operator), the dependency's own specifier -/// otherwise. Reading the catalogs is deferred to here so an update that -/// rewrites nothing never parses them. +// The specifier a `--latest` bump derives its rewrite from: the catalog +// entry for a `catalog:` reference (the reference itself carries neither an +// alias target nor a range operator), the dependency's own specifier +// otherwise. Reading the catalogs is deferred to here so an update that +// rewrites nothing never parses them. fn effective_specifier(Apply the same
///→//change toresolve_latest_specifierandnpm_alias_target.As per path instructions, "Use rustdoc comments for public API contracts and regular comments for implementation rationale."
🤖 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 `@pnpm/crates/package-manager/src/update.rs` around lines 880 - 947, Replace the rustdoc comments above the private functions effective_specifier, resolve_latest_specifier, and npm_alias_target with regular // comments, preserving their existing explanatory content and formatting the continuation lines consistently.Source: Path instructions
🤖 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 `@pnpm/crates/package-manager/src/update.rs`:
- Around line 880-947: Replace the rustdoc comments above the private functions
effective_specifier, resolve_latest_specifier, and npm_alias_target with regular
// comments, preserving their existing explanatory content and formatting the
continuation lines consistently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 36807c29-7cb0-4153-b47b-51761ad39c02
📒 Files selected for processing (4)
.changeset/update-latest-npm-alias-target.mdpnpm/crates/cli/tests/update.rspnpm/crates/package-manager/src/update.rspnpm/crates/package-manager/src/update/tests.rs
|
Re CodeRabbit's nitpick (use Written by an agent (Claude Code, claude-fable-5). |
Confidence Score: 5/5The PR appears safe to merge. No blocking failures remain. Reviews (5): Last reviewed commit: "refactor: drop comments duplicating what..." | Re-trigger Greptile |
Keep only the non-obvious why (the alias name 404s on the registry); the assertions already state the rewrite shape. Addresses a Greptile review note on #13244. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 01ed857 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The TypeScript resolver already resolves `npm:` aliases (directly and in catalog entries) to the aliased package under `update --latest`, but no test pinned it — the same coverage gap that let the pacquet regression ship. Mirror the two new pacquet e2e tests: a direct alias rewrite that keeps the `npm:<real name>@` prefix and range operator, and a catalog alias entry bump that keeps the `catalog:` reference in the manifest. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 45ca40f |
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 `@pnpm11/installing/deps-installer/test/catalogs.ts`:
- Around line 1969-1971: Update the catalogs test fixture to use the ~1.0.0
range for foo-alias, then assert that the resolved dependency preserves the ~
operator with the expected npm:`@pnpm.e2e/foo`@~100.1.0 value. Ensure the
catalog-specific path, not only the direct dependency path, validates
range-operator preservation.
🪄 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: 0906d414-47e1-4a40-9085-ce2bfa9d3aea
📒 Files selected for processing (2)
pnpm11/installing/commands/test/update/update.tspnpm11/installing/deps-installer/test/catalogs.ts
Pins range-operator preservation through the catalog rewrite path too, not just the direct-dependency path. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 679981e |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The unit and e2e tests enumerate the npm: alias rewrite behavior; keep only the TypeScript cross-reference, which tests cannot carry. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 4e57fab |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Re the two new Qodo findings on 4e57fab, both declined:
Written by an agent (Claude Code, claude-fable-5). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13244 +/- ##
=======================================
Coverage 86.94% 86.94%
=======================================
Files 528 528
Lines 90472 90500 +28
=======================================
+ Hits 78661 78686 +25
- Misses 11811 11814 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The update-lockfile job runs the pinned pacquet and fails before its own self-update step, so the pin cannot advance to the alpha carrying the #13244 alias fix on its own. Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
The daily Update Lockfile job failed on its first run after pnpm/pnpm#13229 switched the workflow to the
pnpm/updateaction withupdate-deps: latest. Replaying the job'spnpm update --recursive --latestlocally with a patched pacquet uncovered three independent blockers; this PR fixes all of them, and the full job command now completes cleanly in a local replay.1.
npm:aliases resolved by their alias name (the failure in the run above).@types/zkochan__tableis declared ascatalog:, and its catalog entry is the aliasnpm:@types/[email protected]. Pacquet'supdate --latestresolved thelatesttag by the dependency's alias name — which 404s on the registry — instead of the aliased package. It now resolves the aliased package (directly inpackage.jsonor through the catalog entry acatalog:reference points to) and writes the bump back with thenpm:<real name>@prefix and the entry's own range operator preserved, matching the TypeScript resolver'sunwrapPackageName/calcSpecifierpair. Thenpm:<range>shorthand and a self-named alias are written as a plain range, also matching TS.2.
runtime:dependencies rewritten into npm registry packages.update --latesttreatednode: runtime:26.5.0as a registry dependency: it fetched the latest dist-tag of the unrelated npm packagenodeand rewrote the specifier to a plain version — whose install script then failed the strict ignored-builds check. The TypeScript CLI leavesruntime:deps to the runtime resolvers, which re-resolve within the manifest spec; pacquet's--latestrewrite now skips them the same way.3.
update --latestbumps the deps deliberately held below their latest majors. The catalog documents (with comments) entries kept back because their newer majors require Node.js above pnpm's supported floor (>=22.13), whichengineStrictenforces againstnodeVersion— but nothing toldpnpm updateto skip them, so the job bumped them and correctly failed onERR_PNPM_UNSUPPORTED_ENGINE(the TypeScript CLI fails identically here; this is by design). A scan of every catalog entry's latestengines.nodefound the 8 already-commented hold-backs plus five new ones (@babel/core,@babel/plugin-transform-explicit-resource-management,bin-links,libnpmpublish,npm-registry-fetch) and the directly-declarednode-gyp. They are now listed inupdateConfig.ignoreDependencies, with catalog comments added for the new ones following the existing convention.The TypeScript stack behaves correctly on (1) and (2) but had no tests pinning either scenario — the coverage gap that let both regressions ship in pacquet — so the pacquet e2e tests are mirrored as TypeScript tests (
installing/commandsfor the direct alias,installing/deps-installerfor the catalog alias entry and the runtime dep).Verification.
pnpm update --recursive --latest --changeset(the job's exact command afterrefresh-lockfiledeletespnpm-lock.yaml), run with a locally built pacquet from this branch on node 26.5.0, completes with exit 0: catalog and lockfile updated, alias entries bumped with prefixes preserved, held-back entries untouched,node-gypand the virtualnoderuntime dep left alone. Note: pacquet warnsNo changeset was generated because .changeset/config.json does not exist— this repo uses the native changeset flow without that file, so the update PRs will carry no auto-generated changeset (same as before this PR).Squash Commit Body
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-fable-5).