Skip to content

fix(package-manager): unbreak the update-lockfile job's update --latest - #13244

Merged
zkochan merged 5 commits into
mainfrom
fix-update-lockfile-job2
Jul 23, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-update-lockfile-job2

Conversation

@zkochan

@zkochan zkochan commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Summary

The daily Update Lockfile job failed on its first run after pnpm/pnpm#13229 switched the workflow to the pnpm/update action with update-deps: latest. Replaying the job's pnpm update --recursive --latest locally 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__table is declared as catalog:, and its catalog entry is the alias npm:@types/[email protected]. Pacquet's update --latest resolved the latest tag by the dependency's alias name — which 404s on the registry — instead of the aliased package. It now resolves the aliased package (directly in package.json or through the catalog entry a catalog: reference points to) and writes the bump back with the npm:<real name>@ prefix and the entry's own range operator preserved, matching the TypeScript resolver's unwrapPackageName/calcSpecifier pair. The npm:<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 --latest treated node: runtime:26.5.0 as a registry dependency: it fetched the latest dist-tag of the unrelated npm package node and rewrote the specifier to a plain version — whose install script then failed the strict ignored-builds check. The TypeScript CLI leaves runtime: deps to the runtime resolvers, which re-resolve within the manifest spec; pacquet's --latest rewrite now skips them the same way.

3. update --latest bumps 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), which engineStrict enforces against nodeVersion — but nothing told pnpm update to skip them, so the job bumped them and correctly failed on ERR_PNPM_UNSUPPORTED_ENGINE (the TypeScript CLI fails identically here; this is by design). A scan of every catalog entry's latest engines.node found 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-declared node-gyp. They are now listed in updateConfig.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/commands for the direct alias, installing/deps-installer for the catalog alias entry and the runtime dep).

Verification. pnpm update --recursive --latest --changeset (the job's exact command after refresh-lockfile deletes pnpm-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-gyp and the virtual node runtime dep left alone. Note: pacquet warns No 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

The update-lockfile workflow's new update --latest flow (pnpm/pnpm#13229)
never succeeded; a local replay of its exact command with a patched pacquet
surfaced three independent blockers, all fixed here.

(1) prepare_manifest's --latest branches resolved `latest` by the manifest
key (the install alias) and only consulted the catalogs to recover the range
operator, so an npm: alias — like the catalog entry npm:@types/[email protected]
behind @types/zkochan__table — 404'd on the alias name. Both branches now
compute 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 serialize the rewrite with the
npm:<real name>@ prefix preserved. The npm:<range> shorthand and a
self-named alias are written as a plain range, matching the TypeScript
resolver's unwrapPackageName/calcSpecifier pair. latest_pin is folded into
the new effective_specifier + resolve_latest_specifier helpers; the
pin-recovery behavior is unchanged.

(2) The same branches treated runtime: specifiers as registry deps,
resolving the unrelated npm package `node` and rewriting the manifest to a
plain version whose install script then failed the strict ignored-builds
check. The --latest rewrite now skips runtime: specifiers; the runtime
resolvers re-resolve them within the manifest spec, as in the TypeScript
CLI.

(3) pnpm-workspace.yaml gains updateConfig.ignoreDependencies for the deps
held below majors that require Node.js above pnpm's supported floor
(>=22.13), which engineStrict correctly fails against nodeVersion — the 8
already-commented catalog hold-backs plus @babel/core,
@babel/plugin-transform-explicit-resource-management, bin-links,
libnpmpublish, npm-registry-fetch (newly floor-blocked, now commented at
their catalog entries too) and the directly-declared node-gyp.

The TypeScript implementation needs no code change for (1) and (2); it gains
tests pinning both scenarios, which were uncovered.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

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

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]>
Copilot AI review requested due to automatic review settings July 23, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 271c42dc-b669-4794-a8f5-aad52a0895e4

📥 Commits

Reviewing files that changed from the base of the PR and between 45ca40f and 4e57fab.

📒 Files selected for processing (5)
  • pnpm/crates/cli/tests/update.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/package-manager/src/update/tests.rs
  • pnpm11/installing/commands/test/update/update.ts
  • pnpm11/installing/deps-installer/test/catalogs.ts
💤 Files with no reviewable changes (1)
  • pnpm/crates/package-manager/src/update/tests.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • pnpm11/installing/commands/test/update/update.ts
  • pnpm/crates/cli/tests/update.rs
  • pnpm11/installing/deps-installer/test/catalogs.ts
  • pnpm/crates/package-manager/src/update.rs

📝 Walkthrough

Walkthrough

pnpm update --latest now resolves npm: aliases using their real package names, preserves alias prefixes and range operators, and supports aliases stored in catalog: entries. Unit and integration tests cover direct and catalog-based dependencies.

Changes

npm alias latest update

Layer / File(s) Summary
Alias-aware manifest rewriting
pnpm/crates/package-manager/src/update.rs
prepare_manifest resolves effective catalog specifiers, targets aliased packages for latest-version resolution, and preserves range operators and npm: prefixes.
Direct and catalog validation
pnpm/crates/package-manager/src/update/tests.rs, pnpm/crates/cli/tests/update.rs, pnpm11/installing/commands/test/update/update.ts, pnpm11/installing/deps-installer/test/catalogs.ts, .changeset/update-latest-npm-alias-target.md
Unit and integration tests cover alias parsing, direct dependencies, catalog entries, lockfiles, and preserved manifest specifications; the changeset records the patch behavior.

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
Loading

Possibly related PRs

  • pnpm/pnpm#13027: Changes pin detection used to preserve specifier operators.
  • pnpm/pnpm#13102: Modifies the latest-resolution flow in the same Rust update implementation.
  • pnpm/pnpm#13234: Also modifies prepare_manifest latest-update rewrite handling.

Suggested labels: product: pacquet, product: pnpm@11

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-update-lockfile-job2

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix pacquet update --latest for npm: alias specifiers

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve --latest against the real package for npm: alias dependencies.
• Preserve npm:@ prefix and existing range operator in rewritten specifiers.
• Add regression tests for direct and catalog-based npm: alias updates.
Diagram

