Repository navigation
fix: read a single-string trustPolicyExclude/minimumReleaseAgeExclude as a one-entry list - #13737
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe changes normalize leading-slash lockfile paths and support single-string trust-policy exclusion patterns. Unit and integration tests cover package parsing, version-policy matching, downgraded dependencies, and lockfile verification. ChangesTrust policy exclusion handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant WorkspaceConfig
participant LockfileVerification
participant DependencyPathParse
WorkspaceConfig->>LockfileVerification: provide trustPolicyExclude
LockfileVerification->>DependencyPathParse: parse lockfile package keys
DependencyPathParse-->>LockfileVerification: return normalized package name
LockfileVerification->>LockfileVerification: validate trust downgrade
LockfileVerification-->>WorkspaceConfig: allow match or throw ERR_PNPM_TRUST_DOWNGRADE
✨ 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: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (9): Last reviewed commit: "docs: cut the comment narration down to ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/pnpm/test/install/misc.ts`:
- Around line 746-781: Extend the lockfile verifier regression around the
existing trustPolicyExclude test to rewrite the package and snapshot keys to a
double-slash identifier (`//@pnpm/[email protected]`) while keeping
trustPolicyExclude unprefixed, then assert installation fails with
ERR_PNPM_TRUST_DOWNGRADE. Add equivalent TypeScript and pacquet coverage, plus
corresponding Rust coverage, preserving `//` as distinct from `/` lockfile keys.
🪄 Autofix
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: 82f984d1-4710-4711-b87e-ce752286b41d
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (7)
.changeset/fix-trust-policy-exclude-slash.mdpnpm/crates/lockfile/src/pkg_name.rspnpm/crates/lockfile/src/pkg_name_suffix.rspnpm11/config/version-policy/src/index.tspnpm11/config/version-policy/test/index.tspnpm11/deps/path/src/index.tspnpm11/pnpm/test/install/misc.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13737 +/- ##
=======================================
Coverage 88.25% 88.25%
=======================================
Files 627 627
Lines 103341 103342 +1
=======================================
+ Hits 91203 91209 +6
+ Misses 12138 12133 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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. 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": 3.00676677256,
"stddev": 0.31780431742741505,
"median": 2.96825742236,
"user": 3.05168588,
"system": 2.32141786,
"min": 2.60323213686,
"max": 3.56056830886,
"times": [
2.82543572386,
3.01801430686,
3.56056830886,
3.37131804786,
2.6167552188600003,
3.04505241586,
2.82239109586,
3.28639993286,
2.91850053786,
2.60323213686
]
},
{
"command": "pacquet@main",
"mean": 2.70377588066,
"stddev": 0.19086805607613822,
"median": 2.64406634936,
"user": 2.4134591800000003,
"system": 1.8420641600000003,
"min": 2.47544453286,
"max": 2.97749122986,
"times": [
2.9750587088600002,
2.62655664886,
2.76859037386,
2.60692328186,
2.6615760498600003,
2.97749122986,
2.52569298386,
2.90270211586,
2.51772288086,
2.47544453286
]
},
{
"command": "pnpr@HEAD",
"mean": 1.65179000476,
"stddev": 0.1895829062754799,
"median": 1.5799183513600001,
"user": 1.5027072799999999,
"system": 1.6049872599999997,
"min": 1.41152312286,
"max": 2.07602964986,
"times": [
1.55148990886,
1.41152312286,
1.62364603186,
1.5786486378600002,
1.83798967886,
2.07602964986,
1.53308459886,
1.75048253186,
1.57381782186,
1.58118806486
]
},
{
"command": "pnpr@main",
"mean": 1.6772746655600002,
"stddev": 0.1654137363093747,
"median": 1.6874490203599999,
"user": 1.53855398,
"system": 1.6561365600000002,
"min": 1.47806867986,
"max": 1.91692528386,
"times": [
1.75729330286,
1.67600211786,
1.84717802286,
1.48868920786,
1.69889592286,
1.5380534248600002,
1.51507554186,
1.85656515086,
1.91692528386,
1.47806867986
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.38122338186000004,
"stddev": 0.052624301069423694,
"median": 0.36648939376,
"user": 0.34802493999999995,
"system": 0.6657664000000001,
"min": 0.31819397176,
"max": 0.46453244576,
"times": [
0.34226627376,
0.33644662676000003,
0.36960610176,
0.36337268576000004,
0.44687031176,
0.42930489876,
0.46453244576,
0.33084074176,
0.31819397176,
0.41079976076
]
},
{
"command": "pacquet@main",
"mean": 0.37407042756,
"stddev": 0.057466595113745675,
"median": 0.37102805626,
"user": 0.35883393999999996,
"system": 0.6815222000000001,
"min": 0.30145345176,
"max": 0.49932771876000004,
"times": [
0.33013124676,
0.31888701576,
0.30145345176,
0.35419537276,
0.36389823476,
0.37815787776,
0.49932771876000004,
0.42990670176,
0.38486801076,
0.37987864476
]
},
{
"command": "pnpr@HEAD",
"mean": 0.4907380165600001,
"stddev": 0.05305665531588605,
"median": 0.48564627226,
"user": 0.43715074,
"system": 0.7948993000000001,
"min": 0.42489135776000003,
"max": 0.56714889576,
"times": [
0.48008977076000003,
0.42797410776,
0.5312656457600001,
0.42489135776000003,
0.49120277376000004,
0.43742379276000004,
0.5594711127600001,
0.56714889576,
0.46331394376,
0.5245987647600001
]
},
{
"command": "pnpr@main",
"mean": 0.64841302416,
"stddev": 0.07013858858235306,
"median": 0.6320050042600001,
"user": 0.5168045400000001,
"system": 0.9134578999999998,
"min": 0.5467405857600001,
"max": 0.77769553976,
"times": [
0.5467405857600001,
0.6225807867600001,
0.6312837977600001,
0.7387213757600001,
0.77769553976,
0.6730833357600001,
0.6636283697600001,
0.6316240977600001,
0.5663864417600001,
0.6323859107600001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.31016653876,
"stddev": 0.23842173172625283,
"median": 3.32076389146,
"user": 2.81107494,
"system": 2.2964627599999994,
"min": 3.03825871246,
"max": 3.58640849346,
"times": [
3.57571092046,
3.58640849346,
3.53229778746,
3.38464149546,
3.53473317046,
3.25688628746,
3.06019871246,
3.09105704046,
3.04147276746,
3.03825871246
]
},
{
"command": "pacquet@main",
"mean": 2.9157179738600005,
"stddev": 0.09442447800437648,
"median": 2.9027346514600003,
"user": 2.22336104,
"system": 1.68595946,
"min": 2.80236494746,
"max": 3.11460008646,
"times": [
3.02043375246,
2.91664915546,
3.11460008646,
2.94413114146,
2.93469923846,
2.88882014746,
2.84338960846,
2.84137268446,
2.85071897646,
2.80236494746
]
},
{
"command": "pnpr@HEAD",
"mean": 1.75747967346,
"stddev": 0.17441026928710068,
"median": 1.7558689034600001,
"user": 1.6399843399999998,
"system": 1.8569226599999997,
"min": 1.52131485446,
"max": 2.09634615246,
"times": [
1.75832506846,
1.5352236484600001,
1.52131485446,
1.81588361046,
2.09634615246,
1.63592393246,
1.69790355146,
1.75341273846,
1.84958054646,
1.91088263146
]
},
{
"command": "pnpr@main",
"mean": 1.8092817068600002,
"stddev": 0.17447855167454918,
"median": 1.73617118046,
"user": 1.6769579399999999,
"system": 1.8437142599999998,
"min": 1.62587962846,
"max": 2.09387458246,
"times": [
1.63565884446,
1.8229418374600002,
1.7456802524600001,
1.72448657646,
2.04755822746,
1.67246416746,
1.99761084346,
2.09387458246,
1.62587962846,
1.72666210846
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.64517291454,
"stddev": 0.0615319100552127,
"median": 0.6349375258400001,
"user": 0.8883796199999999,
"system": 0.96439722,
"min": 0.56394519434,
"max": 0.7422540963400001,
"times": [
0.65445165334,
0.56394519434,
0.61542339834,
0.61075600834,
0.7422540963400001,
0.68228507034,
0.73342992834,
0.66835277334,
0.58050167734,
0.60032934534
]
},
{
"command": "pacquet@main",
"mean": 0.5300922709399999,
"stddev": 0.03369974341931937,
"median": 0.53324443384,
"user": 0.7442724199999999,
"system": 0.7690978199999999,
"min": 0.46874996434000005,
"max": 0.58124781034,
"times": [
0.53209399934,
0.50907905634,
0.51133026134,
0.53627970334,
0.50262858234,
0.58124781034,
0.57044762534,
0.55467083834,
0.5343948683399999,
0.46874996434000005
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3833628909400001,
"stddev": 0.023897730400002842,
"median": 0.38185673734000003,
"user": 0.27880232,
"system": 0.6361283199999999,
"min": 0.34229719734,
"max": 0.41540979834,
"times": [
0.37131302834,
0.36088357934000004,
0.40987533634000006,
0.38938156634000004,
0.41540979834,
0.41099865934,
0.38831632334000005,
0.37539715134,
0.34229719734,
0.36975626934000005
]
},
{
"command": "pnpr@main",
"mean": 0.40527887474,
"stddev": 0.03809341298221454,
"median": 0.39849329634,
"user": 0.31672192,
"system": 0.64431112,
"min": 0.36194199134000005,
"max": 0.47795414834000005,
"times": [
0.36194199134000005,
0.37262095934000006,
0.41373755234000004,
0.47795414834000005,
0.39296662934000004,
0.39821957134,
0.46403199034000003,
0.39938948234000005,
0.37315940134000003,
0.39876702134
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.33643479882,
"stddev": 0.1544687550618431,
"median": 2.31423109192,
"user": 1.3608709199999998,
"system": 1.15430988,
"min": 2.1503619414200004,
"max": 2.6548245344200003,
"times": [
2.23303590842,
2.21423310742,
2.1503619414200004,
2.32103134342,
2.49677635342,
2.6548245344200003,
2.38777261942,
2.4018248424200004,
2.19705649742,
2.3074308404200004
]
},
{
"command": "pacquet@main",
"mean": 2.1480475535200005,
"stddev": 0.07321268832280459,
"median": 2.1370334894200003,
"user": 1.2294237199999998,
"system": 0.96989878,
"min": 2.06585314442,
"max": 2.26611500042,
"times": [
2.25350463042,
2.26611500042,
2.1159516534200002,
2.2049902614200003,
2.06585314442,
2.1581153254200003,
2.07710745442,
2.0889646884200004,
2.15999632342,
2.0898770534200004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.37961463612,
"stddev": 0.018183167782368042,
"median": 0.37555165142,
"user": 0.28899001999999996,
"system": 0.6342415799999999,
"min": 0.35642766342,
"max": 0.41293633942,
"times": [
0.37602337342000003,
0.37507992942,
0.35642766342,
0.38779626842,
0.37764916242,
0.36674498942,
0.36494630742,
0.41293633942,
0.40738371542,
0.37115861242
]
},
{
"command": "pnpr@main",
"mean": 0.38016424412,
"stddev": 0.032569485404378255,
"median": 0.37392026392,
"user": 0.28606471999999994,
"system": 0.6270620799999999,
"min": 0.32472522642,
"max": 0.44630437442,
"times": [
0.41387799042,
0.36670801142,
0.37816834742,
0.38255643542,
0.44630437442,
0.36616406242,
0.36967218042,
0.39159748142,
0.36186833142,
0.32472522642
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26373240238000006,
"stddev": 0.02808317808478539,
"median": 0.26014099188,
"user": 0.21735523999999998,
"system": 0.07487286,
"min": 0.22975911338000002,
"max": 0.33066243938,
"times": [
0.28503124838,
0.25377909438,
0.23484387838000004,
0.25711670138,
0.26181332738,
0.26403623738,
0.26147790638,
0.25880407738,
0.22975911338000002,
0.33066243938
]
},
{
"command": "pacquet@main",
"mean": 0.25600700684153843,
"stddev": 0.027201203936119783,
"median": 0.25206464038,
"user": 0.22134148615384613,
"system": 0.07318045230769231,
"min": 0.21993561538000003,
"max": 0.31223505938,
"times": [
0.21993561538000003,
0.28757417138,
0.28262205738,
0.24310744138000004,
0.22221422138000002,
0.24502982738000004,
0.25127173938,
0.25206464038,
0.22339061438000002,
0.31223505938,
0.26672173938,
0.26385397638,
0.25806998538
]
},
{
"command": "pnpr@HEAD",
"mean": 0.1027331476213793,
"stddev": 0.007649472450735274,
"median": 0.10190779838,
"user": 0.029543191724137927,
"system": 0.014279484137931031,
"min": 0.09225830738,
"max": 0.12489014838,
"times": [
0.09828341038,
0.09411554038,
0.09559024438000001,
0.09225830738,
0.09664763338,
0.09765991738,
0.09641294238,
0.10288702038,
0.10408397038,
0.09904731738,
0.09610287838,
0.09303257338,
0.10659504538,
0.11076071938000001,
0.09686250838,
0.09703674638,
0.11309954938000001,
0.10190779838,
0.11796116338000001,
0.10845386138,
0.10424828938,
0.10765499838,
0.09927149938,
0.10524803038000001,
0.10903389238000001,
0.10394077138,
0.09913853938,
0.10703596438,
0.12489014838
]
},
{
"command": "pnpr@main",
"mean": 0.10444873409999998,
"stddev": 0.005942583280264718,
"median": 0.10316953138,
"user": 0.030556679999999992,
"system": 0.014504569600000001,
"min": 0.09459881038000001,
"max": 0.11659614538,
"times": [
0.10935778138,
0.10199058338,
0.10530607038,
0.11306210838,
0.09981114438000001,
0.09597825438,
0.10289210838,
0.10280277238,
0.10087433438,
0.10756692238,
0.10369325638,
0.09943257138,
0.09986300238000001,
0.10212148938,
0.10827696738,
0.11092644238,
0.10416136638000001,
0.11533372238,
0.11659614538,
0.10461500038,
0.09955280738000001,
0.09459881038000001,
0.09674491638,
0.10316953138,
0.11249024338000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.105886989231111,
"stddev": 0.13497980737014864,
"median": 1.1420789651199998,
"user": 1.1381953555555553,
"system": 0.1991832888888889,
"min": 0.88479319712,
"max": 1.2923334621199998,
"times": [
1.0075809871199999,
0.9894451041200001,
1.0291111951199998,
0.88479319712,
1.19126791912,
1.2498056071199999,
1.2923334621199998,
1.1420789651199998,
1.16656646612
]
},
{
"command": "pacquet@main",
"mean": 0.9944072661200001,
"stddev": 0.18801758363800927,
"median": 0.9862963521200001,
"user": 0.9878680222222224,
"system": 0.20510062222222225,
"min": 0.7514851061200001,
"max": 1.41789368812,
"times": [
1.04595369612,
1.41789368812,
1.03961877012,
1.03095688812,
0.9862963521200001,
0.8240964981200001,
0.93593057412,
0.7514851061200001,
0.91743382212
]
},
{
"command": "pnpm@HEAD",
"mean": 4.414598941453334,
"stddev": 0.33564233415232425,
"median": 4.566005173120001,
"user": 6.799633577777777,
"system": 0.39287717777777775,
"min": 3.88139535412,
"max": 4.839980345120001,
"times": [
4.27937728012,
4.839980345120001,
4.670669565120001,
4.725123631120001,
4.566005173120001,
4.569354592120001,
3.88139535412,
4.02705955712,
4.17242497512
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.8212109952,
"stddev": 0.1807507029357736,
"median": 4.7756133037,
"user": 2.9594225200000004,
"system": 2.11378604,
"min": 4.6396407827,
"max": 5.1323728057,
"times": [
4.6396407827,
4.6779573517,
4.7961829677,
5.0530485077,
4.7550436397,
4.6583647847,
4.6738766267,
5.0127253567,
4.8128971287,
5.1323728057
]
},
{
"command": "pacquet@main",
"mean": 4.7384470389999995,
"stddev": 0.11461173711934111,
"median": 4.6796329012,
"user": 2.40677272,
"system": 1.78533704,
"min": 4.6242912857,
"max": 4.9476071557,
"times": [
4.6805752137,
4.6286519067,
4.6778895137,
4.9476071557,
4.7990201317,
4.8900626567,
4.6515103557,
4.8061715817,
4.6242912857,
4.6786905887
]
},
{
"command": "pnpr@HEAD",
"mean": 3.6830462363,
"stddev": 0.15200392746704894,
"median": 3.6704853572,
"user": 1.4499092199999999,
"system": 1.44534444,
"min": 3.4942969887,
"max": 3.9195126377,
"times": [
3.9195126377,
3.7725779467000002,
3.8965885777000002,
3.5642712017,
3.7507267637,
3.4995460647,
3.7006284247,
3.4942969887,
3.5919714677,
3.6403422897
]
},
{
"command": "pnpr@main",
"mean": 3.6125758400000008,
"stddev": 0.10734463418005126,
"median": 3.5899399192,
"user": 1.53064982,
"system": 1.52170954,
"min": 3.5039352277,
"max": 3.8828120777,
"times": [
3.8828120777,
3.5506062307,
3.6109237637,
3.6422085567,
3.6181576677000002,
3.5689560747,
3.5039352277,
3.5347224777,
3.5515332167,
3.6619031067
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13737 |
| 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,436.96 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 279.15 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 293.19 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.45 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,368.57 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,447.87 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 269.13 ms |
056959a to
2e8ff06
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
2e8ff06 to
87c8aa1
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rs`:
- Around line 269-274: Add a PkgNameVerPeer test case in the existing test cases
around name_peer_ver for a slash-prefixed dependency key containing both a
patch_hash and peer data, matching the input and expected parsed name/version
from pnpm11/deps/path/test/index.ts. Keep the current doubled-slash regression
case unchanged.
🪄 Autofix
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: 8e64f860-0de1-4baa-9c79-9e5c335657ed
📒 Files selected for processing (8)
.changeset/fix-trust-policy-exclude-slash.mdpnpm/crates/lockfile/src/pkg_name/tests.rspnpm/crates/lockfile/src/pkg_name_suffix.rspnpm/crates/lockfile/src/pkg_name_ver_peer/tests.rspnpm11/config/version-policy/src/index.tspnpm11/deps/path/src/index.tspnpm11/deps/path/test/index.tspnpm11/pnpm/test/install/misc.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- .changeset/fix-trust-policy-exclude-slash.md
- pnpm11/deps/path/src/index.ts
- pnpm11/config/version-policy/src/index.ts
Code Review by Qodo
1. trustPolicyExclude string unsupported in Rust
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
87c8aa1 to
05502b6
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 05502b6 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit e6adb88 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Support leading slashes in lockfile package keys for trustPolicyExclude and normalize single-string values to array in config. Resolves pnpm#13721.
Review follow-up on the leading-slash handling. On the Rust side the strip lived in `PkgName::parse`, which is the alias/package-name type rather than the dep-path parser. A lockfile alias `/foo` was therefore normalized to `foo` and sailed through `verify_lockfile_dependency_names`, while the TypeScript CLI rejects the same alias via `isValidDependencyAlias`. Moving it into `PkgNameSuffix::from_str` — the counterpart of the TypeScript `parse` — restores that rejection and keeps the scoped-name path allocation-free. Both stacks drop the `//` carve-out: nothing has ever given a doubled slash a meaning, and `depPathToFilenameUnescaped` (TypeScript) and `dep_path_to_filename` (Rust) already strip exactly one leading slash unconditionally, so the parsers now agree with them. Tests: add the missing unit coverage in `@pnpm/deps.path` and `pacquet-lockfile`, and rebuild the end-to-end regression around `--frozen-lockfile`. Under `--lockfile-only` it re-resolved and never reached the lockfile verifier, and its guarded lockfile rewrite passed silently whenever the key was absent. Also document why a lone string is accepted for the exclude settings, and revert the unrelated `pnpm-lock.yaml` churn. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The end-to-end regression also installed the slash-prefixed lockfile with a matching `trustPolicyExclude` and expected success. Verification does pass — the entry is recognized and excluded — but linking then fails with `ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY`, because the packages map is still keyed by the literal `/name@version` string while the walker looks the entry up under its parsed name. That is independent of this change: the same install fails the same way with the parser fix backed out. Locally the assertion only held when earlier tests in the file had already warmed the project, so it passed here and failed on CI. Keep the half that proves the fix — the trust check has to fire on the slash-keyed entry under its real name — and drop the unsupported half. Also add the patch-hash key case CodeRabbit asked for, so the Rust regression covers the same shapes as the TypeScript one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A `/name@version` key is the lockfile format 6 spelling, and pnpm has not read a format 6 lockfile since the version gate moved to major 9: both entry points in readLockfiles.ts pass `wantedVersions: [LOCKFILE_VERSION]`, and a lower major is rejected with ERR_PNPM_LOCKFILE_BREAKING_CHANGE before any key is parsed. Such a key can only reach the parser inside a file labelled version 9 that was hand-edited or mangled, and the rest of the install pipeline still treats it as a distinct literal string — so normalizing it in the parser alone made the verifier report a clean bill of health for an entry the installer then could not find. Leaving those keys malformed everywhere is the behavior pnpm already has. The vestigial slash handling elsewhere in the module (`depPathToFilenameUnescaped`, `createPeerDepGraphHash`, `isAbsolute`) is format 6 residue of the same kind and is being tracked separately. This also drops the end-to-end trust-policy tests added alongside the parser change; the exclusion paths they covered already have equivalent coverage. What remains is the config fix: `trustPolicyExclude` and `minimumReleaseAgeExclude` set to a single string are read as a one-entry list instead of character by character. Reopens the question of what actually caused pnpm#13721. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`.npmrc` is not one of the sources. `isNpmrcReadableKey` admits only scoped keys, `//`-prefixed keys, the npm auth settings, and six proxy/network keys, so `trust-policy-exclude` never reaches the merged npmrc config. The values that do arrive as a bare string come from a YAML scalar in pnpm-workspace.yaml or the global config.yaml, and from a `PNPM_CONFIG_*` env var, where the `[String, Array]` schema falls back to String after the JSON-array parse fails. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit ba8810f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
ba8810f to
aa44d6b
Compare
|
Code review by qodo was updated up to the latest commit aa44d6b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The doc comment restated the function's name and signature, walked through the env parser's type-union fallback, and then described what the loop would do to a string. The unit test pins that behavior and the changeset carries the user-facing consequence; what a reader cannot recover from the code is only why the parameter admits a bare string. The comment in the end-to-end test restated the test name and its assertion, so it goes entirely. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 2f0e1ba |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
trustPolicyExcludeandminimumReleaseAgeExcludereach the policy builder as a bare string rather than a list whenever they are written as a YAML scalar inpnpm-workspace.yamlor in the globalconfig.yaml, or come from aPNPM_CONFIG_*env var — their schema is[String, Array], so the env parser falls back toStringonce the value fails to parse as a JSON array. (Not from.npmrc:isNpmrcReadableKeyadmits only scoped keys,//-prefixed keys, the npm auth settings, and six proxy keys.)createPackageVersionPolicyiterated it, producing one rule per character. Two consequences:*anywhere in the value became a match-everything rule, silently switching the whole policy off for every package.minimumReleaseAgeExclude: '@scope/*'written as a scalar disabled the release-age cooldown entirely.A lone string is now read as a one-entry list.
Scope
This PR originally also stripped a leading slash in the dependency-path parsers of both stacks, on the theory that
trustPolicyExcludefails against a/name@versionlockfile key. That was dropped in e6adb88. A leading slash is the lockfile format 6 spelling, and pnpm has not read a format 6 lockfile since the version gate moved to major 9 — both entry points inreadLockfiles.tspasswantedVersions: [LOCKFILE_VERSION], and a lower major is rejected withERR_PNPM_LOCKFILE_BREAKING_CHANGEbefore any key is parsed. Such a key can only appear in a file labelled version 9 that was hand-edited or mangled, and the rest of the install pipeline still treats it as a distinct literal string, so normalizing it in the parser alone made the verifier pass an entry the installer could not then find.It therefore does not close #13721, whose reporter was on pnpm 10.21.0 — also lockfile major 9 — with an array-valued
trustPolicyExclude. That issue still needs a root cause.Parity
TypeScript only. pacquet types both settings as
Option<Vec<String>>: a YAML scalar is a parse error and a scalar env var is ignored, so it never had this bug. The wider divergence — the TypeScript config layer accepts a scalar for every[String, Array]setting while pacquet does not — is pre-existing across roughly nine settings and belongs in its own change to both stacks.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.