Repository navigation
feat(resolver): emit pnpm:deprecation events for deprecated packages - #13135
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
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:
📝 WalkthroughWalkthroughThis change adds package deprecation events to dependency resolution, forwards them through fresh-lockfile installs, serializes them as ChangesPackage deprecation reporting
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Resolver as WorkspaceTreeCtx
participant Install as install_with_fresh_lockfile
participant Reporter as ReporterState
Resolver->>Resolver: inspect resolved manifest
Resolver->>Install: emit Deprecation
Install->>Reporter: send LogEvent::Deprecation
Reporter->>Reporter: render direct or buffer transitive event
Install->>Reporter: send Stage::ResolutionDone
Reporter->>Reporter: flush transitive summary
Suggested labels: 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 |
Confidence Score: 4/5The two blocking issues from prior rounds are fixed; one display-layer edge case remains in concurrent resolution for packages that appear as both direct and transitive dependencies. The core logic is correct and well-tested. The remaining concern is a reporter display race: when a package is resolved concurrently as a transitive dep before its direct dep, it can appear in both the immediate per-package warning and the subdep summary line — a visual inconsistency, not a functional failure. pnpm/crates/default-reporter/src/state.rs — the interaction between deprecated_subdeps buffering and the deprecation_depths re-emit mechanism for the direct+transitive case. Reviews (8): Last reviewed commit: "fix(resolver): drop unnecessary block sc..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@pnpm/crates/default-reporter/src/state.rs`:
- Around line 1105-1124: Update flush_deprecated_subdeps to deduplicate the
formatted package names after sorting and before joining them for the summary.
Preserve the existing ordering and count behavior unless the count is intended
to represent displayed unique names.
In `@pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs`:
- Around line 1683-1716: Extract the package name and version from
result.name_ver before the deprecation check, using alias and an empty-string
fallback as appropriate. Pass the extracted pkg_version, not deprecated, as the
second argument to is_deprecation_allowed, and reuse the extracted pkg_name and
pkg_version when constructing Deprecation.
🪄 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: 7e6d2ade-efcb-4c6a-b2a6-f0d3d2504ccc
📒 Files selected for processing (8)
pnpm/crates/default-reporter/src/state.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/reporter/src/lib.rspnpm/crates/reporter/src/tests.rspnpm/crates/resolving-deps-resolver/src/lib.rspnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13135 +/- ##
==========================================
+ Coverage 85.64% 85.68% +0.03%
==========================================
Files 505 505
Lines 83652 83870 +218
==========================================
+ Hits 71647 71863 +216
- Misses 12005 12007 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.51512339812,
"stddev": 0.12546282195137012,
"median": 2.50555680172,
"user": 1.5122025399999999,
"system": 1.3227310199999998,
"min": 2.36676762072,
"max": 2.70108384172,
"times": [
2.45658678172,
2.55452682172,
2.40810795172,
2.57110952172,
2.36676762072,
2.39141930072,
2.70108384172,
2.61199230072,
2.68457252672,
2.40506731372
]
},
{
"command": "pacquet@main",
"mean": 2.53887568042,
"stddev": 0.15568958698070987,
"median": 2.52884416372,
"user": 1.5133869399999997,
"system": 1.31701012,
"min": 2.3498044827199998,
"max": 2.77290101872,
"times": [
2.77290101872,
2.43506662872,
2.63650930972,
2.68129074372,
2.61070985472,
2.35939169772,
2.40477182172,
2.69133277372,
2.44697847272,
2.3498044827199998
]
},
{
"command": "pnpr@HEAD",
"mean": 1.50383114502,
"stddev": 0.13219592183129217,
"median": 1.47980789122,
"user": 1.0718684399999998,
"system": 1.1502895199999998,
"min": 1.3560374897199998,
"max": 1.69647535572,
"times": [
1.64955460372,
1.5070449907199999,
1.53483717672,
1.69647535572,
1.3560374897199998,
1.35615302772,
1.45257079172,
1.68017087072,
1.39417546472,
1.41129167872
]
},
{
"command": "pnpr@main",
"mean": 1.4645675270199998,
"stddev": 0.12929782750940022,
"median": 1.4082728377199998,
"user": 1.04758094,
"system": 1.20289262,
"min": 1.35386081972,
"max": 1.75618209272,
"times": [
1.3616470677199999,
1.75618209272,
1.49397074272,
1.62631341272,
1.39549310872,
1.43830686072,
1.35386081972,
1.4074282117199999,
1.40911746372,
1.40335548972
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25991462656000003,
"stddev": 0.004526288935471973,
"median": 0.25923930936000006,
"user": 0.20954994000000005,
"system": 0.55317522,
"min": 0.25318121486000006,
"max": 0.27002401486000005,
"times": [
0.25991317486000004,
0.25678804286000007,
0.27002401486000005,
0.25856544386,
0.26130311586000005,
0.25739590886,
0.25775336386000003,
0.26326431186000004,
0.25318121486000006,
0.26095767386
]
},
{
"command": "pacquet@main",
"mean": 0.25328716526,
"stddev": 0.003642685634791523,
"median": 0.25311221936000006,
"user": 0.20018634,
"system": 0.5396462200000001,
"min": 0.24922963586000002,
"max": 0.25880505586,
"times": [
0.25020897186,
0.24922963586000002,
0.25825816486000003,
0.25880505586,
0.25381844586,
0.25572246486000005,
0.25240599286000004,
0.24949637786,
0.25525688686000003,
0.24966965586000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27322006666,
"stddev": 0.006253034855491303,
"median": 0.2721774128600001,
"user": 0.21921633999999995,
"system": 0.5390299199999999,
"min": 0.26381278486000004,
"max": 0.28573908686000005,
"times": [
0.27218419586000003,
0.28088304386000007,
0.27103501986000006,
0.26881329186,
0.27217062986000007,
0.27546014186000006,
0.28573908686000005,
0.26915836286000006,
0.26381278486000004,
0.27294410886000003
]
},
{
"command": "pnpr@main",
"mean": 0.26281327846,
"stddev": 0.01048748537895668,
"median": 0.2599017773600001,
"user": 0.22231773999999999,
"system": 0.51318932,
"min": 0.25353693586000003,
"max": 0.28484479186000006,
"times": [
0.25532025686000004,
0.25480982486000003,
0.25353693586000003,
0.27412989386000003,
0.26052039886000006,
0.25383031886,
0.26081203886000004,
0.25928315586000006,
0.27104516886,
0.28484479186000006
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7113072182,
"stddev": 0.01764491206548556,
"median": 2.7147027932,
"user": 1.62346982,
"system": 1.3137085,
"min": 2.6748324942,
"max": 2.7412585142,
"times": [
2.6913145272,
2.7148012612,
2.7166397362,
2.7412585142,
2.7190458822,
2.7185249801999998,
2.7086550052,
2.6748324942,
2.7146043252,
2.7133954561999998
]
},
{
"command": "pacquet@main",
"mean": 2.7159746248000003,
"stddev": 0.016205505905094602,
"median": 2.7127500572,
"user": 1.59221922,
"system": 1.3199029,
"min": 2.6975532612,
"max": 2.7488391632,
"times": [
2.7186003832,
2.7152203862,
2.6975532612,
2.7304109042,
2.7488391632,
2.7102797281999997,
2.7057276922,
2.7290940132,
2.7057998382,
2.6982208782
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5326054640999998,
"stddev": 0.13105449095267904,
"median": 1.5012072616999999,
"user": 1.02108782,
"system": 1.1212788999999999,
"min": 1.3960809902,
"max": 1.7243553301999999,
"times": [
1.3960809902,
1.4094310501999998,
1.6613906762,
1.4076707741999999,
1.7243553301999999,
1.6667323401999998,
1.4035823212,
1.5146712052,
1.6543966352,
1.4877433182
]
},
{
"command": "pnpr@main",
"mean": 1.4611862937,
"stddev": 0.110450460570966,
"median": 1.4180949836999999,
"user": 1.02011002,
"system": 1.1178234999999999,
"min": 1.3729539342,
"max": 1.7375555511999998,
"times": [
1.3875059591999999,
1.3982512172,
1.4379387501999998,
1.3893730352,
1.4952497592,
1.3917229281999999,
1.4738190251999999,
1.5274927772,
1.3729539342,
1.7375555511999998
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5651125863,
"stddev": 0.01234773025212758,
"median": 0.5624264389,
"user": 0.66803846,
"system": 0.7028109200000001,
"min": 0.5513551774000001,
"max": 0.5940630054,
"times": [
0.5755279234,
0.5665775944,
0.5513551774000001,
0.5589563264,
0.5658965514000001,
0.5940630054,
0.5560932574,
0.5672322164,
0.5580887354,
0.5573350754
]
},
{
"command": "pacquet@main",
"mean": 0.5488663615,
"stddev": 0.010183849889925394,
"median": 0.5453325199000001,
"user": 0.65498946,
"system": 0.6776925199999999,
"min": 0.5388642144,
"max": 0.5677723534,
"times": [
0.5446440044,
0.5677723534,
0.5483673024000001,
0.5441548234,
0.5421473134,
0.5388642144,
0.5670924934,
0.5418727174000001,
0.5460210354,
0.5477273574
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30305793420000005,
"stddev": 0.008731754582447392,
"median": 0.3021780899,
"user": 0.18560625999999997,
"system": 0.54034922,
"min": 0.2900767984,
"max": 0.3176503564,
"times": [
0.2900767984,
0.3176503564,
0.3148575584,
0.3038600354,
0.30420082740000004,
0.2948223024,
0.29894202940000003,
0.3088422864,
0.3004961444,
0.2968310034
]
},
{
"command": "pnpr@main",
"mean": 0.29131251450000006,
"stddev": 0.006569637471379505,
"median": 0.28885194340000003,
"user": 0.18794496,
"system": 0.5053822200000001,
"min": 0.2833602584,
"max": 0.30065358540000003,
"times": [
0.2958274134,
0.30065358540000003,
0.2852472824,
0.29805126340000004,
0.28763985940000003,
0.2866005614,
0.2833602584,
0.29006402740000004,
0.2996758834,
0.28600501040000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.85061616574,
"stddev": 0.014506855817435469,
"median": 1.84770011724,
"user": 0.9089746999999999,
"system": 0.73058562,
"min": 1.83564952174,
"max": 1.88354774374,
"times": [
1.88354774374,
1.8438158757399998,
1.8472985557400001,
1.8357656387399999,
1.8586995227399998,
1.85876563774,
1.84810167874,
1.83564952174,
1.83868144274,
1.85583603974
]
},
{
"command": "pacquet@main",
"mean": 1.8448926456399999,
"stddev": 0.013737601816686588,
"median": 1.84548654774,
"user": 0.9066934999999999,
"system": 0.7254810199999998,
"min": 1.8237148377399999,
"max": 1.86910357374,
"times": [
1.8589378827399998,
1.83243545574,
1.83717993474,
1.83328585774,
1.8537659197399998,
1.86910357374,
1.8483350997399999,
1.84952989874,
1.8237148377399999,
1.84263799574
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29963566804,
"stddev": 0.007450622549020355,
"median": 0.29676281924000003,
"user": 0.19117309999999998,
"system": 0.53973242,
"min": 0.29224062774000004,
"max": 0.31832149074,
"times": [
0.29224062774000004,
0.31832149074,
0.29916502374000004,
0.30298634074,
0.29445707374,
0.30351990674,
0.29701823574,
0.29650740274,
0.29648555174,
0.29565502674
]
},
{
"command": "pnpr@main",
"mean": 0.29756985914,
"stddev": 0.005887995464960018,
"median": 0.29836740823999996,
"user": 0.1917411,
"system": 0.51832872,
"min": 0.28586274174,
"max": 0.30471380874000004,
"times": [
0.29677302274,
0.30285527674,
0.28586274174,
0.29043886574,
0.30309272374,
0.29513322274000003,
0.30009411274000003,
0.29882506074,
0.29790975574,
0.30471380874000004
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.326197516,
"stddev": 0.009887269662246161,
"median": 0.3279491828,
"user": 0.3241967,
"system": 0.04697216,
"min": 0.3094750308,
"max": 0.34467512180000004,
"times": [
0.34467512180000004,
0.3237615358,
0.31985715680000004,
0.32962738080000004,
0.3262709848,
0.3094750308,
0.3304446118,
0.32995474880000003,
0.3150481938,
0.3328603948
]
},
{
"command": "pacquet@main",
"mean": 0.3298128771,
"stddev": 0.009406647697545732,
"median": 0.3343949068,
"user": 0.31145199999999995,
"system": 0.06606856,
"min": 0.3149808868,
"max": 0.3397748068,
"times": [
0.33622093880000004,
0.32500461880000003,
0.3149808868,
0.3340704758,
0.3347193378,
0.31949432380000004,
0.31835124880000004,
0.3359224758,
0.3397748068,
0.3395896578
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08387921655,
"stddev": 0.001903120504783403,
"median": 0.08383507879999999,
"user": 0.019227006249999998,
"system": 0.0083872125,
"min": 0.0800785698,
"max": 0.0878788308,
"times": [
0.0878788308,
0.0835481988,
0.0858924368,
0.0859981368,
0.0868226908,
0.0859381938,
0.0835955478,
0.0853483208,
0.0814094488,
0.0852558378,
0.0845394168,
0.0830290608,
0.0823026908,
0.0821681678,
0.0835114688,
0.0851691328,
0.0845476528,
0.0857360818,
0.0811148418,
0.0847153578,
0.0809775638,
0.0824669198,
0.0828753508,
0.0839699828,
0.0844540358,
0.0837001748,
0.0800785698,
0.0852327038,
0.0854311768,
0.0835585888,
0.0822550508,
0.0806132968
]
},
{
"command": "pnpr@main",
"mean": 0.08319142770625,
"stddev": 0.0021564003998428075,
"median": 0.08264080830000001,
"user": 0.01874919375,
"system": 0.008047716874999998,
"min": 0.0797310948,
"max": 0.0888455818,
"times": [
0.0872405878,
0.0797310948,
0.0830460228,
0.0827172718,
0.0829189328,
0.0820032268,
0.0809349638,
0.0852972448,
0.0849059268,
0.0823150538,
0.0803988528,
0.0828113998,
0.0823976808,
0.0821626878,
0.0816407028,
0.0826618078,
0.0817792038,
0.0826916448,
0.0818852248,
0.0824943928,
0.0824776108,
0.0818865768,
0.0823874408,
0.0831170368,
0.0810535168,
0.0840789288,
0.08763541180000001,
0.0888455818,
0.0853981348,
0.0830520238,
0.0826198088,
0.0875396908
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.52507022952,
"stddev": 0.1362759130661958,
"median": 4.454670308320001,
"user": 1.7076401599999997,
"system": 1.3816381199999999,
"min": 4.4008320673200005,
"max": 4.82435562632,
"times": [
4.44685920432,
4.43699721632,
4.69566998432,
4.4008320673200005,
4.4594991013200005,
4.51254452932,
4.82435562632,
4.44984151532,
4.44609564832,
4.57800740232
]
},
{
"command": "pacquet@main",
"mean": 4.57937816202,
"stddev": 0.1540583768293018,
"median": 4.53241055082,
"user": 1.70160606,
"system": 1.4032527199999998,
"min": 4.42497316332,
"max": 4.8498737293200005,
"times": [
4.43583205232,
4.45747061932,
4.69547141532,
4.54222876432,
4.42963665032,
4.68412022832,
4.52259233732,
4.8498737293200005,
4.75158266032,
4.42497316332
]
},
{
"command": "pnpr@HEAD",
"mean": 3.4955360893199994,
"stddev": 0.057979674623832245,
"median": 3.4746920228200002,
"user": 1.1862120600000001,
"system": 1.2452289200000002,
"min": 3.4586970153200003,
"max": 3.6529299123200003,
"times": [
3.6529299123200003,
3.46921237532,
3.47950027732,
3.48646386232,
3.4831127363200003,
3.46890355332,
3.52126650432,
3.46988376832,
3.46539088832,
3.4586970153200003
]
},
{
"command": "pnpr@main",
"mean": 3.5528180172200003,
"stddev": 0.12345865181068864,
"median": 3.50470412482,
"user": 1.17869746,
"system": 1.2648107199999998,
"min": 3.44308777132,
"max": 3.82917710932,
"times": [
3.67435644832,
3.61918185832,
3.56160191732,
3.44308777132,
3.48363109932,
3.82917710932,
3.45208323132,
3.4888137663200003,
3.52059448332,
3.45565248732
]
}
]
} |
|
| Branch | pr/13135 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,396.08 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 292.24 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 290.08 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 80.08 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,356.04 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,458.70 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 263.81 ms |
be49118 to
c13dd17
Compare
c13dd17 to
63a5053
Compare
Drop the doc comments and inline notes that only translate the adjacent code, keep the TS parity anchors, and let the behavioral doc for allowedDeprecatedVersions live in one place (WorkspaceResolveOptions), referenced from the tree-ctx field and builder.
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
PR Code Suggestions ✨Latest suggestions up to 0c8e009 Warning
Previous suggestionsSuggestions up to commit e955451
|
||||||||||||||||||
|
Follow-up on the remaining Qodo review items (addressed in 55ba70a): Finding 1 — Finding 2 — terminal escape injection via the Finding 3 — deprecation work under the Suggestion "Preserve direct deprecation warnings": rejected as a divergence. The TypeScript implementation reports a deprecated package only on its first occurrence ( Also in 55ba70a: the zoomed (non-cwd-prefix) direct-dependency warning now omits the deprecation text, matching Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 0c8e009 |
…rn on reused entries When ResolveResult.name_ver is unset (git / tarball / local), the pnpm:deprecation payload's name and version now come from the manifest (its canonical source per the name_ver contract) instead of the alias plus an empty version, which produced a malformed name@ payload and defeated allowedDeprecatedVersions matching. A manifest missing either field suppresses the warning. The check is extracted into emit_deprecation_if_needed and now also runs on the lockfile-reuse path: the synthesized manifest already round-trips the lockfile's deprecated metadata, so reused entries keep warning on warm installs the way pnpm does on repeat installs.
|
Correction to my earlier comment, plus the latest round of fixes (9ccb732):
Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 9ccb732 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Summary
Implements native Rust deprecation warning emission for pacquet. When a package's registry manifest carries a
deprecatedfield and its name+version is not covered bypnpm.allowedDeprecatedVersions, the resolver now emits apnpm:deprecationNDJSON event through the reporter — matching the legacy TypeScript implementation atpnpm11/installing/deps-resolver/src/resolveDependencies.ts:2119.The default reporter renders direct-dependency deprecations immediately and buffers transitive ones into a single summary line at
resolution_done, matching@pnpm/cli.default-reporter'sreportDeprecations.ts.Related to #11633
Squash Commit Body
Checklist
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
Summary by CodeRabbit
pnpm:deprecationNDJSON log events when deprecated packages are detected during dependency resolution.name@versionsemver ranges.