Repository navigation
fix(deploy): preserve local tarball package names - #12864
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 (1)
📝 WalkthroughWalkthroughThis PR updates deploy lockfile generation in both TypeScript and Rust to preserve package names for local ChangesDeploy tarball package name preservation
Estimated code review effort: 3 (Moderate) | ~25 minutes Assessment against linked issues
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 |
Deploy rewrites local file paths into deploy-local file URLs. Keep the original package name from the source lockfile. This prevents warm-store content checks from comparing against the tarball filename. Constraint: shared-lockfile deploy rewrites local paths into deploy-local file URLs. Confidence: high Scope-risk: narrow Tested: `corepack pnpm --filter @pnpm/releasing.commands compile` Tested: base-preset Jest createDeployFiles regression Tested: `corepack pnpm --filter pnpm compile` Tested: branch-local two-deploy warm-store smoke test for pnpm#12792 Not-tested: full with-registry deploy Jest suite; local pnpr build hit ENOSPC.
5167335 to
68642b6
Compare
Confidence Score: 5/5Safe to merge. The change is a targeted, well-tested fix that adds a fallback name lookup before the filename-based fallback, with no behavioural change to any non-tarball code path. Both the TypeScript and Rust implementations are updated in lockstep, new unit and integration tests cover the fixed path, and the logic change is minimal and correct. No files require special attention. Reviews (3): Last reviewed commit: "refactor(deploy): carry tarball packageN..." | Re-trigger Greptile |
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
| async function writePackageTarball (tarballPath: string, manifest: ProjectManifest): Promise<void> { | ||
| const pack = tar.pack() | ||
| pack.entry({ name: 'package/package.json' }, JSON.stringify(manifest, undefined, 2)) | ||
| pack.entry({ name: 'package/index.js' }, '') | ||
|
|
||
| const tarball = fs.createWriteStream(tarballPath) | ||
| pack.pipe(createGzip()).pipe(tarball) | ||
| pack.finalize() | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
| tarball.on('close', resolve) | ||
| tarball.on('error', reject) | ||
| }) | ||
| } |
There was a problem hiding this comment.
2. writepackagetarball declared too early 📘 Rule violation ⚙ Maintainability
writePackageTarball is declared before its first usage in the same TypeScript file, violating the rule that function declarations must appear after first use.
Agent Prompt
## Issue description
The helper `writePackageTarball` is declared before any call site in `shared-lockfile.test.ts`, but the style rule requires function declarations to appear after their first usage.
## Issue Context
This rule applies to top-level TypeScript `function` declarations and is intended to keep helpers near the bottom, relying on hoisting.
## Fix Focus Areas
- pnpm11/releasing/commands/test/deploy/shared-lockfile.test.ts[52-65]
- pnpm11/releasing/commands/test/deploy/shared-lockfile.test.ts[291-308]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR Code Suggestions ✨Warning
|
|||||||||
Port pnpm#12864 to pacquet: when rewriting a local `file:` tarball dependency, `create_file_url_key` fell back to the tarball filename (e.g. `tar-pkg-1.0.0.tgz`) as the package name, so warm-store deploys failed with `ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE`. Thread the real package name (the package-key name, or the outer dependency alias for dependency references) into the file-URL key, matching the TypeScript fix. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 2b2b9f6 |
PR Code Suggestions ✨Warning
|
|||||||||
Thread the parsed package name through the `packageName` field of `ResolveLinkOrFileResult` (where it already lives) instead of a separate `createFileUrlDepPath` argument. The scheme-shortcut call sites fill the fallback with `resolveResult.packageName ??= name/key`; the packages loop drops its redundant `inputPackageName` fallback, since `resolveLinkOrFile` always parses the name out of the dep-path key there. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit f0606ff |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12864 +/- ##
==========================================
- Coverage 85.26% 85.25% -0.01%
==========================================
Files 486 486
Lines 77280 77376 +96
==========================================
+ Hits 65890 65966 +76
- Misses 11390 11410 +20 ☔ 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. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.8014872360199994,
"stddev": 0.14762450215594547,
"median": 3.7615795738199997,
"user": 3.6168992,
"system": 3.4280178799999996,
"min": 3.6241576648200002,
"max": 4.06785235682,
"times": [
4.06785235682,
3.73830037182,
3.70429758782,
3.6241576648200002,
4.03598686282,
3.75782468882,
3.82662620482,
3.65897748282,
3.76533445882,
3.8355146808200002
]
},
{
"command": "pacquet@main",
"mean": 3.863479285620001,
"stddev": 0.1579277426773655,
"median": 3.8646371758200004,
"user": 3.6544643999999997,
"system": 3.4042194799999996,
"min": 3.65257318082,
"max": 4.09401318082,
"times": [
4.09401318082,
4.09340134682,
3.73129121582,
3.90076966582,
3.65257318082,
3.98746123582,
3.8614793028200003,
3.73428046482,
3.86779504882,
3.71172821382
]
},
{
"command": "pnpr@HEAD",
"mean": 2.15186290572,
"stddev": 0.1401716476013405,
"median": 2.13290684482,
"user": 2.7118315999999996,
"system": 3.0671012799999997,
"min": 1.9785537878200001,
"max": 2.35575010082,
"times": [
2.10042147982,
2.00800131582,
2.25109853682,
2.16539220982,
2.02258987482,
1.9785537878200001,
2.30571282382,
2.35575010082,
2.29024892482,
2.04086000282
]
},
{
"command": "pnpr@main",
"mean": 2.1180976559199998,
"stddev": 0.12215658331824002,
"median": 2.0843601728200003,
"user": 2.7380052,
"system": 3.03683008,
"min": 1.97208759682,
"max": 2.33547599482,
"times": [
2.33547599482,
2.10090288182,
2.14911204782,
2.06781746382,
2.31742215982,
2.06179655682,
2.05661959682,
2.12499358282,
1.97208759682,
1.99474867782
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6491509754800001,
"stddev": 0.008121792240250674,
"median": 0.6475888456800001,
"user": 0.3786925199999999,
"system": 1.3483447800000001,
"min": 0.6399902231800001,
"max": 0.66213181618,
"times": [
0.6399902231800001,
0.6558424611800001,
0.66137258318,
0.6481091051800001,
0.6470685861800001,
0.6500186321800001,
0.6431934771800001,
0.66213181618,
0.6420292671800001,
0.6417536031800001
]
},
{
"command": "pacquet@main",
"mean": 0.6600234353800001,
"stddev": 0.009498474804215607,
"median": 0.6595968726800001,
"user": 0.39081611999999993,
"system": 1.33662258,
"min": 0.6477760851800001,
"max": 0.6751449941800001,
"times": [
0.6477760851800001,
0.6751449941800001,
0.6644477041800001,
0.6697346341800001,
0.6499894391800001,
0.65635966718,
0.6628340781800001,
0.6685111651800001,
0.65577384518,
0.6496627411800001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.70699660748,
"stddev": 0.022855444105467793,
"median": 0.7096627796800001,
"user": 0.39440361999999995,
"system": 1.35322688,
"min": 0.6732689591800001,
"max": 0.7436193451800001,
"times": [
0.72125168118,
0.7289775741800001,
0.7144408231800001,
0.6951959901800001,
0.6785079921800001,
0.7209835101800001,
0.7048847361800001,
0.6732689591800001,
0.6888354631800001,
0.7436193451800001
]
},
{
"command": "pnpr@main",
"mean": 0.7336522445800002,
"stddev": 0.10496161934310311,
"median": 0.7001510426800001,
"user": 0.39638171999999994,
"system": 1.36236808,
"min": 0.6751236571800001,
"max": 1.0297820151800001,
"times": [
0.6995418371800001,
0.70076024818,
0.6945275861800001,
0.7047754571800001,
0.6956608051800001,
0.6992843721800001,
0.6751236571800001,
0.7054497121800001,
1.0297820151800001,
0.7316167551800001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.264163045779999,
"stddev": 0.0461776767603457,
"median": 4.257911138879999,
"user": 3.7860239199999994,
"system": 3.4064897800000002,
"min": 4.21172820288,
"max": 4.34504472288,
"times": [
4.25421653688,
4.300531546879999,
4.261605740879999,
4.21405523088,
4.21172820288,
4.26913091588,
4.34504472288,
4.24723363988,
4.21611599288,
4.321967927879999
]
},
{
"command": "pacquet@main",
"mean": 4.246249345979999,
"stddev": 0.04125814042681309,
"median": 4.2570396203800005,
"user": 3.79956062,
"system": 3.3996650799999997,
"min": 4.13972744388,
"max": 4.2827103938799995,
"times": [
4.26581338988,
4.2827103938799995,
4.26738767088,
4.2497556978799995,
4.239720022879999,
4.27841947788,
4.13972744388,
4.26121426988,
4.25286497088,
4.22488012188
]
},
{
"command": "pnpr@HEAD",
"mean": 2.2625776617800004,
"stddev": 0.1227302438738422,
"median": 2.2861018248800002,
"user": 2.5437667200000003,
"system": 2.9375517799999997,
"min": 2.11763931288,
"max": 2.4263855378800003,
"times": [
2.39909273788,
2.1225126488800004,
2.15118832488,
2.4263855378800003,
2.11763931288,
2.28814994988,
2.2840536998800003,
2.12791030588,
2.3327325448800003,
2.37611155488
]
},
{
"command": "pnpr@main",
"mean": 2.1703120789800003,
"stddev": 0.11588119243210507,
"median": 2.1253422863800004,
"user": 2.58125222,
"system": 2.95133558,
"min": 2.07035806988,
"max": 2.3930496098800003,
"times": [
2.0950726848800003,
2.09506475488,
2.11821711388,
2.14650887188,
2.16859814188,
2.3741174288800004,
2.1096666548800003,
2.07035806988,
2.3930496098800003,
2.1324674588800003
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.39008547436,
"stddev": 0.029907334916345094,
"median": 1.38324089976,
"user": 1.3500377399999999,
"system": 1.73473994,
"min": 1.34755339726,
"max": 1.43799432826,
"times": [
1.38448601026,
1.36833005426,
1.36679838426,
1.34755339726,
1.38199578926,
1.37292080926,
1.39806554026,
1.40523817726,
1.43799432826,
1.4374722532600002
]
},
{
"command": "pacquet@main",
"mean": 1.37953814166,
"stddev": 0.05362442066208104,
"median": 1.36297715526,
"user": 1.31189914,
"system": 1.7198343399999998,
"min": 1.3505095772600002,
"max": 1.5291262002600001,
"times": [
1.36382424526,
1.35387534126,
1.5291262002600001,
1.37129857626,
1.3505095772600002,
1.35153580926,
1.3762442112600002,
1.3621300652600001,
1.38150035026,
1.35533704026
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6904238977599999,
"stddev": 0.03373063869501444,
"median": 0.6826731752599999,
"user": 0.34429784,
"system": 1.30324014,
"min": 0.66513087626,
"max": 0.78038506326,
"times": [
0.67947704126,
0.78038506326,
0.70416069926,
0.68108632526,
0.66513087626,
0.66567976326,
0.66941100826,
0.68426002526,
0.68771608126,
0.68693209426
]
},
{
"command": "pnpr@main",
"mean": 0.6928609717599999,
"stddev": 0.06411911331317066,
"median": 0.67170292676,
"user": 0.34522234,
"system": 1.3001439399999999,
"min": 0.66671258426,
"max": 0.87496179626,
"times": [
0.66945611526,
0.66932659326,
0.67135663626,
0.6703225792599999,
0.66671258426,
0.67915906226,
0.67204921726,
0.67736069526,
0.67790443826,
0.87496179626
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.05709529178,
"stddev": 0.03650161659992655,
"median": 3.05191456488,
"user": 1.7704794199999998,
"system": 2.0082916399999995,
"min": 3.02693042738,
"max": 3.15051306938,
"times": [
3.07121098138,
3.0553849193800002,
3.02765409638,
3.02693042738,
3.0542304483800002,
3.03185495638,
3.06803154638,
3.03554379138,
3.15051306938,
3.04959868138
]
},
{
"command": "pacquet@main",
"mean": 3.08049136638,
"stddev": 0.05274537562108003,
"median": 3.07116136688,
"user": 1.80751312,
"system": 1.96763044,
"min": 3.03052540238,
"max": 3.21268113038,
"times": [
3.03881295938,
3.03052540238,
3.0850035833800002,
3.07126359438,
3.09621535438,
3.03351596038,
3.06460625338,
3.07105913938,
3.21268113038,
3.10123028638
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6704464990800001,
"stddev": 0.004756391582076674,
"median": 0.6687851058800001,
"user": 0.34810612,
"system": 1.30100764,
"min": 0.66495510438,
"max": 0.6792108953800001,
"times": [
0.6736170833800001,
0.6655429793800001,
0.66495510438,
0.6733344593800001,
0.6681360913800001,
0.66943412038,
0.6756596323800002,
0.6666951593800001,
0.6678794653800001,
0.6792108953800001
]
},
{
"command": "pnpr@main",
"mean": 0.6836278155800001,
"stddev": 0.010276695436362403,
"median": 0.6837704813800001,
"user": 0.34961291999999994,
"system": 1.3138361399999998,
"min": 0.6637063643800001,
"max": 0.70047081738,
"times": [
0.6637063643800001,
0.6806362763800001,
0.6836677333800001,
0.6787387453800001,
0.6749781473800001,
0.6882234003800001,
0.6838732293800001,
0.70047081738,
0.6869519933800001,
0.6950314483800001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6739438591800001,
"stddev": 0.012526754427624385,
"median": 0.67367689008,
"user": 0.6384163199999999,
"system": 0.15764081999999996,
"min": 0.65292591258,
"max": 0.69483843358,
"times": [
0.66467021358,
0.66704493858,
0.68894739258,
0.66399220258,
0.65292591258,
0.67245894458,
0.69483843358,
0.68119884058,
0.67489483558,
0.67846687758
]
},
{
"command": "pacquet@main",
"mean": 0.6752829680800001,
"stddev": 0.01388626222136268,
"median": 0.67302385908,
"user": 0.6408108199999999,
"system": 0.15504351999999996,
"min": 0.65704906958,
"max": 0.70512422558,
"times": [
0.67526977358,
0.67222711658,
0.70512422558,
0.68820173758,
0.67287015058,
0.67317756758,
0.6818293895800001,
0.65704906958,
0.66162245758,
0.66545819258
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10804101583000002,
"stddev": 0.0009573941484250593,
"median": 0.10796539758000001,
"user": 0.02884898666666666,
"system": 0.019525069999999995,
"min": 0.10728765158000002,
"max": 0.11218918758000002,
"times": [
0.11218918758000002,
0.10732796958000002,
0.10744868158000001,
0.10813713658000002,
0.10805294758000002,
0.10751813158000001,
0.10863593258000001,
0.10781244958000001,
0.10743115858000002,
0.10770690258000001,
0.10804052658000002,
0.10768120458000001,
0.10728765158000002,
0.10858392558000002,
0.10750928458000002,
0.10762986858000001,
0.10798701158000001,
0.10826468158000001,
0.10749628058,
0.10823048758,
0.10800016858000001,
0.10806916658000001,
0.10799984058,
0.10794378358000001
]
},
{
"command": "pnpr@main",
"mean": 0.10884197530000002,
"stddev": 0.002824586569840526,
"median": 0.10798905758,
"user": 0.02845974,
"system": 0.021010479999999995,
"min": 0.10675820458000002,
"max": 0.12039071458000002,
"times": [
0.10742314358000002,
0.10881797958000002,
0.10788538458000001,
0.10784840358000002,
0.10903114858000001,
0.10675820458000002,
0.10798905758,
0.10798870558000001,
0.10925591758000001,
0.11151740858000002,
0.10809093758000002,
0.10846966058000002,
0.10676604058000001,
0.10815752258000001,
0.11383043258000002,
0.12039071458000002,
0.10869553358000002,
0.10782479258000001,
0.10681571258000001,
0.10828862058000001,
0.10796921658000001,
0.10747487058,
0.10800424658000002,
0.10790974058000001,
0.10784598658000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.611822469740001,
"stddev": 0.08973133124368755,
"median": 6.6215524738400005,
"user": 3.8502608799999996,
"system": 3.74567226,
"min": 6.47966375634,
"max": 6.77268114934,
"times": [
6.61946567134,
6.52771821334,
6.57215564934,
6.708956236340001,
6.52192692934,
6.77268114934,
6.660591877340001,
6.6314259383400005,
6.47966375634,
6.6236392763400005
]
},
{
"command": "pacquet@main",
"mean": 6.6558925144400005,
"stddev": 0.14605758716168912,
"median": 6.63060756284,
"user": 3.8464390799999997,
"system": 3.70653776,
"min": 6.455726961340001,
"max": 6.898240303340001,
"times": [
6.66866391134,
6.55066621934,
6.82233612134,
6.66210937934,
6.509477594340001,
6.59910574634,
6.81095405834,
6.455726961340001,
6.898240303340001,
6.581644849340001
]
},
{
"command": "pnpr@HEAD",
"mean": 5.032875834940001,
"stddev": 0.08170923100462013,
"median": 5.008740228340001,
"user": 2.85324398,
"system": 3.2803707600000003,
"min": 4.9552420043400005,
"max": 5.231366627340001,
"times": [
5.02979737134,
4.9876830853400005,
4.97007469434,
4.9552420043400005,
5.04106252734,
5.231366627340001,
4.98398163334,
4.98115361434,
5.06651159934,
5.081885192340001
]
},
{
"command": "pnpr@main",
"mean": 5.001306231239999,
"stddev": 0.09881886119306264,
"median": 5.00363962384,
"user": 2.8319382799999997,
"system": 3.2862794600000003,
"min": 4.89161755134,
"max": 5.19681380934,
"times": [
5.03731616734,
4.98913450634,
4.896236629340001,
4.89161755134,
5.08819340334,
5.01814474134,
5.19681380934,
4.902646846340001,
4.9351033953400005,
5.05785526234
]
}
]
} |
|
| Branch | pr/12864 |
| 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 | 2,262.58 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 670.45 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 690.42 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 108.04 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,151.86 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 5,032.88 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 707.00 ms |
Summary
pnpm deployrewrites localfile:tarball dependencies.Why
Fixes #12792. On the second deploy with a warm store, the generated deploy lockfile used the tarball filename as the package name, so the store content check expected
[email protected]while the stored package was[email protected].Validation
corepack pnpm --filter @pnpm/releasing.commands compile— passedNODE_OPTIONS="${NODE_OPTIONS:-} --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" corepack pnpm exec jest test/deploy/createDeployFiles.test.ts --config ../../__utils__/jest-config/jest-preset.js --rootDir /root/oss/pnpm/pnpm11/releasing/commands --runInBand— passedcorepack pnpm --filter pnpm compile— passednode pnpm11/pnpm/bin/pnpm.mjs— passedgit pushpre-push hook — passedSummary by CodeRabbit
pnpm deployso localfile:/tarball dependencies preserve the intended package name in generated manifests and deploy lockfiles, with consistent “file URL” dependency key naming (including alias/link cases).Written by an agent (Codex, gpt-5.5).