Repository navigation
fix(install): sync only the package files into injected copies with dedicated lockfiles - #16684
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughInjected dependency synchronization now filters source files to those selected by package-file rules when deploy-all-files mode is off. The PR updates Rust and TypeScript sync paths and adds tests for injected copies with dedicated lockfiles. ChangesInjected workspace package file filtering
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant CLI as sync_dedicated_injected_deps
participant Sync as sync_injected_deps_of_modules_dir
participant Patcher as DirPatcher
participant Fetcher as DirectoryFetcher
CLI->>Sync: Pass include_only_package_files
Sync->>Patcher: Pass filter to patch_targets
Patcher->>Fetcher: Load source map with package-file filter
Patcher->>Fetcher: Load target maps without package-file filter
Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to No specific issue in the supplied changes requires resolution before merge; proceed with normal checks. ✨ 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16684 +/- ##
==========================================
- Coverage 92.36% 92.36% -0.01%
==========================================
Files 1593 1593
Lines 210358 210369 +11
==========================================
+ Hits 194297 194306 +9
- Misses 16061 16063 +2 ☔ 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-workspace scenario compares 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.38145986266,
"stddev": 0.07714623415811661,
"median": 2.38829406086,
"user": 1.37756942,
"system": 1.4340892399999998,
"min": 2.27950766086,
"max": 2.52110077086
},
{
"command": "pacquet@main",
"mean": 2.39830453156,
"stddev": 0.1399352998170476,
"median": 2.31873508136,
"user": 1.3450759199999995,
"system": 1.3868682399999996,
"min": 2.27405070386,
"max": 2.61312823986
},
{
"command": "pnpr@HEAD",
"mean": 1.51315246496,
"stddev": 0.12648288777157307,
"median": 1.54157505986,
"user": 1.1711951199999997,
"system": 1.2274645400000002,
"min": 1.28905259486,
"max": 1.63860787086
},
{
"command": "pnpr@main",
"mean": 1.43453381556,
"stddev": 0.1095980984786393,
"median": 1.42767040286,
"user": 1.32202902,
"system": 1.3602980400000002,
"min": 1.30906162886,
"max": 1.62128878686
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.32778667928000005,
"stddev": 0.037930705895472906,
"median": 0.33545153208,
"user": 0.38161666,
"system": 0.7370034799999998,
"min": 0.26194865358,
"max": 0.37754378458000004
},
{
"command": "pacquet@main",
"mean": 0.30363392948,
"stddev": 0.03472073655187404,
"median": 0.30635409958000004,
"user": 0.36364005999999993,
"system": 0.6662960800000001,
"min": 0.25816024758,
"max": 0.36338846358000004
},
{
"command": "pnpr@HEAD",
"mean": 0.29139101318,
"stddev": 0.012081279834945276,
"median": 0.28997166008,
"user": 0.30958275999999996,
"system": 0.6370437799999998,
"min": 0.26835643258,
"max": 0.30949728758
},
{
"command": "pnpr@main",
"mean": 0.32417802728000006,
"stddev": 0.023941076227217896,
"median": 0.33201967558,
"user": 0.36392196,
"system": 0.6977988799999998,
"min": 0.28861983158000004,
"max": 0.35778356258000005
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01227115791425925,
"stddev": 0.001006618610495806,
"median": 0.012046899279999999,
"user": 0.006895017407407402,
"system": 0.006793030925925926,
"min": 0.01042473778,
"max": 0.01502427278
},
{
"command": "pacquet@main",
"mean": 0.011127702000472446,
"stddev": 0.0010669622578446288,
"median": 0.01091783778,
"user": 0.00625429700787402,
"system": 0.006148007322834643,
"min": 0.00896341478,
"max": 0.01399428178
},
{
"command": "pnpr@HEAD",
"mean": 0.011106139987070711,
"stddev": 0.0008757198224033669,
"median": 0.010919532780000001,
"user": 0.006157339797979799,
"system": 0.006202031212121211,
"min": 0.009283374779999999,
"max": 0.01405783278
},
{
"command": "pnpr@main",
"mean": 0.010857845522616033,
"stddev": 0.0009491372698233519,
"median": 0.010617427779999999,
"user": 0.006622265063291136,
"system": 0.0054561661603375515,
"min": 0.009510819779999999,
"max": 0.01439136278
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009558760526919835,
"stddev": 0.000890233975300477,
"median": 0.00929750424,
"user": 0.005790023375527426,
"system": 0.004589406329113924,
"min": 0.008187981240000001,
"max": 0.014252352240000002
},
{
"command": "pacquet@main",
"mean": 0.010208201671818193,
"stddev": 0.0013649769376304383,
"median": 0.009998080240000002,
"user": 0.006381060151515148,
"system": 0.0047196837121212115,
"min": 0.00783081924,
"max": 0.014048179240000002
},
{
"command": "pnpr@HEAD",
"mean": 0.008913085945263157,
"stddev": 0.000985719036938413,
"median": 0.00862030224,
"user": 0.005536704210526321,
"system": 0.004200835438596492,
"min": 0.007410580240000001,
"max": 0.013716135240000002
},
{
"command": "pnpr@main",
"mean": 0.009066413030123456,
"stddev": 0.0018241685231135084,
"median": 0.008288339240000001,
"user": 0.005635362386831272,
"system": 0.004211860905349793,
"min": 0.00709629924,
"max": 0.018376309240000003
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6316973561,
"stddev": 0.0782192046367472,
"median": 2.6114794692,
"user": 2.5374372800000002,
"system": 1.9639965599999996,
"min": 2.5011580927,
"max": 2.7614317007
},
{
"command": "pacquet@main",
"mean": 2.7494631584,
"stddev": 0.1741743457153126,
"median": 2.7098636681999997,
"user": 2.9320444800000005,
"system": 2.12385186,
"min": 2.5135033907,
"max": 3.0828402887
},
{
"command": "pnpr@HEAD",
"mean": 1.5915976314000002,
"stddev": 0.12506405003985116,
"median": 1.5684795036999999,
"user": 1.7788061799999997,
"system": 1.65207156,
"min": 1.4432219997,
"max": 1.8844237107000001
},
{
"command": "pnpr@main",
"mean": 1.5469300062999998,
"stddev": 0.1014292597974726,
"median": 1.5032806001999999,
"user": 1.7154865799999997,
"system": 1.66612126,
"min": 1.4546545887,
"max": 1.7633341177
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4925962115,
"stddev": 0.04052842399713888,
"median": 0.4918173048000001,
"user": 0.6745326199999999,
"system": 0.7826715399999999,
"min": 0.4287970618,
"max": 0.5562758188000001
},
{
"command": "pacquet@main",
"mean": 0.45425673290000007,
"stddev": 0.03417642641100993,
"median": 0.44668203930000006,
"user": 0.6202849199999999,
"system": 0.70353994,
"min": 0.40905137680000003,
"max": 0.5275945138000001
},
{
"command": "pnpr@HEAD",
"mean": 0.2972857546,
"stddev": 0.012418930777229293,
"median": 0.3011762638,
"user": 0.27558481999999995,
"system": 0.5573462399999999,
"min": 0.2784122698,
"max": 0.3105805258
},
{
"command": "pnpr@main",
"mean": 0.30348753070000006,
"stddev": 0.019460160282128353,
"median": 0.3017366213,
"user": 0.27954912,
"system": 0.5628865399999998,
"min": 0.2641207268,
"max": 0.33013302580000004
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7706123231600004,
"stddev": 0.02973392914514313,
"median": 1.7707916510600001,
"user": 1.19451256,
"system": 1.0244188200000002,
"min": 1.7259348645600001,
"max": 1.8109221315600001
},
{
"command": "pacquet@main",
"mean": 1.8018644169600002,
"stddev": 0.05932325853540027,
"median": 1.7911286670600002,
"user": 1.2800739599999997,
"system": 1.06741972,
"min": 1.74287341256,
"max": 1.9528582895600002
},
{
"command": "pnpr@HEAD",
"mean": 0.38227521186,
"stddev": 0.021567675506940536,
"median": 0.38147943556,
"user": 0.3805249599999999,
"system": 0.7130470199999999,
"min": 0.35507995956,
"max": 0.42231705756
},
{
"command": "pnpr@main",
"mean": 0.36538968986000003,
"stddev": 0.029744025184430783,
"median": 0.36959975406,
"user": 0.35546906,
"system": 0.69158442,
"min": 0.29931461656,
"max": 0.39898788356
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.30504691491999997,
"stddev": 0.054638730771684636,
"median": 0.28623523622,
"user": 0.3005069,
"system": 0.10991120000000001,
"min": 0.24645462172000002,
"max": 0.38602208972
},
{
"command": "pacquet@main",
"mean": 0.29457969781090904,
"stddev": 0.04250176030017709,
"median": 0.28478651072,
"user": 0.2885440090909091,
"system": 0.11828346363636362,
"min": 0.23740140572,
"max": 0.39178891672
},
{
"command": "pnpr@HEAD",
"mean": 0.09981131620000001,
"stddev": 0.005635963164523433,
"median": 0.09976639272000001,
"user": 0.03503094,
"system": 0.020941816000000002,
"min": 0.09074272372,
"max": 0.11265592472
},
{
"command": "pnpr@main",
"mean": 0.10262887296000002,
"stddev": 0.007854796751551733,
"median": 0.10104667572,
"user": 0.04034425999999999,
"system": 0.01812382,
"min": 0.09025586672,
"max": 0.11963254772000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.30704765827333336,
"stddev": 0.020765737147967995,
"median": 0.30511858294,
"user": 0.32621989333333334,
"system": 0.05946478444444444,
"min": 0.28288789694,
"max": 0.34315287494
},
{
"command": "pacquet@main",
"mean": 0.2362438818288889,
"stddev": 0.011639110495485603,
"median": 0.23147216994000003,
"user": 0.24871822666666668,
"system": 0.047849451111111115,
"min": 0.21898460394000002,
"max": 0.25664363094
},
{
"command": "pnpm@HEAD",
"mean": 3.995303321051111,
"stddev": 0.4181086032436757,
"median": 3.94529415694,
"user": 6.070945226666667,
"system": 0.44003322888888896,
"min": 3.45700777594,
"max": 4.80781710894
}
],
"confirmation": {
"results": [
{
"command": "pnpm@HEAD",
"mean": 4.038196568155555,
"stddev": 0.2601460645241363,
"median": 4.1214874226,
"user": 6.1046379377777775,
"system": 0.43561591555555557,
"min": 3.5766726496,
"max": 4.3368980076
},
{
"command": "pacquet@main",
"mean": 0.26664202293333333,
"stddev": 0.009465307673758933,
"median": 0.2670453326,
"user": 0.27402316,
"system": 0.06044269333333333,
"min": 0.2491482596,
"max": 0.2807736436
},
{
"command": "pacquet@HEAD",
"mean": 0.2669225071555556,
"stddev": 0.013146000230531078,
"median": 0.26136027359999997,
"user": 0.2733876044444445,
"system": 0.054889582222222205,
"min": 0.2506446166,
"max": 0.28189152959999997
}
]
}
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25481557900181817,
"stddev": 0.020604718170475284,
"median": 0.24726062182,
"user": 0.20266172181818182,
"system": 0.10069672545454544,
"min": 0.22987250882000002,
"max": 0.30135935682000003
},
{
"command": "pacquet@main",
"mean": 0.23035281909272728,
"stddev": 0.017649329323386385,
"median": 0.22750885182,
"user": 0.18833335818181818,
"system": 0.08297872545454545,
"min": 0.21369259982,
"max": 0.26374234882
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.499343474080001,
"stddev": 0.13291424499699467,
"median": 4.4395513612799995,
"user": 1.6877657399999997,
"system": 1.6509147599999998,
"min": 4.36371479628,
"max": 4.70452737128
},
{
"command": "pacquet@main",
"mean": 4.5075948628799996,
"stddev": 0.11911566146499084,
"median": 4.4796068172800005,
"user": 1.5899732399999995,
"system": 1.55962456,
"min": 4.37468179928,
"max": 4.73347271628
},
{
"command": "pnpr@HEAD",
"mean": 3.53860710008,
"stddev": 0.09472390523460189,
"median": 3.50460256478,
"user": 1.50182324,
"system": 1.44846506,
"min": 3.43766415528,
"max": 3.77412074528
},
{
"command": "pnpr@main",
"mean": 3.6337033330800006,
"stddev": 0.08321301557137274,
"median": 3.6588357022799998,
"user": 1.7365448399999999,
"system": 1.65581986,
"min": 3.48257731928,
"max": 3.72485472728
}
]
}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.29425331392,
"stddev": 0.014795418201237807,
"median": 0.29385252712000004,
"user": 0.34408836000000004,
"system": 0.2818843,
"min": 0.26277648612000004,
"max": 0.31544771312000003
},
{
"command": "pacquet@main",
"mean": 0.24337659772000003,
"stddev": 0.0669116100579821,
"median": 0.27661600062,
"user": 0.29545256,
"system": 0.24542129999999998,
"min": 0.15776355111999998,
"max": 0.31542923412
},
{
"command": "pnpr@HEAD",
"mean": 0.18023809551999997,
"stddev": 0.007320729631564708,
"median": 0.17992007812,
"user": 0.22005889333333334,
"system": 0.16576736666666664,
"min": 0.16339517212,
"max": 0.19390803312
},
{
"command": "pnpr@main",
"mean": 0.1907023910430769,
"stddev": 0.01090157066526212,
"median": 0.19578307312,
"user": 0.2205107907692308,
"system": 0.1738368384615385,
"min": 0.17507798612,
"max": 0.20697140712
}
]
} |
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.
01e8b8e to
ebadd4c
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… sentence 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 808d75b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Review-and-fix pass on this PR:
Status on 808d75b: all checks green. CodeRabbit approved with no actionable comments. Qodo reports only the declined item. Greptile posts no reviews (trial ended). Nothing else remains within scope. Written by an agent (Claude Code, claude-opus-5-5). |
…17033) An injected copy is built by the install from the package files only (the files field and .npmignore) unless deployAllFiles is set. Every refresh that runs after a project's own scripts read the source with every file instead, so the copy gained files the install had left out: - v12: the sync after lifecycle scripts during install, after `pnpm run` and task-pipeline scripts named in syncInjectedDepsAfterScripts, and the edit watcher that publishes while such a script runs. - v11: the same `pnpm run` sync and watcher, and the re-import after lifecycle scripts during install. #16684 fixed the same thing for the dedicated-lockfile sync. These paths now read the source with includeOnlyPackageFiles set to !deployAllFiles too, so every writer of an injected copy selects the same files (pnpm/tasks#145, property B). The packlist lists a symlinked directory as one entry, where the walk of every file lists the files under it. The syncers expand such an entry, so a symlinked directory still reaches the copy as its files. v12 groups the bin-linking settings of SyncInjectedDeps into BinLinkSettings to stay under the struct field limit.
Every writer of an injected copy, and `pnpm deploy`, read its source through a `DirectoryFetcher` it built itself, with `include_only_package_files` computed at each call site as `!config.deploy_all_files`. #16684 and #17033 were writers that got that flag wrong. `pnpm_directory_fetcher::CopyFiles` now owns the decision: the packlist or every file, symlinks listed by their own path, and no path escape. The install's directory fetch, the custom fetcher's directory callback, the sync after scripts, the edit watcher, the dedicated-lockfile sync and deploy all list their source through `CopyFiles::fetcher`, and take a `CopyFiles` built from the `deployAllFiles` setting instead of a bool. This is item 2 of pnpm/tasks#220 for pnpm v12. No behavior changes. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
With
sharedWorkspaceLockfile: false, an injected workspace package got every file of its project directory (tsconfig.json, its ownpnpm-lock.yaml) when the package was installed in the same run as its dependent. With only the dependent selected, the copy held just the files thatfilesselects.#15685 added a sync that runs after a split-lockfile install and patches the injected copies of every selected project from its source directory. The sync read the source with all files, while the install builds the copy from the package files unless
deployAllFilesis set. So the sync added every file the install had left out. Both pnpm v11 and v12 have the bug, so both are fixed.The sync now reads the source with the same file selection as the install (
!deployAllFiles). The target is still read in full, so files that an earlier sync added are removed. The sync after a project's own scripts with a shared lockfile is unchanged.With this change the issue's script prints
index.js package.jsonfor both--filterruns. WithdeployAllFiles: truethe copy still holds every file.Fixes #16683
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.
Written by an agent (Claude Code, claude-opus-5-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
filesfield when installed alongside a dependent.tsconfig.jsonand lockfiles, are excluded from the installed copy in this mode.deployAllFilesis enabled, all files continue to be included.