graph TD
  A["pacquet CLI: update --latest"] --> B["prepare_manifest()"] --> C{"catalog: ref?"}
  C -->|"yes"| D["effective_specifier(): catalog entry"] --> F["npm_alias_target()"]
  C -->|"no"| E["effective_specifier(): dep spec"] --> F
  F --> G["resolve latest (LatestPicker)"] --> H["rewrite specifier + update manifest/catalog"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reuse existing alias-unwrapping utility from deps-resolver
  • ➕ Avoids duplicating npm alias parsing logic
  • ➕ Keeps alias semantics consistent across resolution and update flows
  • ➖ May introduce undesirable coupling between update and resolver crates/modules
  • ➖ Existing helper may not match update’s serialization rules (e.g., when to preserve/drop npm: prefix)
2. Normalize specifiers earlier (convert aliases to canonical form at manifest load)
  • ➕ Simplifies later update logic by operating on canonical package identities
  • ➕ Could reduce edge cases across other features that read manifest specifiers
  • ➖ Higher blast radius: affects install/resolution semantics beyond update --latest
  • ➖ Risky behavior change for users who expect original specifier text preserved in writes

Recommendation: The PR’s approach is the best fit: keep alias handling localized to --latest rewrite computation by (1) deriving an effective specifier (catalog entry vs direct spec), (2) unwrapping npm: aliases only for the dist-tag lookup, and (3) preserving TypeScript-equivalent serialization behavior when writing back. This minimizes coupling and limits behavior changes to the broken path while adding targeted regression coverage.

Files changed (4) +162 / -29

Bug fix (1) +80 / -27
update.rsResolve '--latest' using effective specifier and unwrap 'npm:' alias targets +80/-27

Resolve '--latest' using effective specifier and unwrap 'npm:' alias targets

• Refactors '--latest' rewrite computation to first determine an effective specifier (catalog entry for 'catalog:' references, otherwise the dependency spec), unwrap 'npm:' aliases to resolve the correct package’s latest version, and serialize the rewritten specifier while preserving TypeScript-equivalent alias formatting rules. Adds helper functions 'effective_specifier', 'resolve_latest_specifier', and 'npm_alias_target'.

pnpm/crates/package-manager/src/update.rs

Tests (2) +77 / -2
update.rsAdd end-to-end tests for '--latest' with direct and catalog 'npm:' aliases +47/-0

Add end-to-end tests for '--latest' with direct and catalog 'npm:' aliases

• Introduces CLI integration tests asserting that 'pacquet update --latest' resolves the latest version of the aliased package (not the alias name), preserves the 'npm:<real>@' prefix, and correctly bumps catalog entries while leaving 'catalog:' references intact.

pnpm/crates/cli/tests/update.rs

tests.rsAdd unit tests for 'npm_alias_target' parsing semantics +30/-2

Add unit tests for 'npm_alias_target' parsing semantics

• Adds focused unit tests validating which 'npm:' forms are treated as true aliases (returning a real target) versus cases that should not preserve an 'npm:' prefix on rewrite (e.g., 'npm:<range>' shorthand and self-aliases).

pnpm/crates/package-manager/src/update/tests.rs

Documentation (1) +5 / -0
update-latest-npm-alias-target.mdAdd changeset documenting '--latest' fix for 'npm:' aliases +5/-0

Add changeset documenting '--latest' fix for 'npm:' aliases

• Adds a patch changeset for pacquet describing the corrected behavior when updating 'npm:' alias dependencies under 'pnpm update --latest', including catalog-based aliases and prefix preservation.

.changeset/update-latest-npm-alias-target.md

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.03     14.3±0.92ms    26.1 MB/sec    1.00     13.9±1.55ms    26.9 MB/sec
packument/parse                1.04     43.6±4.68µs  1521.8 MB/sec    1.00     41.9±3.45µs  1581.7 MB/sec
tarball/download_dependency    1.38      4.0±0.67ms  1071.5 KB/sec    1.00      2.9±0.41ms  1478.5 KB/sec

@qodo-code-review

qodo-code-review Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (3) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. npm_alias_target JSDoc lacks contract 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The doc comment for npm_alias_target only references parity with the TypeScript resolver instead
of documenting the function’s contract (inputs, output meaning, and key edge cases). This makes
future maintenance and correct usage harder and violates the JSDoc guidance.
Code

pnpm/crates/package-manager/src/update.rs[R912-913]

+/// Mirrors the TypeScript resolver's `unwrapPackageName`/`calcSpecifier`
+/// pair.
Evidence
PR Compliance ID 713430 requires JSDoc to document function contracts rather than re-describe
implementation. The added comment above npm_alias_target only states it mirrors TypeScript
functions and does not describe what inputs are expected or what Option<&str> signifies.

Rule 713430: JSDoc must document function contracts, not re-describe implementation
pnpm/crates/package-manager/src/update.rs[912-913]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The doc comment for `npm_alias_target` describes implementation parity (“Mirrors the TypeScript resolver…”) rather than the function contract.

## Issue Context
Per the checklist, new/modified functions with doc comments should document preconditions, postconditions/return semantics, and important edge cases.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update.rs[912-913]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Array item missing trailing comma 📘 Rule violation ⚙ Maintainability
Description
A multi-line array literal passed to preparePackagesAndReturnObjects lacks a trailing comma after
its last element. This violates the repo’s TypeScript trailing-comma requirement and increases diff
churn on future edits.
Code

pnpm11/installing/deps-installer/test/catalogs.ts[R1962-1967]

+    const { options, projects, readLockfile } = preparePackagesAndReturnObjects([{
+      name: 'project1',
+      dependencies: {
+        'foo-alias': 'catalog:',
+      },
+    }])
Evidence
PR Compliance ID 713434 requires trailing commas in multi-line TypeScript collections. In the new
test, the array passed to preparePackagesAndReturnObjects([ ... ]) is multi-line but the final
element closes with }]) without a trailing comma after the object.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/deps-installer/test/catalogs.ts[1962-1967]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The multi-line array argument to `preparePackagesAndReturnObjects` is missing a trailing comma after its final (and only) object element.

## Issue Context
Compliance requires trailing commas for multi-line TypeScript collections to reduce diff noise.

## Fix Focus Areas
- pnpm11/installing/deps-installer/test/catalogs.ts[1962-1967]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits the required pnpm package entry.
This can cause the release tooling to miss or misattribute the pnpm bump for this bug fix.
Code

.changeset/update-latest-npm-alias-target.md[R1-3]

+---
+"pacquet": patch
+---
Evidence
PR Compliance ID 713436 requires every added/modified changeset to include an explicit pnpm entry
with a valid bump type. The changeset front-matter currently lists only "pacquet": patch and has
no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/update-latest-npm-alias-target.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter is missing an explicit `pnpm` entry (with a valid bump type).

## Issue Context
This PR adds a new changeset file, but it only declares a `pacquet` bump. The compliance checklist requires that changesets explicitly include `pnpm` with a correct bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/update-latest-npm-alias-target.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 4e57fab

Results up to commit 8ba80d2 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and omits the required pnpm package entry.
This can cause the release tooling to miss or misattribute the pnpm bump for this bug fix.
Code

.changeset/update-latest-npm-alias-target.md[R1-3]

+---
+"pacquet": patch
+---
Evidence
PR Compliance ID 713436 requires every added/modified changeset to include an explicit pnpm entry
with a valid bump type. The changeset front-matter currently lists only "pacquet": patch and has
no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/update-latest-npm-alias-target.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter is missing an explicit `pnpm` entry (with a valid bump type).

## Issue Context
This PR adds a new changeset file, but it only declares a `pacquet` bump. The compliance checklist requires that changesets explicitly include `pnpm` with a correct bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/update-latest-npm-alias-target.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 45ca40f ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Array item missing trailing comma 📘 Rule violation ⚙ Maintainability
Description
A multi-line array literal passed to preparePackagesAndReturnObjects lacks a trailing comma after
its last element. This violates the repo’s TypeScript trailing-comma requirement and increases diff
churn on future edits.
Code

pnpm11/installing/deps-installer/test/catalogs.ts[R1962-1967]

+    const { options, projects, readLockfile } = preparePackagesAndReturnObjects([{
+      name: 'project1',
+      dependencies: {
+        'foo-alias': 'catalog:',
+      },
+    }])
Evidence
PR Compliance ID 713434 requires trailing commas in multi-line TypeScript collections. In the new
test, the array passed to preparePackagesAndReturnObjects([ ... ]) is multi-line but the final
element closes with }]) without a trailing comma after the object.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/deps-installer/test/catalogs.ts[1962-1967]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The multi-line array argument to `preparePackagesAndReturnObjects` is missing a trailing comma after its final (and only) object element.

## Issue Context
Compliance requires trailing commas for multi-line TypeScript collections to reduce diff noise.

## Fix Focus Areas
- pnpm11/installing/deps-installer/test/catalogs.ts[1962-1967]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

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 pacquet and omit "pnpm" — in changesets, pnpm always refers to the TypeScript CLI package, which this PR does not change (the TypeScript resolver already handles npm: aliases correctly). The changeset is intentionally "pacquet": patch only.


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pnpm/crates/package-manager/src/update.rs (1)

880-947: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use plain // comments, not ///, for these private functions.

effective_specifier, resolve_latest_specifier, and npm_alias_target are all private (no pub), 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 to resolve_latest_specifier and npm_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

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb1095 and 8ba80d2.

📒 Files selected for processing (4)
  • .changeset/update-latest-npm-alias-target.md
  • pnpm/crates/cli/tests/update.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/package-manager/src/update/tests.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 23, 2026
@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Re CodeRabbit's nitpick (use // instead of /// on the private helpers): keeping ///. The pacquet comment convention (pnpm/AGENTS.md, "Comments") uses doc comments for item contracts regardless of visibility and reserves // for implementation-only rationale, and the surrounding private functions in update.rs (ensure_latest_picker, read_catalog_ctx, the replaced latest_pin) all follow the same pattern. No change made.


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

@greptile-apps

greptile-apps Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Reviews (5): Last reviewed commit: "refactor: drop comments duplicating what..." | Re-trigger Greptile

Comment thread pnpm/crates/cli/tests/update.rs Resolved
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]>
Copilot AI review requested due to automatic review settings July 23, 2026 16:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 01ed857

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

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]>
Copilot AI review requested due to automatic review settings July 23, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 45ca40f

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 01ed857 and 45ca40f.

📒 Files selected for processing (2)
  • pnpm11/installing/commands/test/update/update.ts
  • pnpm11/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]>
Copilot AI review requested due to automatic review settings July 23, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 679981e

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

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]>
Copilot AI review requested due to automatic review settings July 23, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 4e57fab

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Re the two new Qodo findings on 4e57fab, both declined:

  • "npm_alias_target JSDoc lacks contract" — intentional. The behavior is fully documented by the unit tests (npm_alias_specifiers_yield_their_real_package_name, non_alias_specifiers_have_no_npm_alias_target); per the pacquet comment convention, tests are the documentation and prose that restates them is duplication. The remaining line carries only the TypeScript cross-reference.
  • "Array item missing trailing comma" — the }]) closing follows the exact shape of every existing preparePackagesAndReturnObjects([{ … }]) call in this file, and eslint (which enforces the repo's trailing-comma rules) passes clean on the file. The rule does not require a comma between a closing brace and its enclosing bracket on the same line.

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

@zkochan
zkochan merged commit d07810f into main Jul 23, 2026
32 checks passed
@zkochan
zkochan deleted the fix-update-lockfile-job2 branch July 23, 2026 17:24
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.94%. Comparing base (454e7d6) to head (4e57fab).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/update.rs 98.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zkochan zkochan changed the title fix(package-manager): resolve npm: alias targets under update --latest fix(package-manager): unbreak the update-lockfile job's update --latest Jul 23, 2026
zkochan added a commit that referenced this pull request Jul 23, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants