Skip to content

test(catalogs): cover catalog inheritance of injected workspace packages - #17295

Merged
zkochan merged 1 commit into
pnpm:mainfrom
niangaoxiao:fix/relative-injected-workspace-catalogs
Nov 21, 2026
Merged

zkochan merged 1 commit into
pnpm:mainfrom
niangaoxiao:fix/relative-injected-workspace-catalogs

Conversation

@niangaoxiao

@niangaoxiao niangaoxiao commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds regression coverage for catalog resolution in injected workspace packages, in pnpm v11 and v12. Refs #17280.

The resolver fix for #17280 landed in #17297 while this PR was open: the local resolver now tags a workspace: specifier resolvedVia: "workspace", so the existing catalog gate covers relative paths. The resolver changes this PR originally made became dead code after rebasing, so they and the changeset were removed. The tests remain because they cover cases the merged fix does not:

  • relative workspace: paths with the default catalog and a named catalog,
  • injection through dependenciesMeta.<name>.injected as well as injectWorkspacePackages,
  • an ordinary file: dependency still rejecting catalog: references (ERR_PNPM_UNSUPPORTED_PROTOCOL), injected or not.

Squash Commit Body

The resolver fix for pnpm/pnpm#17280 landed in pnpm/pnpm#17297, which
tags a workspace: specifier "workspace" in the local resolver. Add
coverage for relative workspace: paths with default and named catalogs,
injection through injectWorkspacePackages and through dependenciesMeta,
and the rejection of catalog: references in ordinary file: dependencies,
in both CLIs.

Checklist

Validation

  • cargo nextest run -p pnpm-cli -E 'test(/inject_workspace_packages::catalogs/)': 7 passed.
  • jest test/catalogs.ts -t 'injected|inject-workspace|file dependencies|relative' in @pnpm/installing.deps-installer: 9 passed.
  • pnpm run ci:rust-fmt and the pre-push checks (clippy, typos, taplo, dylint) passed.

Original change written by an agent (Codex, GPT-6). Rebased onto main and reduced to test coverage by an agent (Claude Code, claude-opus-5-5).

Summary by CodeRabbit

  • Tests
    • Expanded coverage for catalog references in injected workspace dependencies, including relative workspace paths and default or named catalogs.
    • Added checks across lockfile-only, standard, and frozen installs, including verification that peer dependency resolution is consistent and package manifests remain unchanged.
    • Added coverage confirming that ordinary file dependencies using workspace catalog references are rejected with an unsupported-protocol error.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds and expands tests for catalog references in injected workspace packages. It covers relative workspace paths, default and named catalogs, lockfile and install behavior, and rejection of catalog references from file dependencies.

Changes: Workspace catalog tests

Layer / File(s) Summary
Relative workspace catalog resolution
pnpm/crates/cli/tests/suite/inject_workspace_packages/catalogs.rs, pnpm11/installing/deps-installer/test/catalogs.ts
Tests cover relative workspace dependencies with default and named catalogs, global and per-dependency injection, and lockfile and install checks.
File dependency rejection
pnpm/crates/cli/tests/suite/inject_workspace_packages/catalogs.rs, pnpm11/installing/deps-installer/test/catalogs.ts
Tests verify that injected and non-injected file dependencies using catalog specifiers fail with ERR_PNPM_UNSUPPORTED_PROTOCOL.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • pnpm/pnpm#17297: Supplies resolver behavior tested here for catalog dependencies in relative workspace: packages.

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

Merge Risk: Minimal · up to c52a6

This change only adds regression tests for catalog resolution in injected workspace packages. It does not change runtime behavior and has no identified merge risk.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pnpm/pnpm
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: dad931d
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62ca4217-582f-4f2d-952f-32596cda5895
Commits

Reviewing files that changed from the base of the PR and between dad931d and c52a64b.

Files selected for processing: 2

  • pnpm/crates/cli/tests/suite/inject_workspace_packages/catalogs.rs
  • pnpm11/installing/deps-installer/test/catalogs.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 3171.10 ms 3371.85 ms 6.3% 158.56 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store pnpr 2200.39 ms 2000.73 ms -9.1% 110.02 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 400.86 ms 440.33 ms 9.8% 20.04 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pnpr 440.76 ms 465.76 ms 5.7% 22.04 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 19.08 ms 19.59 ms 2.7% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 20.04 ms 20.28 ms 1.2% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.08 ms 9.60 ms -4.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 13.52 ms 16.03 ms 18.6% 2.00 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-cold-store pacquet 3049.93 ms 2978.24 ms -2.4% 152.50 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1752.15 ms 1723.45 ms -1.6% 87.61 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 1216.98 ms 996.48 ms -18.1% 60.85 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 437.28 ms 495.53 ms 13.3% 21.86 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-hot-store pacquet 1966.75 ms 1852.29 ms -5.8% 98.34 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 417.57 ms 450.90 ms 8.0% 20.88 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pacquet 312.14 ms 330.60 ms 5.9% 15.61 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 106.40 ms 110.33 ms 3.7% 5.32 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 258.99 ms 284.92 ms 10.0% 12.95 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 160.36 ms 148.07 ms -7.7% 8.02 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 151.45 ms 126.01 ms -16.8% 7.57 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 5167.93 ms 5312.79 ms 2.8% 258.40 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 4124.53 ms 4120.51 ms -0.1% 206.23 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 207.34 ms 207.47 ms 0.1% 10.37 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 231.12 ms 233.35 ms 1.0% 11.56 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1525.80 ms 1575.71 ms 3.3% 76.29 ms Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet 48.26 ms 51.28 ms 6.2% 2.41 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: 7abd13accf6b

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.295 ± 0.357 2.834 3.896 1.63 ± 0.25
pacquet@main 3.133 ± 0.273 2.784 3.592 1.55 ± 0.22
pnpr@HEAD 2.026 ± 0.221 1.715 2.361 1.00
pnpr@main 2.114 ± 0.197 1.791 2.364 1.04 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.2951742304200002,
      "stddev": 0.3567389196681488,
      "median": 3.37184678192,
      "user": 3.4375944599999997,
      "system": 2.52836996,
      "min": 2.83397121642,
      "max": 3.8959179064200002
    },
    {
      "command": "pacquet@main",
      "mean": 3.13256087942,
      "stddev": 0.2733418803892817,
      "median": 3.17110150342,
      "user": 3.48464896,
      "system": 2.4988969599999997,
      "min": 2.78406679442,
      "max": 3.59181020942
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.0256548416199998,
      "stddev": 0.22129664236668803,
      "median": 2.00073166692,
      "user": 3.05780576,
      "system": 2.53381396,
      "min": 1.71537966242,
      "max": 2.3614046604200003
    },
    {
      "command": "pnpr@main",
      "mean": 2.1136491741200003,
      "stddev": 0.19650705712531896,
      "median": 2.2003896439200004,
      "user": 3.1988221599999997,
      "system": 2.6430212600000003,
      "min": 1.79117842142,
      "max": 2.36446831742
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 438.6 ± 36.9 378.0 514.0 1.10 ± 0.11
pacquet@main 398.6 ± 19.7 371.2 433.5 1.00
pnpr@HEAD 482.4 ± 41.7 440.7 572.3 1.21 ± 0.12
pnpr@main 437.9 ± 30.6 397.3 470.6 1.10 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4385690136,
      "stddev": 0.03692517974670612,
      "median": 0.4403257608,
      "user": 0.5394196599999999,
      "system": 0.94327326,
      "min": 0.37802033030000004,
      "max": 0.5139582833
    },
    {
      "command": "pacquet@main",
      "mean": 0.39859509340000004,
      "stddev": 0.019652253267982662,
      "median": 0.4008555373,
      "user": 0.48786845999999995,
      "system": 0.8981155599999999,
      "min": 0.37115720430000004,
      "max": 0.4334693593
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.48237714470000004,
      "stddev": 0.04174403679734478,
      "median": 0.46576078880000005,
      "user": 0.54840316,
      "system": 1.0018381599999997,
      "min": 0.4407103893,
      "max": 0.5722934203000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.4379279689000001,
      "stddev": 0.030619011441894488,
      "median": 0.4407619838,
      "user": 0.48138696000000003,
      "system": 0.91557586,
      "min": 0.3972772103,
      "max": 0.4705856223
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 19.8 ± 4.4 13.0 33.8 1.02 ± 0.30
pacquet@main 19.5 ± 3.7 12.2 27.8 1.00
pnpr@HEAD 19.7 ± 3.7 12.7 28.0 1.01 ± 0.27
pnpr@main 20.1 ± 3.3 13.9 27.5 1.03 ± 0.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.019847677605909088,
      "stddev": 0.004366980676455497,
      "median": 0.019592550640000005,
      "user": 0.010367257272727273,
      "system": 0.011149601136363636,
      "min": 0.012986930640000002,
      "max": 0.03377230264
    },
    {
      "command": "pacquet@main",
      "mean": 0.019455082963076926,
      "stddev": 0.003691751300792604,
      "median": 0.019080578640000005,
      "user": 0.010179203076923072,
      "system": 0.010879032153846148,
      "min": 0.01218460464,
      "max": 0.027817709640000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.0196824743369697,
      "stddev": 0.0036516525797490773,
      "median": 0.020278111640000002,
      "user": 0.010113290101010104,
      "system": 0.011123211919191911,
      "min": 0.012699362640000001,
      "max": 0.028036762640000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.02006469887076924,
      "stddev": 0.0032830895252461945,
      "median": 0.02003578564,
      "user": 0.009880895384615385,
      "system": 0.011794223076923077,
      "min": 0.013948501640000001,
      "max": 0.027507293640000003
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.8 ± 1.1 8.0 13.0 1.00
pacquet@main 10.5 ± 1.8 7.9 19.6 1.07 ± 0.22
pnpr@HEAD 16.1 ± 3.1 9.3 24.4 1.64 ± 0.36
pnpr@main 14.2 ± 2.6 10.7 22.9 1.45 ± 0.32
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009809012070769224,
      "stddev": 0.0011136989508921072,
      "median": 0.00959750824,
      "user": 0.00589428,
      "system": 0.004765019,
      "min": 0.00798958824,
      "max": 0.01297505524
    },
    {
      "command": "pacquet@main",
      "mean": 0.010464297711482889,
      "stddev": 0.001791730212930965,
      "median": 0.01008395724,
      "user": 0.006383035893536117,
      "system": 0.004964861977186311,
      "min": 0.00787741824,
      "max": 0.019568034240000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.016102010150931174,
      "stddev": 0.0030720772580534886,
      "median": 0.016030361240000002,
      "user": 0.009011333441295536,
      "system": 0.008459753684210527,
      "min": 0.00925340624,
      "max": 0.024373341240000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.014245007054606738,
      "stddev": 0.0026383710300342585,
      "median": 0.01351687474,
      "user": 0.0081807395505618,
      "system": 0.007201136629213484,
      "min": 0.01069626924,
      "max": 0.02289890824
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.989 ± 0.091 2.880 3.201 1.70 ± 0.08
pacquet@main 3.049 ± 0.083 2.926 3.164 1.74 ± 0.08
pnpr@HEAD 1.756 ± 0.091 1.655 1.903 1.00 ± 0.07
pnpr@main 1.754 ± 0.069 1.632 1.863 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.9888040950200003,
      "stddev": 0.09088299745483289,
      "median": 2.97823837102,
      "user": 4.12257774,
      "system": 2.66414392,
      "min": 2.87989834152,
      "max": 3.20146986952
    },
    {
      "command": "pacquet@main",
      "mean": 3.0492105280200006,
      "stddev": 0.08291309315516095,
      "median": 3.04993270752,
      "user": 4.300797740000001,
      "system": 2.6644249199999996,
      "min": 2.92615632952,
      "max": 3.16353866852
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.75631486332,
      "stddev": 0.09098159449417281,
      "median": 1.72344779152,
      "user": 3.12728964,
      "system": 2.24823902,
      "min": 1.6553589185200002,
      "max": 1.9028250125200001
    },
    {
      "command": "pnpr@main",
      "mean": 1.7536132499200001,
      "stddev": 0.06883819406657037,
      "median": 1.75215367402,
      "user": 3.0008795399999997,
      "system": 2.19786302,
      "min": 1.63200867852,
      "max": 1.86347140652
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.041 ± 0.177 0.861 1.422 2.39 ± 0.44
pacquet@main 1.255 ± 0.222 1.015 1.725 2.89 ± 0.55
pnpr@HEAD 0.527 ± 0.087 0.419 0.675 1.21 ± 0.22
pnpr@main 0.435 ± 0.030 0.386 0.480 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.04069181824,
      "stddev": 0.17653498866331246,
      "median": 0.99648181124,
      "user": 1.48324786,
      "system": 1.35295396,
      "min": 0.86095116724,
      "max": 1.4223272042400001
    },
    {
      "command": "pacquet@main",
      "mean": 1.2547898161400002,
      "stddev": 0.2219711013228713,
      "median": 1.2169803157400003,
      "user": 1.6022490600000001,
      "system": 1.4390441600000001,
      "min": 1.0148144082400001,
      "max": 1.7254210572400002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.52660798384,
      "stddev": 0.08741902386863747,
      "median": 0.49552518324,
      "user": 0.49916675999999993,
      "system": 0.9175961599999999,
      "min": 0.41942839024,
      "max": 0.6751690112400001
    },
    {
      "command": "pnpr@main",
      "mean": 0.43477302654,
      "stddev": 0.030113140954023475,
      "median": 0.43728078124,
      "user": 0.43486046,
      "system": 0.80291856,
      "min": 0.38600289124,
      "max": 0.47957441624
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.873 ± 0.127 1.713 2.092 4.54 ± 0.51
pacquet@main 1.990 ± 0.178 1.753 2.276 4.83 ± 0.62
pnpr@HEAD 0.447 ± 0.030 0.397 0.500 1.09 ± 0.12
pnpr@main 0.412 ± 0.038 0.366 0.473 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8734319769199999,
      "stddev": 0.12657494644515097,
      "median": 1.8522930237200002,
      "user": 1.34533448,
      "system": 1.197068,
      "min": 1.7128131717200001,
      "max": 2.09182233672
    },
    {
      "command": "pacquet@main",
      "mean": 1.9900153482199996,
      "stddev": 0.1775224233341118,
      "median": 1.9667452242199999,
      "user": 1.54166688,
      "system": 1.2796615999999998,
      "min": 1.75268120072,
      "max": 2.2760981117199997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.44747691032,
      "stddev": 0.029702410462735543,
      "median": 0.45090399872000003,
      "user": 0.42540737999999995,
      "system": 0.8284146,
      "min": 0.39704996172,
      "max": 0.49994337272000006
    },
    {
      "command": "pnpr@main",
      "mean": 0.41233568462000003,
      "stddev": 0.03752292483700905,
      "median": 0.41756865722000003,
      "user": 0.40666138000000007,
      "system": 0.7774091999999999,
      "min": 0.36583411872000005,
      "max": 0.47277434772000004
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 350.1 ± 52.4 310.6 490.3 3.35 ± 0.53
pacquet@main 315.8 ± 13.1 298.9 334.6 3.02 ± 0.20
pnpr@HEAD 111.6 ± 6.0 98.4 123.5 1.07 ± 0.08
pnpr@main 104.5 ± 5.4 95.3 112.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.35012338362000006,
      "stddev": 0.05239880286949417,
      "median": 0.33059628782000006,
      "user": 0.35016433999999996,
      "system": 0.15383693999999998,
      "min": 0.31060338732000004,
      "max": 0.49029734632000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.31575886552000004,
      "stddev": 0.013137566601114679,
      "median": 0.31213817582000003,
      "user": 0.31827194,
      "system": 0.12831343999999997,
      "min": 0.29887752932,
      "max": 0.33462133032
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11164924062769234,
      "stddev": 0.005998479724305591,
      "median": 0.11033165132,
      "user": 0.04698635538461538,
      "system": 0.02171435538461538,
      "min": 0.09844207432,
      "max": 0.12347395132000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.10453240560000002,
      "stddev": 0.005426319383070761,
      "median": 0.10639560732000002,
      "user": 0.043433780000000005,
      "system": 0.018479480000000003,
      "min": 0.09525028732000002,
      "max": 0.11222607132000001
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 288.9 ± 24.5 252.8 327.9 1.09 ± 0.13
pacquet@main 265.3 ± 22.1 241.4 314.1 1.00
pnpm@HEAD 5549.6 ± 823.2 4465.1 6984.7 20.92 ± 3.56
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.28885886866,
      "stddev": 0.02450063881075662,
      "median": 0.28492166666,
      "user": 0.28980643333333334,
      "system": 0.07812683555555555,
      "min": 0.25280834366,
      "max": 0.32786193166
    },
    {
      "command": "pacquet@main",
      "mean": 0.26525868799333335,
      "stddev": 0.022134406124391322,
      "median": 0.25898818466,
      "user": 0.27992165555555554,
      "system": 0.060499279999999996,
      "min": 0.24143471766000002,
      "max": 0.31411803166
    },
    {
      "command": "pnpm@HEAD",
      "mean": 5.549572879326667,
      "stddev": 0.823162727444264,
      "median": 5.396026060660001,
      "user": 8.803031988888888,
      "system": 0.5339923911111111,
      "min": 4.46505048866,
      "max": 6.98472477566
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 151.6 ± 24.2 118.0 209.2 1.00
pacquet@main 167.1 ± 30.4 119.1 223.9 1.10 ± 0.27
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1515874161955556,
      "stddev": 0.02416137163593078,
      "median": 0.14806975064,
      "user": 0.13634329333333334,
      "system": 0.07569000444444444,
      "min": 0.11803783314,
      "max": 0.20916885114000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.1670758644316667,
      "stddev": 0.030401226149308423,
      "median": 0.16036240564,
      "user": 0.14407941833333332,
      "system": 0.08588414333333333,
      "min": 0.11913662514000001,
      "max": 0.22387759614000002
    }
  ]
}

Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 126.0 ± 6.9 115.0 139.2 1.00
pacquet@main 150.9 ± 15.0 129.1 180.4 1.20 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12602991054333335,
      "stddev": 0.00686705038635747,
      "median": 0.12600562896,
      "user": 0.054706078333333324,
      "system": 0.08182991166666666,
      "min": 0.11499169046,
      "max": 0.13915969246
    },
    {
      "command": "pacquet@main",
      "mean": 0.1509366129863158,
      "stddev": 0.015025503925308189,
      "median": 0.15144649446,
      "user": 0.06656675157894737,
      "system": 0.09688712,
      "min": 0.12913929146,
      "max": 0.18039562746
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.311 ± 0.242 4.903 5.603 1.30 ± 0.09
pacquet@main 5.408 ± 0.519 4.979 6.431 1.32 ± 0.14
pnpr@HEAD 4.162 ± 0.263 3.733 4.491 1.02 ± 0.08
pnpr@main 4.088 ± 0.213 3.700 4.431 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.31098934552,
      "stddev": 0.2419776076495823,
      "median": 5.31279309562,
      "user": 3.5370676800000007,
      "system": 2.60741642,
      "min": 4.90267701162,
      "max": 5.60273659262
    },
    {
      "command": "pacquet@main",
      "mean": 5.40849154802,
      "stddev": 0.5192863748630484,
      "median": 5.16793297062,
      "user": 3.5238746799999996,
      "system": 2.60655272,
      "min": 4.97899164562,
      "max": 6.43078667562
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.16212768572,
      "stddev": 0.2628633071695536,
      "median": 4.12051013612,
      "user": 3.02857758,
      "system": 2.34975222,
      "min": 3.7330110436200004,
      "max": 4.49125119462
    },
    {
      "command": "pnpr@main",
      "mean": 4.08841108412,
      "stddev": 0.21307623004758072,
      "median": 4.1245275366200005,
      "user": 2.9493082799999994,
      "system": 2.26291382,
      "min": 3.69978074562,
      "max": 4.43118966662
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 203.7 ± 14.1 176.6 219.3 1.00
pacquet@main 207.7 ± 14.9 175.1 226.5 1.02 ± 0.10
pnpr@HEAD 231.5 ± 20.9 204.5 258.8 1.14 ± 0.13
pnpr@main 251.2 ± 62.7 203.9 416.8 1.23 ± 0.32
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20368091926333334,
      "stddev": 0.014051879313882456,
      "median": 0.20746667818,
      "user": 0.23403791,
      "system": 0.19084676666666664,
      "min": 0.17655175518,
      "max": 0.21927475818
    },
    {
      "command": "pacquet@main",
      "mean": 0.2077407682709091,
      "stddev": 0.014911338553735914,
      "median": 0.20733761818000002,
      "user": 0.2568349781818182,
      "system": 0.1795872818181818,
      "min": 0.17510192118,
      "max": 0.22648233018
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2315042972709091,
      "stddev": 0.02090564833657838,
      "median": 0.23334613118,
      "user": 0.25838597818181824,
      "system": 0.21016837272727276,
      "min": 0.20453468718,
      "max": 0.25884893118
    },
    {
      "command": "pnpr@main",
      "mean": 0.2512270718163636,
      "stddev": 0.06269762024689461,
      "median": 0.23112255218,
      "user": 0.29043634181818184,
      "system": 0.21619473636363634,
      "min": 0.20387338818,
      "max": 0.41677420618
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.574 ± 0.057 1.472 1.656 1.02 ± 0.07
pacquet@main 1.541 ± 0.082 1.431 1.683 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.5739962223200001,
      "stddev": 0.0566018372545303,
      "median": 1.57570872702,
      "user": 1.1471778999999998,
      "system": 0.40089828,
      "min": 1.4718278175200001,
      "max": 1.6558148535200001
    },
    {
      "command": "pacquet@main",
      "mean": 1.5407323799200001,
      "stddev": 0.08150427968755405,
      "median": 1.52580462802,
      "user": 1.0736884999999998,
      "system": 0.3671762799999999,
      "min": 1.4313217305200001,
      "max": 1.68286865252
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 52.0 ± 6.0 43.0 66.9 1.05 ± 0.18
pacquet@main 49.5 ± 6.2 40.2 66.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.05201881873310346,
      "stddev": 0.005965595122528254,
      "median": 0.051276874439999995,
      "user": 0.03784849517241378,
      "system": 0.027274513793103444,
      "min": 0.042963394440000004,
      "max": 0.06685406344
    },
    {
      "command": "pacquet@main",
      "mean": 0.04948131019000002,
      "stddev": 0.0062273273620800824,
      "median": 0.04826106544,
      "user": 0.035172640000000005,
      "system": 0.02702193333333334,
      "min": 0.04024732944,
      "max": 0.06619327944
    }
  ]
}

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.11%. Comparing base (dad931d) to head (c52a64b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17295   +/-   ##
=======================================
  Coverage   93.11%   93.11%           
=======================================
  Files        2193     2193           
  Lines      278356   278356           
=======================================
+ Hits       259184   259201   +17     
+ Misses      19172    19155   -17     

☔ 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.

@garnet-runtime-review

garnet-runtime-review Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Nothing new recorded

1 job recorded · compared with the last 10 runs on main

TS CI / Test / ubuntu (24.0.0, 2) / Node 24 / chunk 2/3
 ↳ nothing new

Workload · last 10 runs on main → c52a64b

  systemd › bash › bash
  ├─ bash › bash › bash › bash
  │  ├─ bash
  │  │  ├─ gh
  │  │  │  └─ api.github[.]com
  │  │  └─ node
  │  │     ├─ git
  │  │     │  ├─ git › git › git-remote-http
  │  │     │  │  └─ github[.]com
  │  │     │  └─ 192.168.127[.]1
  │  │     └─ pn
  │  │        ├─ dash › node › pn
  │  │        │  ├─ dash › pn › dash › pnpm › dash › node
  │  │        │  │  ├─ codeload.github[.]com
  │  │        │  │  └─ registry.npmjs[.]org
  │  │        │  └─ node
  │  │        │     ├─ dash › dash › node
  │  │        │     │  └─ nodejs[.]org
  │  │        │     ├─ git
  │  │        │     │  └─ 192.168.127[.]1
  │  │        │     ├─ node
  │  │        │     │  ├─ git › git › git-remote-http
  │  │        │     │  │  └─ github[.]com
  │  │        │     │  ├─ pacquet
  │  │        │     │  │  └─ registry.npmjs[.]org
  │  │        │     │  ├─ codeload.github[.]com
  │  │        │     │  ├─ github[.]com
  │  │        │     │  ├─ registry.npmjs[.]org
  │  │        │     │  └─ unofficial-builds.nodejs[.]org
  │  │        │     ├─ pnpr
  │  │        │     │  └─ registry.npmjs[.]org
  │  │        │     ├─ codeload.github[.]com
  │  │        │     └─ registry.npmjs[.]org
  │  │        └─ nodejs[.]org
  │  └─ node
  │     ├─ node
  │     │  └─ registry.npmjs[.]org
  │     ├─ pnpm
  │     │  ├─ dash › node › dash › node
  │     │  │  └─ nodejs[.]org
  │     │  ├─ git
  │     │  │  ├─ git › git › git-remote-http
  │     │  │  │  └─ github[.]com
  │     │  │  └─ 192.168.127[.]1
  │     │  ├─ dualstack.k.sni.global.fastly[.]net
  │     │  └─ registry.npmjs[.]org
  │     ├─ blacksmith.blob.core.windows[.]net
  │     └─ registry.npmjs[.]org
  └─ 192.168.127[.]1

  bash
  ├─ rustup
  │  └─ dualstack.k.sni.global.fastly[.]net
  └─ MainThread › pn › dash › node
     ├─ node › node
     │  ├─ dash › node
     │  │  └─ registry.npmjs[.]org
     │  ├─ git
     │  │  ├─ git › git › git-remote-http
     │  │  │  └─ github[.]com
     │  │  └─ 192.168.127[.]1
     │  ├─ node
     │  │  ├─ node
     │  │  │  ├─ node › git › git-remote-http
     │  │  │  │  └─ github[.]com
     │  │  │  └─ 192.168.127[.]1
     │  │  ├─ codeload.github[.]com
     │  │  └─ github[.]com
     │  ├─ codeload.github[.]com
     │  ├─ github[.]com
     │  ├─ nodejs[.]org
     │  ├─ registry.npmjs[.]org
     │  └─ unofficial-builds.nodejs[.]org
     └─ pn › node
        ├─ dash › node
        │  └─ registry.npmjs[.]org
        ├─ pnpr
        │  └─ registry.npmjs[.]org
        ├─ codeload.github[.]com
        ├─ github[.]com
        └─ registry.npmjs[.]org

  node › pnpm
  ├─ nodejs[.]org
  └─ unofficial-builds.nodejs[.]org

Runner & GitHub's own traffic · blacksmith-8vcpu-ubuntu-2404 · Linux x86_64

  systemd
  ├─ chronyd
  │  ├─ 104.131.155[.]175
  │  ├─ 162.159.200[.]123
  │  ├─ 169[.]254[.]169[.]123
  │  ├─ 185.125.190[.]56
  │  ├─ 185.125.190[.]57
  │  ├─ 185.125.190[.]58
  │  ├─ 198.137.202[.]32
  │  ├─ 23.143.196[.]200
  │  ├─ 45.79.111[.]167
  │  ├─ 66.42.71[.]197
  │  ├─ 91.189.91[.]157
  │  ├─ 96.245.170[.]99
  │  └─ 96.245.54[.]151
  ├─ nginx › nginx
  │  ├─ 140.82.112[.]21
  │  ├─ 140.82.112[.]22
  │  ├─ 140.82.113[.]21
  │  ├─ 140.82.114[.]21
  │  ├─ 140.82.114[.]22
  │  ├─ 192.168.127[.]1
  │  ├─ 8.8.8[.]8
  │  └─ results-receiver.actions[.]githubusercontent (github infra)
  ├─ bash › bash › bash › bash › bash › bash › node
  │  └─ productionresultssa14.blob.core[.]windows (github infra)
  ├─ snapd
  │  └─ api.snapcraft[.]io
  ├─ sudo
  │  ├─ blacksmithd
  │  │  └─ 192.168.127[.]1
  │  └─ sudo
  │     └─ 192.168.127[.]1
  └─ systemd-resolve
     └─ 8.8.8[.]8

  MainThread
  └─ productionresultssa18.blob.core[.]windows (github infra)

Job log · Full record in Garnet ↗

How to read this
bash › curl                 ← ancestry as captured, then the process that acted
└─ example[.]com            ← what it reached

Read down: what ran, then what it reached. + only in this commit · − only in the compared run · unmarked in both. Runner & GitHub's own traffic is activity outside your steps and never counts. Recorded at the kernel, best-effort capture. · Docs ↗

Recorded by Garnet · Add it to your CI ↗

The resolver fix for pnpm#17280 landed in pnpm#17297, which
tags a workspace: specifier "workspace" in the local resolver. This
keeps the extra coverage: relative workspace: paths with default and
named catalogs, injection through injectWorkspacePackages and through
dependenciesMeta, and the rejection of catalog: references in ordinary
file: dependencies, in both CLIs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zkochan
zkochan force-pushed the fix/relative-injected-workspace-catalogs branch from 7abd13a to c52a64b Compare November 8, 2026 01:06
@zkochan zkochan changed the title fix(catalogs): resolve relative injected workspace dependencies test(catalogs): cover catalog inheritance of injected workspace packages Nov 8, 2026
@zkochan

zkochan commented Nov 8, 2026

Copy link
Copy Markdown
Member

Rebased onto main and reworked. Status:

  • The resolver fix for Named catalog dependencies in a relative injected workspace package fail during resolution #17280 already landed on main in fix(local-resolver): resolve catalog dependencies of a package injected by a relative workspace path #17297. It makes the local resolver tag a workspace: specifier resolvedVia: "workspace", so the resolved_via == "local-filesystem" plus workspace: check this PR added could no longer run. I removed the TS and Rust resolver changes and the changeset (that fix already shipped with its own changeset).
  • I kept the tests, because they cover cases the merged fix does not: default and named catalogs with relative workspace: paths, injection through dependenciesMeta and through injectWorkspacePackages, and ordinary file: dependencies still rejecting catalog:. I resolved the conflicts with main's new tests by keeping both sets. The title and description now say the PR is test-only.
  • CI on c52a64b: all 50 checks pass, 1 skipped. The TS CI timeouts reported earlier did not happen again.
  • Review: no inline threads or review findings on this PR. CodeRabbit skips drafts, and no other reviewer has posted findings. I kept the PR as a draft, so I did not start a new automated review round. A maintainer can mark it ready, or close it if the extra coverage isn't wanted.

Nothing else is left to do on this PR.


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

@zkochan
zkochan marked this pull request as ready for review November 21, 2026 01:51
@zkochan
zkochan self-requested a review as a code owner November 21, 2026 01:51
@qodo-code-review

qodo-code-review Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Test catalog inheritance for injected workspace packages in v11 and v12

🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Cover default and named catalogs in injected relative workspace dependencies across both CLIs.
• Verify catalog resolution through global injection and per-dependency metadata.
• Confirm ordinary file dependencies still reject catalog references, even when marked injected.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • No production behavior changes identified.
Behavioral complexity 🟢 Low 🧩 Assessed behavior

  • No production behavior changes identified.
Potential damage 🟢 Low 🩹 Assessed behavior

  • No production behavior changes identified.
Assessed commit c52a64b
Diagram

graph TD
  tests["v11 and v12 tests"] --> protocol{"Dependency protocol"}
  protocol -->|workspace| injected["Injected package"] --> catalog["Workspace catalog"] --> snapshot["Resolved snapshot"]
  protocol -->|file| ordinary["Ordinary file dependency"] --> error["Unsupported protocol"]
Loading
High-Level Assessment

Keep the scenario-based tests and shared fixtures. They cover the resolver behavior already fixed elsewhere while protecting the distinction between injected workspace dependencies and ordinary file dependencies; no additional production change is warranted.

Files changed (2) +168 / -14

Tests (2) +168 / -14
catalogs.rsCover relative workspace catalogs and file-dependency rejection in v12 +113/-0

Cover relative workspace catalogs and file-dependency rejection in v12

• Adds fixtures and tests for default and named catalogs in relatively referenced workspace packages injected globally or through dependency metadata. Checks lockfile-only, regular, and frozen installs, the resolved snapshot, and unchanged peer manifests; also verifies that ordinary file dependencies fail with an unsupported-protocol error.

pnpm/crates/cli/tests/suite/inject_workspace_packages/catalogs.rs

catalogs.tsExpand v11 catalog tests across workspace specifiers and injection modes +55/-14

Expand v11 catalog tests across workspace specifiers and injection modes

• Parameterizes existing injected-package tests to cover relative workspace paths with default and named catalogs under both injection settings. Adds negative cases confirming that file dependencies reject catalog references regardless of their injected metadata.

pnpm11/installing/deps-installer/test/catalogs.ts

@qodo-code-review

qodo-code-review Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

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.

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only PR appears safe to merge.

Reviews (2) · Last reviewed commit: "test(catalogs): cover catalog inheritanc..." · Reviewed by Greptile

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Nov 21, 2026
@zkochan
zkochan merged commit e58eac5 into pnpm:main Nov 21, 2026
57 checks passed
zkochan added a commit that referenced this pull request Nov 21, 2026
…18290)

The resolver passed the child specifiers of every file: directory package
through the importer's catalogs, however the package was declared. An
ordinary file: dependency outside the workspace therefore resolved its
catalog: specifiers instead of failing with ERR_PNPM_UNSUPPORTED_PROTOCOL,
which pnpm v11 reports. The test added in #17295 has failed on
main since it landed.

Catalogs now apply to a directory package's children only when it was
resolved through a workspace: specifier, as in pnpm v11, or when its
directory is a workspace project. The second case keeps the v12 behavior
for a workspace project injected by a file: or bare path, which the
injected freshness matrix covers and pnpm v11 does not support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants