Repository navigation
fix(pack): preserve workspace dependency order - #13751
Conversation
|
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 ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe exportable manifest now preserves workspace dependency declaration order when converting published specifiers. TypeScript and Rust tests verify deterministic output. The change also removes ChangesWorkspace dependency ordering
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change makes packed manifests preserve dependency order so identical inputs produce stable tarballs; no actionable merge-blocking risk remains, and the PR is merge-ready after normal checks and review. Assessment against linked issues
Possibly related PRs
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 |
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? |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "refactor(lockfile): drop the p-map-value..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR makes pnpm pack output deterministic for workspace dependencies by ensuring dependency key order in the packed manifest matches the original manifest’s declaration order, even when workspace manifest reads resolve concurrently.
Changes:
- Rebuilds the converted dependency object in source-key order after concurrent conversion completes.
- Adds a regression test that forces out-of-order workspace manifest read completion and asserts stable dependency ordering.
- Adds a changeset for a patch release of
@pnpm/releasing.exportable-manifestandpnpm.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pnpm11/releasing/exportable-manifest/src/index.ts | Reorders the returned converted dependencies to match the original manifest key order. |
| pnpm11/releasing/exportable-manifest/test/dependencyOrder.test.ts | Adds a test ensuring workspace dependency order is preserved despite out-of-order async reads. |
| .changeset/stable-packed-workspace-deps.md | Declares patch bumps and documents the deterministic pnpm pack behavior change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Rebuild the converted dependency map with an ordered `Promise.all` over the source entries instead of re-keying a `pMapValues` result. The order guarantee then holds by construction rather than through a second pass, and the now-unused `p-map-values` dependency goes away. Reset the mocked manifest reader state between tests so the ordering suite stays isolated. Add a pacquet regression test pinning the same guarantee, which holds there through `serde_json`'s `preserve_order` feature.
ee477f4 to
37cb846
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. |
Code Review by Qodo
1. Promise.all lacks trailing comma
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13751 +/- ##
==========================================
- Coverage 88.19% 88.18% -0.01%
==========================================
Files 646 646
Lines 106959 106969 +10
==========================================
+ Hits 94328 94333 +5
- Misses 12631 12636 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Nothing in the package imports it.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
`calcPatchHashes` was the last consumer. Hashing the patch files with an ordered `Promise.all` over the entries keeps the concurrency and makes the result carry the input order, so the catalog entry, the release-age exclusion, and the package itself can all go.
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 c7335a2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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": 2.5079690892999995,
"stddev": 0.14121010142539997,
"median": 2.5386036490999997,
"user": 1.74641606,
"system": 1.68812502,
"min": 2.3146285361,
"max": 2.6995820901
},
{
"command": "pacquet@main",
"mean": 2.6137205754,
"stddev": 0.13074985954457158,
"median": 2.6144973441,
"user": 2.0068775600000004,
"system": 1.9271309200000002,
"min": 2.3629641181,
"max": 2.8187627370999997
},
{
"command": "pnpr@HEAD",
"mean": 1.4655139271000002,
"stddev": 0.13554230330400913,
"median": 1.4056654231,
"user": 1.7571957599999997,
"system": 1.61464922,
"min": 1.3384000851000002,
"max": 1.6998219511000001
},
{
"command": "pnpr@main",
"mean": 1.5574316871,
"stddev": 0.11128461935872588,
"median": 1.5465615256,
"user": 1.84718396,
"system": 1.7466633200000001,
"min": 1.3815698531,
"max": 1.7709869601000001
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.38487569222,
"stddev": 0.024107572914894095,
"median": 0.38907506382,
"user": 0.3106479,
"system": 0.6721744599999998,
"min": 0.34325460182,
"max": 0.42140810082
},
{
"command": "pacquet@main",
"mean": 0.36534383051999997,
"stddev": 0.01797201432378993,
"median": 0.36437295032,
"user": 0.3028398,
"system": 0.6512594599999999,
"min": 0.33677166382,
"max": 0.39943906782
},
{
"command": "pnpr@HEAD",
"mean": 0.38228246311999997,
"stddev": 0.014368873295070812,
"median": 0.38019135232,
"user": 0.31626699999999996,
"system": 0.6625897599999999,
"min": 0.36023016082000003,
"max": 0.40513961382
},
{
"command": "pnpr@main",
"mean": 0.40438462332,
"stddev": 0.011422667712913986,
"median": 0.40022310632,
"user": 0.34993430000000003,
"system": 0.66390016,
"min": 0.39265058882000003,
"max": 0.42710274882000004
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.011896269857391307,
"stddev": 0.0021556271897817153,
"median": 0.011586384140000001,
"user": 0.007086917608695656,
"system": 0.004905465108695653,
"min": 0.00840082114,
"max": 0.01662104014
},
{
"command": "pacquet@main",
"mean": 0.01200218380666667,
"stddev": 0.0023208112131197513,
"median": 0.01195437314,
"user": 0.006495992804232804,
"system": 0.005597154285714283,
"min": 0.008083264140000001,
"max": 0.019645441140000004
},
{
"command": "pnpr@HEAD",
"mean": 0.011840816439270077,
"stddev": 0.0021339007467993283,
"median": 0.01149186064,
"user": 0.006496657810218971,
"system": 0.005430126131386861,
"min": 0.00816737114,
"max": 0.016077151140000003
},
{
"command": "pnpr@main",
"mean": 0.012533439224577121,
"stddev": 0.0020635041427071593,
"median": 0.012517192140000001,
"user": 0.006637108258706469,
"system": 0.0059904503482587045,
"min": 0.008635014140000001,
"max": 0.01669611014
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.014265295899444447,
"stddev": 0.0017994426428620692,
"median": 0.014767877080000002,
"user": 0.007907450000000002,
"system": 0.006457963333333335,
"min": 0.00950865258,
"max": 0.01806203058
},
{
"command": "pacquet@main",
"mean": 0.013082510044788732,
"stddev": 0.002066965816647837,
"median": 0.01296027358,
"user": 0.007490171830985917,
"system": 0.005687905492957745,
"min": 0.00921293658,
"max": 0.01858884358
},
{
"command": "pnpr@HEAD",
"mean": 0.0130293197870707,
"stddev": 0.0021228716607942697,
"median": 0.012840743080000001,
"user": 0.007826356565656565,
"system": 0.005309073030303031,
"min": 0.008902393580000001,
"max": 0.01711198158
},
{
"command": "pnpr@main",
"mean": 0.013269847940655733,
"stddev": 0.0021544507927240704,
"median": 0.013785006580000002,
"user": 0.007596298360655741,
"system": 0.005768105464480873,
"min": 0.008687019580000002,
"max": 0.01766195058
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.9847920444,
"stddev": 0.0449689011144315,
"median": 2.9757656906000003,
"user": 2.42291252,
"system": 1.9160084599999998,
"min": 2.9280218676,
"max": 3.0556873546000003
},
{
"command": "pacquet@main",
"mean": 2.9639047296000003,
"stddev": 0.04588951999990299,
"median": 2.9615651081000003,
"user": 2.4462553199999997,
"system": 1.8468603599999998,
"min": 2.9066371166000002,
"max": 3.0247249346
},
{
"command": "pnpr@HEAD",
"mean": 1.6769277982000002,
"stddev": 0.16056298971074462,
"median": 1.6283473361,
"user": 1.7353801199999999,
"system": 1.83632866,
"min": 1.4707874286,
"max": 1.9218819556
},
{
"command": "pnpr@main",
"mean": 1.8167317969999999,
"stddev": 0.12072274860637806,
"median": 1.8526655295999999,
"user": 1.95097062,
"system": 1.9480705600000001,
"min": 1.5789055565999999,
"max": 1.9730409256
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7755595508200002,
"stddev": 0.03511442058874617,
"median": 0.7901055246199999,
"user": 0.9986522599999998,
"system": 1.03386236,
"min": 0.72140784712,
"max": 0.81136937712
},
{
"command": "pacquet@main",
"mean": 0.7248466449200001,
"stddev": 0.056449358387978585,
"median": 0.73064626662,
"user": 0.9027683600000002,
"system": 1.00430256,
"min": 0.64235599112,
"max": 0.82752964012
},
{
"command": "pnpr@HEAD",
"mean": 0.46009496422000007,
"stddev": 0.029280429242609568,
"median": 0.45960835762,
"user": 0.33438746,
"system": 0.6762758599999998,
"min": 0.40974029412,
"max": 0.5005949401199999
},
{
"command": "pnpr@main",
"mean": 0.44557746132,
"stddev": 0.025595124409003148,
"median": 0.44736081362,
"user": 0.30521916,
"system": 0.6661969600000001,
"min": 0.39813602512,
"max": 0.49238446312
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.2886496936599996,
"stddev": 0.07411957185888408,
"median": 2.27891894456,
"user": 1.3308433,
"system": 1.1904744799999998,
"min": 2.20015340156,
"max": 2.43016938956
},
{
"command": "pacquet@main",
"mean": 2.2228458065599996,
"stddev": 0.04831590516418496,
"median": 2.22715277106,
"user": 1.2678741,
"system": 1.1047880799999998,
"min": 2.15018264856,
"max": 2.28095073156
},
{
"command": "pnpr@HEAD",
"mean": 0.4284717559600001,
"stddev": 0.027274903527144137,
"median": 0.4338939740600001,
"user": 0.30792729999999996,
"system": 0.6324939799999999,
"min": 0.38779504456,
"max": 0.48079590456000004
},
{
"command": "pnpr@main",
"mean": 0.4344226373600001,
"stddev": 0.033564269577918734,
"median": 0.4207434670600001,
"user": 0.3009744,
"system": 0.6404084799999998,
"min": 0.40351823956000005,
"max": 0.50577548756
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.32821201224,
"stddev": 0.04653484156654968,
"median": 0.31394423654000003,
"user": 0.2825212199999999,
"system": 0.12387829999999997,
"min": 0.26481503654000005,
"max": 0.40047946054000005
},
{
"command": "pacquet@main",
"mean": 0.38181360253999996,
"stddev": 0.049054710877838734,
"median": 0.37850405854,
"user": 0.33642681999999996,
"system": 0.12552029999999997,
"min": 0.29884546254,
"max": 0.45612417454000004
},
{
"command": "pnpr@HEAD",
"mean": 0.13549583814,
"stddev": 0.009021092971999298,
"median": 0.13521769354000002,
"user": 0.05198317,
"system": 0.0222148,
"min": 0.12094453154000001,
"max": 0.15338417354
},
{
"command": "pnpr@main",
"mean": 0.14801044544909092,
"stddev": 0.037028007495043286,
"median": 0.13212488454000001,
"user": 0.059818329090909096,
"system": 0.02542067272727273,
"min": 0.11920403854000002,
"max": 0.25803456654
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8913593868577778,
"stddev": 0.16635748486926502,
"median": 0.85081062108,
"user": 0.8740934977777777,
"system": 0.17012215555555554,
"min": 0.68044555108,
"max": 1.17730255308
},
{
"command": "pacquet@main",
"mean": 0.8860033510799998,
"stddev": 0.13748743056255225,
"median": 0.89202789108,
"user": 0.8534836088888887,
"system": 0.22815415555555557,
"min": 0.65847731308,
"max": 1.1379466330799999
},
{
"command": "pnpm@HEAD",
"mean": 4.956755920191111,
"stddev": 0.5683667253319804,
"median": 4.93561459308,
"user": 7.205009386666666,
"system": 0.5221430444444444,
"min": 4.155057455080001,
"max": 5.916460998080001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.66029592478,
"stddev": 0.1629129361064361,
"median": 4.624973521579999,
"user": 2.3845642600000003,
"system": 2.12875476,
"min": 4.48432997058,
"max": 5.016515420579999
},
{
"command": "pacquet@main",
"mean": 4.685393368480001,
"stddev": 0.11050669135209136,
"median": 4.66744637358,
"user": 2.4642412599999997,
"system": 2.2149829599999995,
"min": 4.54496827158,
"max": 4.89133004358
},
{
"command": "pnpr@HEAD",
"mean": 3.622703074580001,
"stddev": 0.09051672085232626,
"median": 3.57654579958,
"user": 2.21885266,
"system": 2.1176061600000002,
"min": 3.55597300858,
"max": 3.80779598758
},
{
"command": "pnpr@main",
"mean": 3.80822801888,
"stddev": 0.10454297912564484,
"median": 3.83206812508,
"user": 2.52317606,
"system": 2.45744466,
"min": 3.5798284395800004,
"max": 3.9409110435800003
}
]
}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. Comparable to that scenario head-to-head.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.31928671824000004,
"stddev": 0.09593634834951771,
"median": 0.28951175574000004,
"user": 0.37256156,
"system": 0.2808924199999999,
"min": 0.24748457674000002,
"max": 0.58440493474
},
{
"command": "pacquet@main",
"mean": 0.33109604434000006,
"stddev": 0.09084901970674357,
"median": 0.29373117074000005,
"user": 0.40011786000000005,
"system": 0.28846072,
"min": 0.25796065974000004,
"max": 0.56060555274
},
{
"command": "pnpr@HEAD",
"mean": 0.31033590744,
"stddev": 0.06905387718280405,
"median": 0.29189305574,
"user": 0.34821886,
"system": 0.30741781999999995,
"min": 0.25582661674000007,
"max": 0.4927368717400001
},
{
"command": "pnpr@main",
"mean": 0.31818134314,
"stddev": 0.09010963320599279,
"median": 0.27940590874000004,
"user": 0.35311276,
"system": 0.31105232000000005,
"min": 0.26087972174,
"max": 0.53370386174
}
]
} |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Summary
p-map-valuesrecords converted dependencies when each asynchronous mapper resolves. Resolving multipleworkspace:dependencies can therefore change their key order between runs, which makes unchanged packed manifests produce different tarball bytes.This keeps the concurrent conversion and rebuilds the result in the source manifest's dependency order. The Rust
pnpm/port already inserts converted dependencies synchronously in source order, so it needs no matching production change.Fixes #10167.
Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Codex, GPT-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
pnpm packoperations now produce deterministic manifest output, with workspace dependency versions preserved correctly.Tests