Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change updates YAML manifest writing to patch existing documents instead of serializing them from scratch. It preserves comments, key order, aliases, nulls, and empty collections, reports parse errors, and adds regression coverage. ChangesPackage YAML preservation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant ProjectManifestWriter
participant Filesystem
participant YAMLDocument
ProjectManifestWriter->>Filesystem: read package.yaml
Filesystem-->>ProjectManifestWriter: YAML source or missing-file error
ProjectManifestWriter->>YAMLDocument: parse and patch manifest
YAMLDocument-->>ProjectManifestWriter: preserved YAML document
ProjectManifestWriter->>Filesystem: atomically write package.yaml
Assessment Against Linked Issues
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/workspace/project-manifest-reader/test/index.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. pnpm11/workspace/project-manifest-writer/package.jsonESLint skipped: the matched ESLint configuration already failed (missing-dependency). pnpm11/workspace/project-manifest-writer/src/index.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency).
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 |
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-workspace scenario compares current Rust against main Rust. 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.36869001962,
"stddev": 0.18983130893459155,
"median": 2.25504860972,
"user": 1.1935287999999997,
"system": 1.44021772,
"min": 2.22946694422,
"max": 2.76980878522
},
{
"command": "pacquet@main",
"mean": 2.37444435142,
"stddev": 0.14701911313370547,
"median": 2.31005557772,
"user": 1.1541917000000002,
"system": 1.32017092,
"min": 2.21140639322,
"max": 2.58612598522
},
{
"command": "pnpr@HEAD",
"mean": 1.41439272452,
"stddev": 0.12394378008828173,
"median": 1.35507157622,
"user": 1.0608556,
"system": 1.22041432,
"min": 1.2940508862200002,
"max": 1.6036778202200002
},
{
"command": "pnpr@main",
"mean": 1.48219426642,
"stddev": 0.14771507387720154,
"median": 1.4724579557200002,
"user": 1.0734762000000002,
"system": 1.2281190199999998,
"min": 1.3112740762200001,
"max": 1.6667435752200002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20241858862,
"stddev": 0.005778092560231348,
"median": 0.20230725232000002,
"user": 0.22271663999999997,
"system": 0.50156022,
"min": 0.19415247582,
"max": 0.21167758082000002
},
{
"command": "pacquet@main",
"mean": 0.20233182452000004,
"stddev": 0.01149702769172483,
"median": 0.20442934982,
"user": 0.20543543999999997,
"system": 0.51021202,
"min": 0.18468458882,
"max": 0.22008783282
},
{
"command": "pnpr@HEAD",
"mean": 0.22905743142,
"stddev": 0.00632775418426991,
"median": 0.22963425182000002,
"user": 0.22229804,
"system": 0.5259156199999999,
"min": 0.22088477882000002,
"max": 0.23893045182
},
{
"command": "pnpr@main",
"mean": 0.24414571782000002,
"stddev": 0.053414067669716785,
"median": 0.22111437682,
"user": 0.2607892399999999,
"system": 0.54776462,
"min": 0.19878439682000001,
"max": 0.33960949682
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.006770801961333337,
"stddev": 0.0005198379121281596,
"median": 0.006691171940000001,
"user": 0.004395038666666668,
"system": 0.0027936038400000014,
"min": 0.00571596494,
"max": 0.00900841894
},
{
"command": "pacquet@main",
"mean": 0.006909314626015835,
"stddev": 0.00047576907888126027,
"median": 0.00685699394,
"user": 0.004541125963060688,
"system": 0.002833058258575199,
"min": 0.00602105994,
"max": 0.01009499594
},
{
"command": "pnpr@HEAD",
"mean": 0.006811331354168932,
"stddev": 0.0005958813017129346,
"median": 0.0067586389400000006,
"user": 0.004262743923705721,
"system": 0.0029809932425068123,
"min": 0.0056520949400000004,
"max": 0.010523434940000001
},
{
"command": "pnpr@main",
"mean": 0.006284961115438601,
"stddev": 0.00040894350751829545,
"median": 0.00624226694,
"user": 0.0040907918295739355,
"system": 0.0025699695238095245,
"min": 0.005497392940000001,
"max": 0.00777075594
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.007295028713890675,
"stddev": 0.0006946764093173708,
"median": 0.007208566820000001,
"user": 0.004367640900321545,
"system": 0.0033779566559485504,
"min": 0.006001330820000001,
"max": 0.00997356582
},
{
"command": "pacquet@main",
"mean": 0.007656991667682116,
"stddev": 0.00033362166537598,
"median": 0.007648632320000001,
"user": 0.004707341854304635,
"system": 0.0034054909933774824,
"min": 0.0066561808200000004,
"max": 0.00915013082
},
{
"command": "pnpr@HEAD",
"mean": 0.007642122775555561,
"stddev": 0.0003990717644713038,
"median": 0.007615831820000001,
"user": 0.004797980317460313,
"system": 0.00329583949206349,
"min": 0.00676721882,
"max": 0.01025312982
},
{
"command": "pnpr@main",
"mean": 0.00773689801471947,
"stddev": 0.00039115223666574394,
"median": 0.007691874820000001,
"user": 0.004859994587458746,
"system": 0.0033389236963696396,
"min": 0.006773189820000001,
"max": 0.00914806582
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.50688655684,
"stddev": 0.04849439796095294,
"median": 2.48569062604,
"user": 1.8665023600000001,
"system": 1.61326872,
"min": 2.4705221915399997,
"max": 2.62355258654
},
{
"command": "pacquet@main",
"mean": 2.51186996184,
"stddev": 0.0621258538818043,
"median": 2.48848555404,
"user": 1.8216680599999997,
"system": 1.63382942,
"min": 2.44442127754,
"max": 2.65788024254
},
{
"command": "pnpr@HEAD",
"mean": 1.4967675047400002,
"stddev": 0.1308782433748418,
"median": 1.4576862025400001,
"user": 1.01902756,
"system": 1.25641552,
"min": 1.35951172254,
"max": 1.77043741654
},
{
"command": "pnpr@main",
"mean": 1.53788029894,
"stddev": 0.1470822897654109,
"median": 1.4870592475400002,
"user": 1.07543406,
"system": 1.29546492,
"min": 1.36232069854,
"max": 1.7691082605400001
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.34411359354000004,
"stddev": 0.010871678411893747,
"median": 0.34767532274,
"user": 0.5377269,
"system": 0.7932444799999999,
"min": 0.32653425224,
"max": 0.35812149424
},
{
"command": "pacquet@main",
"mean": 0.44021397883999996,
"stddev": 0.09146269671315817,
"median": 0.43497251774,
"user": 0.7020040999999999,
"system": 0.9789711799999999,
"min": 0.33756338824,
"max": 0.54241422024
},
{
"command": "pnpr@HEAD",
"mean": 0.27217601044,
"stddev": 0.0070995064290767535,
"median": 0.27416757424000004,
"user": 0.2167189,
"system": 0.5259965799999999,
"min": 0.26088601524,
"max": 0.28360902324
},
{
"command": "pnpr@main",
"mean": 0.26666603894,
"stddev": 0.006133082714928078,
"median": 0.26560338874,
"user": 0.20159,
"system": 0.52988098,
"min": 0.25653456724,
"max": 0.27887332624
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6384782190200002,
"stddev": 0.10103782197202699,
"median": 1.5930473859199998,
"user": 0.99702448,
"system": 1.1593236999999998,
"min": 1.54882929392,
"max": 1.81359401892
},
{
"command": "pacquet@main",
"mean": 1.57485341282,
"stddev": 0.011366735023192456,
"median": 1.5733071779199999,
"user": 0.8183077799999999,
"system": 1.0935064,
"min": 1.56283506692,
"max": 1.59989814492
},
{
"command": "pnpr@HEAD",
"mean": 0.28850343172000004,
"stddev": 0.007712712465890957,
"median": 0.28802321492000005,
"user": 0.24460498,
"system": 0.5593308,
"min": 0.27702122692000003,
"max": 0.30248548292000005
},
{
"command": "pnpr@main",
"mean": 0.29697855912,
"stddev": 0.008035554217126624,
"median": 0.29736123942000003,
"user": 0.24989277999999998,
"system": 0.5951793000000001,
"min": 0.27962603792,
"max": 0.30666192792
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20270055585076924,
"stddev": 0.012428264418264029,
"median": 0.20286019262000002,
"user": 0.20016929384615384,
"system": 0.06493051538461539,
"min": 0.17825714062000003,
"max": 0.22909090762000003
},
{
"command": "pacquet@main",
"mean": 0.19566449176285716,
"stddev": 0.017670109132623648,
"median": 0.19156153662000003,
"user": 0.1896453542857143,
"system": 0.06700947142857143,
"min": 0.17528762162000003,
"max": 0.22741012562000001
},
{
"command": "pnpr@HEAD",
"mean": 0.08863484318250002,
"stddev": 0.001915657983577578,
"median": 0.08828680712,
"user": 0.02915879624999999,
"system": 0.016041153124999995,
"min": 0.08622644762000001,
"max": 0.09288287162
},
{
"command": "pnpr@main",
"mean": 0.08970672787806451,
"stddev": 0.002308456273112459,
"median": 0.08962164462,
"user": 0.03334584967741934,
"system": 0.01213932258064516,
"min": 0.08515394562,
"max": 0.09501277562
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6635216444622222,
"stddev": 0.06279312335526703,
"median": 0.6845582482400001,
"user": 0.6776358644444443,
"system": 0.13444761777777778,
"min": 0.5702120232400001,
"max": 0.73002295124
},
{
"command": "pacquet@main",
"mean": 0.641510641017778,
"stddev": 0.05902413865057817,
"median": 0.6384769092400001,
"user": 0.65813742,
"system": 0.14656717333333333,
"min": 0.5653062482400001,
"max": 0.7396076572400001
},
{
"command": "pnpm@HEAD",
"mean": 3.068282827351111,
"stddev": 0.10208385668545127,
"median": 3.05710869924,
"user": 4.844855864444444,
"system": 0.21851650666666664,
"min": 2.9142274682400005,
"max": 3.2076696892400003
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.16465647618444443,
"stddev": 0.002622318345479618,
"median": 0.16419561224,
"user": 0.12099098888888887,
"system": 0.08172850000000002,
"min": 0.16189096274,
"max": 0.17029340973999998
},
{
"command": "pacquet@main",
"mean": 0.16444999662235296,
"stddev": 0.002586029983730155,
"median": 0.16481406574,
"user": 0.12866830588235295,
"system": 0.07230052941176472,
"min": 0.16007212074,
"max": 0.16916633174
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.349856300240001,
"stddev": 0.08087643386711221,
"median": 4.32532096094,
"user": 1.3578508999999999,
"system": 1.54739998,
"min": 4.2663639274400005,
"max": 4.4768779824400005
},
{
"command": "pacquet@main",
"mean": 4.32796915984,
"stddev": 0.08992596908683341,
"median": 4.2885464324400004,
"user": 1.2791587,
"system": 1.42100598,
"min": 4.2519258434400005,
"max": 4.545693052440001
},
{
"command": "pnpr@HEAD",
"mean": 3.3984518176399994,
"stddev": 0.10305656506034204,
"median": 3.3614051924399995,
"user": 1.2516816999999998,
"system": 1.3101940799999998,
"min": 3.33588188844,
"max": 3.66020650244
},
{
"command": "pnpr@main",
"mean": 3.4128684396399995,
"stddev": 0.07199247185777188,
"median": 3.38834802844,
"user": 1.2778076,
"system": 1.41111248,
"min": 3.34990509844,
"max": 3.54174544144
}
]
}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.12195874518545455,
"stddev": 0.006596150318277158,
"median": 0.11971963314,
"user": 0.1554903690909091,
"system": 0.14618057272727272,
"min": 0.11378638364,
"max": 0.14011957264
},
{
"command": "pacquet@main",
"mean": 0.11790029918545457,
"stddev": 0.009401752042506215,
"median": 0.11563691264,
"user": 0.14220473272727274,
"system": 0.13948102727272726,
"min": 0.10741635564,
"max": 0.13857652764
},
{
"command": "pnpr@HEAD",
"mean": 0.12707700116380952,
"stddev": 0.004646848192839891,
"median": 0.12629461064,
"user": 0.14789834095238097,
"system": 0.13645120476190475,
"min": 0.11943941464,
"max": 0.13673202464
},
{
"command": "pnpr@main",
"mean": 0.12582600469,
"stddev": 0.005292985188729804,
"median": 0.12516072964,
"user": 0.14390556000000002,
"system": 0.1383719,
"min": 0.11810068864,
"max": 0.13646706564
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/15148 |
| 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) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 119.44 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,359.51 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 277.02 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 260.89 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 86.23 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,294.05 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,335.88 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 220.88 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 6.77 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 5.65 ms |
|
Investigated the initial Bencher alert for The first run measured 12.4 ± 2.0 ms for the PR and 8.8 ± 2.3 ms for the base. Rerunning that scenario without code changes measured 6.8 ± 0.6 ms and 6.5 ± 0.3 ms respectively. The replacement Bencher report passes. This supports timing variance as the cause of the initial alert. On For Written by an agent (Codex, GPT-6). |
PR Summary by QodoPreserve package.yaml comments and key order
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Addressed Qodo's release-note wording suggestion in 8f92912: the entry now starts with “pnpm now preserves comments and existing key order”. Written by an agent (Codex, GPT-6). |
|
Code review by qodo was updated up to the latest commit 8f92912 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
@coderabbitai review Please review the current head, 8f92912. The in-progress summary still names 5f01786. Written by an agent (Codex, GPT-6). |
|
|
Read and save package.yaml through PackageManifest, preserving comments and existing mapping order while retaining the atomic-write and no-op-save paths. Use manifest discovery for pkg, version, set-script, and link. Extract the workspace writer's scalar alias support into a shared YAML utility. Batch edits by YAML path and detach collection aliases when either side changes. Reject invalid roots and colliding keys. Validate the edited document against the requested value before replacing it. Publish new manifests atomically while retaining normal creation permissions and existing-file permissions. Keep the Rust test runner's isolated npmrc in commands spawned by test helpers, preventing developer registry settings from leaking into fixture installs. Follow-up to #15148. Related to #2008.
Patch the existing package.yaml document using the shared YAML document synchronizer and write it atomically. Preserve existing key order and scalar aliases, and reject malformed YAML without overwriting it. Allow the synchronizer to retain null values and empty maps for package metadata while keeping its configuration-pruning defaults. Match scalar YAML keys to their JSON property names so custom metadata keeps numeric and boolean keys. Keep reader-specific null-key conversion explicit and retain comments when replacing scalar metadata such as timestamps and binary values. Reconcile shorter sequences and replaced collection aliases without retaining stale values. Validate through both project-manifest reader entry points, direct writer regressions, synchronizer tests, and the existing workspace writer suite. The new writer regression tests fail against the original implementation. Closes pnpm#2008.
Read and save package.yaml through PackageManifest, preserving comments and existing mapping order while retaining the atomic-write and no-op-save paths. Use manifest discovery for pkg, version, set-script, and link. Extract the workspace writer's scalar alias support into a shared YAML utility. Batch edits by YAML path and detach collection aliases when either side changes. Reject invalid roots and colliding keys. Validate the edited document against the requested value before replacing it. Publish new manifests atomically while retaining normal creation permissions and existing-file permissions. Keep the Rust test runner's isolated npmrc in commands spawned by test helpers, preventing developer registry settings from leaking into fixture installs. Follow-up to pnpm#15148. Related to pnpm#2008.
Summary
Preserve comments and existing key order when commands update
package.yaml. Existing keys stay in place and new keys are appended to their mapping. Closes #2008.The workspace YAML writer already preserves comments and ordering, and JSON5 already preserves comments. This fixes the remaining package YAML writer in pnpm v11. The Rust CLI reads
package.yamlbut does not write it, so it does not contain this bug.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Validation: 191 tests pass across the document synchronizer, project manifest reader and writer, and workspace manifest writer. Package compilation/lint and repository metadata validation pass.
Written by an agent (Codex, GPT-6).
Summary by CodeRabbit
New Features
package.yamlfiles when updating manifests.Documentation