Repository navigation
fix(peers): check linked peers against remote tarball manifest versions - #17050
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17050 +/- ##
=======================================
Coverage 92.56% 92.56%
=======================================
Files 1787 1787
Lines 229357 229355 -2
=======================================
+ Hits 212308 212309 +1
+ Misses 17049 17046 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD 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.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.39327542502,
"stddev": 0.09885236646425458,
"median": 2.3543989234200002,
"user": 1.3542005400000001,
"system": 1.4162242199999997,
"min": 2.2867501309200002,
"max": 2.5590579799200004
},
{
"command": "pacquet@main",
"mean": 2.37561088762,
"stddev": 0.14134621169941916,
"median": 2.3309253844200004,
"user": 1.3334515399999998,
"system": 1.3499527199999999,
"min": 2.25947342292,
"max": 2.6552917169200003
},
{
"command": "pnpr@HEAD",
"mean": 1.44713910342,
"stddev": 0.15125125620675406,
"median": 1.40557994792,
"user": 1.2201699400000001,
"system": 1.21284732,
"min": 1.29513677992,
"max": 1.6557869139199999
},
{
"command": "pnpr@main",
"mean": 1.44101295422,
"stddev": 0.13121335222273553,
"median": 1.38658962992,
"user": 1.3538854399999998,
"system": 1.34352462,
"min": 1.30915057292,
"max": 1.68573722692
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23840716353999997,
"stddev": 0.011225919646919198,
"median": 0.23641092634000002,
"user": 0.26123766000000004,
"system": 0.5878272200000001,
"min": 0.22310190134000002,
"max": 0.25398074234
},
{
"command": "pacquet@main",
"mean": 0.25402329254,
"stddev": 0.014995888940894573,
"median": 0.25223753484,
"user": 0.31765586,
"system": 0.59827652,
"min": 0.23820888734,
"max": 0.28851353334
},
{
"command": "pnpr@HEAD",
"mean": 0.35539171443999995,
"stddev": 0.0402463873229059,
"median": 0.3676594603400001,
"user": 0.40132006000000003,
"system": 0.76424452,
"min": 0.26010593234,
"max": 0.40086433534000004
},
{
"command": "pnpr@main",
"mean": 0.28396386604,
"stddev": 0.01304918761812614,
"median": 0.28366462734,
"user": 0.30805346,
"system": 0.65885832,
"min": 0.26785483834,
"max": 0.31014092934000004
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.28736925162,
"stddev": 0.02012238061879242,
"median": 0.28667422842,
"user": 0.32683904,
"system": 0.62487762,
"min": 0.25893558642,
"max": 0.31279806342
},
{
"command": "pnpr@HEAD",
"mean": 0.28812255662,
"stddev": 0.014571643817615365,
"median": 0.28605467292,
"user": 0.30687243999999997,
"system": 0.6588910199999999,
"min": 0.26667911142,
"max": 0.31416689742
},
{
"command": "pacquet@main",
"mean": 0.27944552491999997,
"stddev": 0.017535218856232687,
"median": 0.28465017642,
"user": 0.33192583999999997,
"system": 0.66917972,
"min": 0.25487090042,
"max": 0.30231483342
},
{
"command": "pacquet@HEAD",
"mean": 0.27635287722,
"stddev": 0.017240796989444394,
"median": 0.27586640292,
"user": 0.33714714,
"system": 0.63024912,
"min": 0.24906619142000003,
"max": 0.31664617042
}
]
}
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009005954679601327,
"stddev": 0.0006914591412795642,
"median": 0.00893664956,
"user": 0.005208324916943521,
"system": 0.004671658272425246,
"min": 0.007465921560000001,
"max": 0.01123021656
},
{
"command": "pacquet@main",
"mean": 0.012648712304186042,
"stddev": 0.0034097173285951,
"median": 0.01283556256,
"user": 0.00696149379844961,
"system": 0.006754998372093021,
"min": 0.00809414456,
"max": 0.01960750356
},
{
"command": "pnpr@HEAD",
"mean": 0.016451845873513515,
"stddev": 0.0018350031420929474,
"median": 0.01650813956,
"user": 0.009441470270270272,
"system": 0.008285896432432428,
"min": 0.01152793656,
"max": 0.02135239856
},
{
"command": "pnpr@main",
"mean": 0.010863081300112992,
"stddev": 0.003595244243537344,
"median": 0.00874525856,
"user": 0.0063607649717514125,
"system": 0.005483535480225985,
"min": 0.007342501560000001,
"max": 0.01957436056
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010171896177777777,
"stddev": 0.00239702691326324,
"median": 0.00940724572,
"user": 0.00602669111111111,
"system": 0.00502584951111111,
"min": 0.007635147720000001,
"max": 0.02048111072
},
{
"command": "pacquet@main",
"mean": 0.015602708844223604,
"stddev": 0.0026280502597161573,
"median": 0.01564376672,
"user": 0.00868777180124224,
"system": 0.008186977763975156,
"min": 0.010102937720000002,
"max": 0.02697401472
},
{
"command": "pnpr@HEAD",
"mean": 0.010347742460506328,
"stddev": 0.0027649575513428795,
"median": 0.00918432072,
"user": 0.006051138987341768,
"system": 0.005164169746835441,
"min": 0.007591154720000002,
"max": 0.01873334772
},
{
"command": "pnpr@main",
"mean": 0.008482311559857651,
"stddev": 0.0005976965321443765,
"median": 0.008362216720000001,
"user": 0.004879855729537367,
"system": 0.004262477508896794,
"min": 0.00758910072,
"max": 0.012061417720000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.84803705196,
"stddev": 0.1107575460479705,
"median": 2.8055191443600003,
"user": 2.9427373800000005,
"system": 2.2364958600000002,
"min": 2.7412588768600004,
"max": 3.10382594486
},
{
"command": "pacquet@main",
"mean": 2.80660978636,
"stddev": 0.06843003286515789,
"median": 2.7919166193600002,
"user": 2.8669354800000004,
"system": 2.16019926,
"min": 2.6977403198600003,
"max": 2.93877806486
},
{
"command": "pnpr@HEAD",
"mean": 1.58357841386,
"stddev": 0.15735076057144948,
"median": 1.57254691686,
"user": 1.2915658799999998,
"system": 1.3018270599999997,
"min": 1.4127932028599999,
"max": 1.79330537586
},
{
"command": "pnpr@main",
"mean": 1.5810412884600002,
"stddev": 0.10894672247963805,
"median": 1.56602672986,
"user": 1.2970754800000002,
"system": 1.2401247599999998,
"min": 1.41182082386,
"max": 1.72182142386
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.43798274608000004,
"stddev": 0.022841108131087355,
"median": 0.43474062198,
"user": 0.6202236400000001,
"system": 0.70163296,
"min": 0.39583213248000004,
"max": 0.47128101348
},
{
"command": "pacquet@main",
"mean": 0.4624833568800001,
"stddev": 0.029239033863031942,
"median": 0.47834898798000003,
"user": 0.63114424,
"system": 0.77569776,
"min": 0.40781603648000003,
"max": 0.49300635048
},
{
"command": "pnpr@HEAD",
"mean": 0.2960432814800001,
"stddev": 0.006771943123148098,
"median": 0.29423275148000005,
"user": 0.25058374,
"system": 0.5567247599999999,
"min": 0.28634156248000003,
"max": 0.30878892648
},
{
"command": "pnpr@main",
"mean": 0.35059164988,
"stddev": 0.03905696899020019,
"median": 0.37559109698000004,
"user": 0.31005384,
"system": 0.67267696,
"min": 0.28938862448,
"max": 0.38788586448
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6830184457199997,
"stddev": 0.12652023738805387,
"median": 1.6318849523199999,
"user": 1.0177586999999997,
"system": 1.0102799,
"min": 1.58836824832,
"max": 1.93558946532
},
{
"command": "pacquet@main",
"mean": 1.61718352702,
"stddev": 0.02084708031655518,
"median": 1.61737591732,
"user": 0.9000248,
"system": 0.8490103000000001,
"min": 1.5873509503199998,
"max": 1.65497536032
},
{
"command": "pnpr@HEAD",
"mean": 0.30333893122,
"stddev": 0.03742092964867372,
"median": 0.30460006882,
"user": 0.25556149999999994,
"system": 0.5813035999999998,
"min": 0.25712908732,
"max": 0.37779821232000005
},
{
"command": "pnpr@main",
"mean": 0.28920057592000004,
"stddev": 0.008127970343307504,
"median": 0.28863035982,
"user": 0.24202669999999998,
"system": 0.5691544999999999,
"min": 0.27512195232000003,
"max": 0.30200486332000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22870116255846154,
"stddev": 0.011300019495787112,
"median": 0.22490297902,
"user": 0.2085420723076923,
"system": 0.08168796,
"min": 0.21699938402000002,
"max": 0.25033222701999996
},
{
"command": "pacquet@main",
"mean": 0.23786007277000001,
"stddev": 0.013818914100836039,
"median": 0.23608938202000002,
"user": 0.22435179666666663,
"system": 0.08464654333333332,
"min": 0.21174661202000003,
"max": 0.26232518102
},
{
"command": "pnpr@HEAD",
"mean": 0.08960481850387098,
"stddev": 0.0022014827132306077,
"median": 0.08937376902000001,
"user": 0.03204976709677419,
"system": 0.011730704516129032,
"min": 0.08541482302,
"max": 0.09386926102000001
},
{
"command": "pnpr@main",
"mean": 0.08972070226242423,
"stddev": 0.0029158484193486573,
"median": 0.08843129102000001,
"user": 0.030692167878787875,
"system": 0.013649747878787876,
"min": 0.08574232802000001,
"max": 0.09673274302000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23685424277111114,
"stddev": 0.019359656828032278,
"median": 0.23358315466000001,
"user": 0.23620309777777773,
"system": 0.0642743511111111,
"min": 0.20371968266,
"max": 0.26541217565999997
},
{
"command": "pacquet@main",
"mean": 0.25706948610444447,
"stddev": 0.020875182433325434,
"median": 0.25486306665999997,
"user": 0.26821920888888884,
"system": 0.050686684444444435,
"min": 0.22024437966000002,
"max": 0.29897937066
},
{
"command": "pnpm@HEAD",
"mean": 3.762964881882223,
"stddev": 0.15147154542501562,
"median": 3.78914365966,
"user": 5.731565097777779,
"system": 0.38946090666666666,
"min": 3.5653417166600003,
"max": 4.06890459366
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22314128687999998,
"stddev": 0.04251002814996159,
"median": 0.20583564038000002,
"user": 0.17178482285714283,
"system": 0.08749551999999998,
"min": 0.20028449338,
"max": 0.35188829138
},
{
"command": "pacquet@main",
"mean": 0.27865614007999995,
"stddev": 0.07186405125110931,
"median": 0.26210189488,
"user": 0.22671958000000006,
"system": 0.10445422,
"min": 0.19997735738,
"max": 0.39498082938
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.08347223763047622,
"stddev": 0.020938345192838218,
"median": 0.07508027244000001,
"user": 0.028265860000000004,
"system": 0.06135326571428572,
"min": 0.07053605844000001,
"max": 0.13522379944000001
},
{
"command": "pacquet@main",
"mean": 0.07708469196631577,
"stddev": 0.004859665629789475,
"median": 0.07636069544000001,
"user": 0.029745570526315785,
"system": 0.053071216842105265,
"min": 0.07217339744000001,
"max": 0.09618689944000001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.56307586206,
"stddev": 0.059683076232020536,
"median": 4.58586242976,
"user": 1.8375648599999999,
"system": 2.0523930399999997,
"min": 4.47580678576,
"max": 4.6342879117599995
},
{
"command": "pacquet@main",
"mean": 4.5585654903599995,
"stddev": 0.15757999726414962,
"median": 4.485663151759999,
"user": 1.8141478599999996,
"system": 1.97340874,
"min": 4.43346069576,
"max": 4.88711902976
},
{
"command": "pnpr@HEAD",
"mean": 3.59206284416,
"stddev": 0.06563454150921334,
"median": 3.58545565926,
"user": 1.7242999599999997,
"system": 1.8762867399999998,
"min": 3.50195029876,
"max": 3.71853734076
},
{
"command": "pnpr@main",
"mean": 3.5948750462600003,
"stddev": 0.11094387807379025,
"median": 3.56101955526,
"user": 1.7924956599999997,
"system": 1.87074264,
"min": 3.4963628087600003,
"max": 3.8605902157600003
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.12927949104285716,
"stddev": 0.005905576142313751,
"median": 0.1301632589,
"user": 0.15474902380952382,
"system": 0.1407204457142857,
"min": 0.11805648490000001,
"max": 0.1428010519
},
{
"command": "pacquet@main",
"mean": 0.12699241005,
"stddev": 0.004675606679372171,
"median": 0.1269565239,
"user": 0.15199595,
"system": 0.13631611,
"min": 0.11927546590000002,
"max": 0.1372773349
},
{
"command": "pnpr@HEAD",
"mean": 0.13761031767777776,
"stddev": 0.0040160432983906294,
"median": 0.1375133284,
"user": 0.16607188888888888,
"system": 0.1296742711111111,
"min": 0.1295288759,
"max": 0.1431493159
},
{
"command": "pnpr@main",
"mean": 0.13405205432105263,
"stddev": 0.00420220276538619,
"median": 0.1337625559,
"user": 0.1551950263157895,
"system": 0.13003252842105265,
"min": 0.1269094909,
"max": 0.1440661999
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.2111687031999998,
"stddev": 0.11017676115737768,
"median": 1.1701673888,
"user": 0.6575265799999999,
"system": 0.2628939,
"min": 1.0982243418,
"max": 1.4114042688000001
},
{
"command": "pacquet@main",
"mean": 1.1483343902,
"stddev": 0.02370712461007674,
"median": 1.1460627383,
"user": 0.5242195800000001,
"system": 0.23661589999999996,
"min": 1.1037991148,
"max": 1.1871130498
}
]
} |
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? |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
`pnpm install` with `strictPeerDependencies` and `pnpm peers check` reported an unmet peer when a workspace package's peer was provided by a remote tarball URL in the consuming project. The importer-level peer check for linked workspace packages used the importer's `version:` field (the URL) as the found version, while the lockfile's `packages` entry already records the tarball manifest's version. Prefer that recorded version for every resolved importer dependency, falling back to the version in the reference for registry packages. This matches the snapshot-level check, which reads package metadata since the local tarball fix in pnpm#15299. Closes pnpm#17037. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7a0b270 to
0d68960
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Code Review by Qodo
1. A crafted lockfile hides unmet peers
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…mporter dependency Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit c1b4027 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Review-and-fix pass on this PR:
Qodo findings, both declined:
Status on c1b4027:
The PR stays ready for review. Nothing remains within the requested scope. Written by an agent (Claude Code, claude-opus-5-5). |
Summary
Closes #17037.
Say a workspace package declares a peer, and the project that links it provides that peer through a remote tarball URL (for example a
codeload.github.comtarball). pnpm 12 then compares the peer range with the URL, not the tarball's version.pnpm installwithstrictPeerDependencies: truefails withERR_PNPM_PEER_DEP_ISSUES, andpnpm peers checkreportsInstalled: https://…. pnpm 11 is not affected.Root cause
The lockfile check for linked workspace packages (
deps-inspection-peers,resolved_peer_versioninlinked.rs) treated the importer'sversion:field as the found version. For a remote tarball, that field is the URL, even though the lockfile'spackagesentry records the manifest version (version: 10.0.0). #15299 fixed this forfile:tarballs only, and for the snapshot-level check. Importer dependencies with a regular reference such as a URL still used the raw reference.Fix
For every resolved importer dependency,
resolved_peer_versionnow uses the version recorded in the lockfile'spackagesentry. If that entry has noversion, it falls back to the reference, as before. That is the normal case for registry packages, so their behavior doesn't change. The existingfile:helper does this lookup and was renamed fromresolve_file_versiontoresolve_locked_version, since it now covers both cases.Testing
pnpm installandpnpm peers checkfailed. After it, both succeed.remote_tarball_peer_versions_of_linked_packages_use_metadataindeps-inspection-peers. It checks that a satisfying version passes and that an unsatisfying one is reported with the manifest version.remote_tarball_peer_of_a_linked_package_uses_the_manifest_versionintarball_url_dependency.rs. It serves the tarball from a mock host and runsinstallandpeers checkagainst1.0.0(passes) and2.0.0(fails withInstalled: 2.0.0).pnpm test:rust -p pnpm-deps-inspection-peers: 54 passed. The peer and tarball CLI tests: 268 passed. Workspacecargo clippy --all-targets -D warningsis clean.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version. (pnpm 11 is not affected.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
This PR was written with the help of an AI agent.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit