Repository navigation
fix: don't spawn an install outside a project; port verify-deps-before-run to pacquet - #12910
Conversation
|
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:
📝 WalkthroughWalkthroughPacquet now verifies dependency freshness before ChangesVerify dependencies before execution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Command
participant VerifyDeps as verify_deps_before_run
participant Status as check_deps_status_before_run_at
participant Install
Command->>VerifyDeps: verify dependencies
VerifyDeps->>Status: check freshness
Status-->>VerifyDeps: dependency status
VerifyDeps->>Install: spawn install when configured
Install-->>Command: return status or continue execution
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 |
PR Summary by QodoSkip verify-deps-before-run install when no project manifest exists
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.changeset/violet-pianos-brush.md (1)
6-6: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor wording nit: "outside of" → "outside".
LanguageTool flags "outside of a project" as redundant; "outside a project" is more concise. Purely cosmetic for changeset prose.
✏️ Proposed wording tweak
-A mistyped command run outside of a project (for example `pnpm witch 10 login`) +A mistyped command run outside a project (for example `pnpm witch 10 login`)🤖 Prompt for 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. In @.changeset/violet-pianos-brush.md at line 6, Update the changeset prose by replacing “outside of a project” with “outside a project”; make no other changes.Source: Linters/SAST tools
🤖 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.
Nitpick comments:
In @.changeset/violet-pianos-brush.md:
- Line 6: Update the changeset prose by replacing “outside of a project” with
“outside a project”; make no other changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: eef5fbd7-8c98-4c23-810c-21b6c21a7835
📒 Files selected for processing (3)
.changeset/violet-pianos-brush.mdpnpm11/deps/status/src/checkDepsStatus.tspnpm11/deps/status/test/checkDepsStatus.test.ts
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
PR Code Suggestions ✨Latest suggestions up to 47257df Warning
Previous suggestionsSuggestions up to commit e39d710
Suggestions up to commit 00c83a5
Suggestions up to commit 8de2d8a
Suggestions up to commit 8f0926a
Suggestions up to commit 8f170e1
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Micro-Benchmark ResultsLinux |
|
Code review by qodo was updated up to the latest commit 8f170e1 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pacquet/crates/cli/tests/run.rs (1)
515-523: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd logging before non-
assert_eq!assertions.Per
pacquet/CODE_STYLE_GUIDE.md, non-assert_eq!assertions should be preceded by logging to aid debugging. Theassert!on line 515 and the side-effectassert!on lines 520-523 lack pre-assertion diagnostic output. The stderr assertion on lines 516-519 partially mitigates this by embedding{stderr}in the failure message, but the other two do not.Consider adding
eprintln!calls before each assertion, e.g. printingstderrbefore the status check and printing the relevant paths before the side-effect check.♻️ Suggested additions
let stderr = String::from_utf8_lossy(&output.stderr); + eprintln!("pacquet stderr:\n{stderr}"); assert!(!output.status.success(), "a mistyped command must fail"); assert!( stderr.contains("witch-definitely-not-a-binary") && stderr.contains("not found"), "the failure must name the missing command, not come from a spawned install:\n{stderr}", ); + eprintln!( + "node_modules exists: {}, pnpm-lock.yaml exists: {}", + workspace.join("node_modules").exists(), + workspace.join("pnpm-lock.yaml").exists(), + ); assert!( !workspace.join("node_modules").exists() && !workspace.join("pnpm-lock.yaml").exists(), "no install may run in a directory without a manifest", );🤖 Prompt for 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. In `@pacquet/crates/cli/tests/run.rs` around lines 515 - 523, Add diagnostic eprintln! calls immediately before the non-assert_eq! assertions in the relevant test: print the command output/stderr before the status assertion, and print the workspace node_modules and pnpm-lock.yaml paths and existence state before the side-effect assertion. Keep the existing assertions and messages unchanged.Source: Path instructions
🤖 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.
Nitpick comments:
In `@pacquet/crates/cli/tests/run.rs`:
- Around line 515-523: Add diagnostic eprintln! calls immediately before the
non-assert_eq! assertions in the relevant test: print the command output/stderr
before the status assertion, and print the workspace node_modules and
pnpm-lock.yaml paths and existence state before the side-effect assertion. Keep
the existing assertions and messages unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 73430a7e-c94e-43b5-a6bd-d4fa1727c6c3
📒 Files selected for processing (1)
pacquet/crates/cli/tests/run.rs
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12910 +/- ##
==========================================
- Coverage 85.49% 85.45% -0.04%
==========================================
Files 468 469 +1
Lines 72828 73228 +400
==========================================
+ Hits 62266 62579 +313
- Misses 10562 10649 +87 ☔ 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.8527304613399997,
"stddev": 0.15302708814422228,
"median": 3.83381351994,
"user": 3.57638482,
"system": 3.4415381000000003,
"min": 3.67872562744,
"max": 4.08490330944,
"times": [
3.97255157744,
4.08490330944,
3.98930022344,
3.67872562744,
3.79962590544,
4.014815404439999,
3.71015151044,
3.86800113444,
3.70881718644,
3.70041273444
]
},
{
"command": "pacquet@main",
"mean": 3.80264872074,
"stddev": 0.13550153140862556,
"median": 3.7754400774400003,
"user": 3.57870372,
"system": 3.4609335999999997,
"min": 3.64399662844,
"max": 4.01177764744,
"times": [
3.84485737044,
3.7926189534400003,
3.7582612014400003,
3.99424083544,
4.01177764744,
3.74310856444,
3.67166346744,
3.91394853644,
3.65201400244,
3.64399662844
]
},
{
"command": "pnpr@HEAD",
"mean": 2.14592961424,
"stddev": 0.10240832132945765,
"median": 2.1261309434399998,
"user": 2.6654210199999997,
"system": 3.0404145000000007,
"min": 2.01410237144,
"max": 2.31872713344,
"times": [
2.01410237144,
2.31872713344,
2.26491750544,
2.10658549544,
2.14567639144,
2.21908463444,
2.20625135244,
2.05935830544,
2.04027753244,
2.08431542044
]
},
{
"command": "pnpr@main",
"mean": 2.16933872304,
"stddev": 0.1347520656507724,
"median": 2.1494423544399996,
"user": 2.6198841199999996,
"system": 3.060248,
"min": 2.01336874844,
"max": 2.36872614544,
"times": [
2.33481689244,
2.11787201144,
2.36872614544,
2.18101269744,
2.07375022344,
2.03341476744,
2.01336874844,
2.27080730544,
2.27330376944,
2.02631466944
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.65720957924,
"stddev": 0.023836524899982964,
"median": 0.65284062164,
"user": 0.38904314,
"system": 1.3481698999999998,
"min": 0.63566348364,
"max": 0.71234099764,
"times": [
0.71234099764,
0.68138664364,
0.66260281064,
0.63566348364,
0.64362655264,
0.63785638964,
0.65546559764,
0.63747207364,
0.65104289864,
0.65463834464
]
},
{
"command": "pacquet@main",
"mean": 0.6610415271400001,
"stddev": 0.03389255043656542,
"median": 0.65436903414,
"user": 0.39198163999999996,
"system": 1.3401798999999999,
"min": 0.62912608464,
"max": 0.74569619064,
"times": [
0.64995279264,
0.6605930076400001,
0.62912608464,
0.63408410764,
0.68650058864,
0.6513297166400001,
0.65740835164,
0.65787226164,
0.63785216964,
0.74569619064
]
},
{
"command": "pnpr@HEAD",
"mean": 0.69863878824,
"stddev": 0.014426115224161389,
"median": 0.7005610146400001,
"user": 0.39845823999999996,
"system": 1.3580942999999999,
"min": 0.68104483664,
"max": 0.72076755864,
"times": [
0.72076755864,
0.68434013064,
0.71811642464,
0.68104483664,
0.7068899696400001,
0.68175499764,
0.70133150064,
0.70379512464,
0.69979052864,
0.68855681064
]
},
{
"command": "pnpr@main",
"mean": 0.72085117274,
"stddev": 0.011642909123142671,
"median": 0.72348982514,
"user": 0.39249784,
"system": 1.4125001000000001,
"min": 0.69685085964,
"max": 0.73454017364,
"times": [
0.73454017364,
0.7330625416400001,
0.72525483164,
0.72191805864,
0.7250615916400001,
0.7154850996400001,
0.72837740164,
0.69685085964,
0.70729523564,
0.72066593364
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.293227912940001,
"stddev": 0.04298547373560574,
"median": 4.28918101204,
"user": 3.7745721599999995,
"system": 3.4429795799999994,
"min": 4.24057092204,
"max": 4.3562408470400005,
"times": [
4.34882300204,
4.26795681204,
4.29126227004,
4.28709975404,
4.3562408470400005,
4.31751517904,
4.24693646504,
4.2471524370400004,
4.24057092204,
4.32872144104
]
},
{
"command": "pacquet@main",
"mean": 4.260846425639999,
"stddev": 0.03384096860293878,
"median": 4.2569059845399995,
"user": 3.74817976,
"system": 3.44447848,
"min": 4.21364520904,
"max": 4.32405893404,
"times": [
4.24305892004,
4.27681368104,
4.29818374004,
4.22049503604,
4.27365422804,
4.21364520904,
4.24474253904,
4.25272047804,
4.32405893404,
4.26109149104
]
},
{
"command": "pnpr@HEAD",
"mean": 2.27014936944,
"stddev": 0.1686399491614708,
"median": 2.28479541304,
"user": 2.49221226,
"system": 2.9604022800000003,
"min": 2.03071330504,
"max": 2.4519013690400002,
"times": [
2.13987205304,
2.39950822404,
2.42060479404,
2.15578502604,
2.17008260204,
2.07924064504,
2.03071330504,
2.44381936504,
2.4519013690400002,
2.40996631104
]
},
{
"command": "pnpr@main",
"mean": 2.1897799244400002,
"stddev": 0.10699909559206539,
"median": 2.14316931554,
"user": 2.4867817599999995,
"system": 2.97086768,
"min": 2.06853488504,
"max": 2.36756615204,
"times": [
2.20471837504,
2.06853488504,
2.10816859304,
2.14678541004,
2.13955322104,
2.3623888280400003,
2.11421534604,
2.36756615204,
2.26347640604,
2.12239202804
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.3749179536200002,
"stddev": 0.013149347042046912,
"median": 1.3758657675200001,
"user": 1.32634432,
"system": 1.73516368,
"min": 1.3552355425200002,
"max": 1.39727427052,
"times": [
1.3769207445200002,
1.37778160852,
1.36760860252,
1.3729259955200002,
1.3785600555200002,
1.3552355425200002,
1.3569357935200002,
1.37481079052,
1.39727427052,
1.3911261325200002
]
},
{
"command": "pacquet@main",
"mean": 1.3784988000200005,
"stddev": 0.025893088393895945,
"median": 1.37318638702,
"user": 1.31427742,
"system": 1.73391418,
"min": 1.3453107675200002,
"max": 1.44466977152,
"times": [
1.3696524115200002,
1.44466977152,
1.3744353205200002,
1.37897240752,
1.3729059145200002,
1.3734668595200001,
1.3453107675200002,
1.39010158252,
1.36348500052,
1.3719879645200002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.69920867332,
"stddev": 0.07084672104068476,
"median": 0.67634877302,
"user": 0.34325691999999997,
"system": 1.31013598,
"min": 0.66496915252,
"max": 0.89995913652,
"times": [
0.67324215452,
0.67419948152,
0.66496915252,
0.6750824775200001,
0.89995913652,
0.68715978952,
0.68686503652,
0.67761506852,
0.6798876045200001,
0.6731068315200001
]
},
{
"command": "pnpr@main",
"mean": 0.69715190962,
"stddev": 0.06060639258634049,
"median": 0.67722788952,
"user": 0.34692022,
"system": 1.32233938,
"min": 0.67041086352,
"max": 0.86884282652,
"times": [
0.67623565452,
0.67110211152,
0.67708525852,
0.68420290252,
0.67041086352,
0.68978659852,
0.67522892352,
0.86884282652,
0.68125343652,
0.67737052052
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.06552412636,
"stddev": 0.06407935237831794,
"median": 3.0513828925599995,
"user": 1.79458776,
"system": 2.0093041,
"min": 3.00441629906,
"max": 3.23780859706,
"times": [
3.06506731606,
3.04376774106,
3.0561534510599997,
3.0264929110599996,
3.0485724510599996,
3.05419333406,
3.00441629906,
3.23780859706,
3.0813326650599997,
3.03743649806
]
},
{
"command": "pacquet@main",
"mean": 3.06806378676,
"stddev": 0.061123142735924084,
"median": 3.05119275656,
"user": 1.80308966,
"system": 1.9825525,
"min": 3.02884555606,
"max": 3.23984384506,
"times": [
3.0411519660599997,
3.04444536806,
3.05033358606,
3.04851857106,
3.02884555606,
3.0539610910599997,
3.05205192706,
3.23984384506,
3.06504319606,
3.05644276106
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6682635529600001,
"stddev": 0.008955353285908012,
"median": 0.6679445320600002,
"user": 0.34916255999999996,
"system": 1.2976602000000002,
"min": 0.65705861206,
"max": 0.6805734710600001,
"times": [
0.6805734710600001,
0.6722990860600001,
0.66234013006,
0.6635899780600001,
0.6773800700600001,
0.6752459060600001,
0.6605922400600001,
0.65705861206,
0.67616840706,
0.65738762906
]
},
{
"command": "pnpr@main",
"mean": 0.6836219699600001,
"stddev": 0.03741004768760641,
"median": 0.6750526560600001,
"user": 0.33780906,
"system": 1.3038203000000002,
"min": 0.6575357260600001,
"max": 0.7875780450600001,
"times": [
0.6836316100600001,
0.6575357260600001,
0.6747420180600001,
0.6653304940600001,
0.6661220750600001,
0.66685201506,
0.6753632940600001,
0.68121742906,
0.7875780450600001,
0.6778469930600001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6297666129000001,
"stddev": 0.009883446547638406,
"median": 0.6272547377000001,
"user": 0.5997027600000001,
"system": 0.15050837999999997,
"min": 0.6211871217000001,
"max": 0.6530399087000001,
"times": [
0.6294680217,
0.6250414537000001,
0.6310531437000001,
0.6211871217000001,
0.6305878687,
0.6530399087000001,
0.6220427377000001,
0.6221094017000001,
0.6391299797000001,
0.6240064917000001
]
},
{
"command": "pacquet@main",
"mean": 0.6366074752000002,
"stddev": 0.010584463859975184,
"median": 0.6341116662000001,
"user": 0.5940817599999999,
"system": 0.16125578000000002,
"min": 0.6212938907000001,
"max": 0.6566505517000001,
"times": [
0.6346275897000001,
0.6395418097000001,
0.6246599467,
0.6307780567000001,
0.6335747037,
0.6458147907,
0.6335957427000001,
0.6566505517000001,
0.6455376697,
0.6212938907000001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10784286304615387,
"stddev": 0.0007114639967048756,
"median": 0.10793718320000001,
"user": 0.02641121384615385,
"system": 0.020745703076923076,
"min": 0.10536278470000002,
"max": 0.10880963970000002,
"times": [
0.10536278470000002,
0.10785029870000001,
0.10819395470000001,
0.10761995770000002,
0.10859969670000001,
0.10880963970000002,
0.10626243070000001,
0.10803412670000001,
0.10763197870000002,
0.10798819870000001,
0.10845460470000001,
0.10730194170000001,
0.10783683470000001,
0.10866666170000001,
0.10749716570000001,
0.10781988370000001,
0.10792897770000001,
0.10831889870000001,
0.10796675870000001,
0.10835759270000002,
0.10765491370000001,
0.10768001970000002,
0.10794538870000002,
0.1080840187,
0.10786983670000001,
0.10817787470000001
]
},
{
"command": "pnpr@main",
"mean": 0.10790370738,
"stddev": 0.00037585348205968914,
"median": 0.10787007670000001,
"user": 0.027970000000000002,
"system": 0.019001979999999998,
"min": 0.10713088170000001,
"max": 0.10870768870000001,
"times": [
0.10739611770000002,
0.10805268070000001,
0.10870768870000001,
0.10751956870000001,
0.10821238870000001,
0.10779391470000001,
0.10777763470000001,
0.10773284870000001,
0.10768332670000001,
0.10870439270000001,
0.10772944270000001,
0.10779028970000001,
0.10791429970000001,
0.10749714770000002,
0.10795258170000001,
0.10823310770000001,
0.10713088170000001,
0.10824375570000001,
0.10826035970000002,
0.10787007670000001,
0.10747600770000001,
0.10813012470000001,
0.10771725970000001,
0.10795870370000002,
0.10810808370000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.615612388040001,
"stddev": 0.10940655886020467,
"median": 6.61567593624,
"user": 3.75002382,
"system": 3.7492559199999995,
"min": 6.46439885524,
"max": 6.75519484724,
"times": [
6.53097697224,
6.75519484724,
6.56534057524,
6.51569016224,
6.46439885524,
6.74177158624,
6.50880117424,
6.66601129724,
6.71459506224,
6.69334334824
]
},
{
"command": "pacquet@main",
"mean": 6.55238199084,
"stddev": 0.1768649797737978,
"median": 6.50380336924,
"user": 3.77615792,
"system": 3.7365869199999997,
"min": 6.36002565424,
"max": 6.96348023924,
"times": [
6.46429441024,
6.5266540192399995,
6.56562778024,
6.36002565424,
6.46405748924,
6.4163107222399995,
6.96348023924,
6.48095271924,
6.54187960324,
6.74053727124
]
},
{
"command": "pnpr@HEAD",
"mean": 5.01188508404,
"stddev": 0.07200629359235468,
"median": 5.01940949024,
"user": 2.7787605199999996,
"system": 3.274568919999999,
"min": 4.90727174824,
"max": 5.10619719924,
"times": [
4.98128176324,
4.94083525124,
4.90727174824,
5.00357333024,
4.92213074624,
5.05559697324,
5.03524565024,
5.10619719924,
5.07875739324,
5.08796078524
]
},
{
"command": "pnpr@main",
"mean": 4.95565267964,
"stddev": 0.06456594666997163,
"median": 4.93877512074,
"user": 2.7862506199999997,
"system": 3.2666924199999996,
"min": 4.86831171624,
"max": 5.05353410024,
"times": [
5.05353410024,
5.04802727324,
4.99854036224,
4.93957615224,
4.91003726724,
4.89767016824,
4.99551748424,
4.93797408924,
4.90733818324,
4.86831171624
]
}
]
} |
|
| Branch | pr/12910 |
| 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,270.15 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 668.26 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 699.21 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 107.84 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,145.93 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 5,011.89 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 698.64 ms |
8f0926a to
8de2d8a
Compare
|
Addressed the automated review findings in 3030a45:
Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 00c83a5 |
- Keep the pre-run check read-only: pnpm's run path never writes pnpm-lock.yaml (only the install command restores it from the current lockfile), so the gate now uses a read-only stand-in check instead of regenerate_wanted_lockfile_if_missing, and a missing lockfile without a stand-in reports "Cannot find a lockfile" like pnpm instead of passing silently. - Match pnpm's env-var semantics for unrecognized values: pnpm assigns pnpm_config_verify_deps_before_run verbatim without validation, so a present-but-invalid value is truthy there (check runs, no action matches). Parse failures now map to VerifyDepsBeforeRun::True instead of being dropped, which also keeps a present env var overriding the CLI consistently. - Report "cannot check" straight from the missing workspace state, before the workspace-projects walk, sparing fresh projects the discovery cost on every run/exec. - Share the recursion-guard env-var name through a constant, cover the exec-path stamp with a test, and drop a test doc comment that only restated the assertions. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Triage of the updated Qodo review (which ran against 00c83a5, one commit behind): Fixed in e39d710:
Not applied:
Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit e39d710 |
…e paths - Apply the pnpm_config_verify_deps_before_run env var on presence alone, like pnpm's `!= null` check: an empty value disables the gate (pnpm assigns the empty string, which is falsy there) and still overrides the CLI. - Load the workspace state once: the discovery wrapper already loads it to short-circuit before the projects walk, so it now hands the loaded state to check_deps_status_before_run instead of having it re-read the file. - Report an unreadable current lockfile as "the current lockfile cannot be loaded" instead of pretending it is missing. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Triage of the latest Qodo review (against e39d710) — the three new findings are all addressed in 47257df:
The remaining entries in the review are carried over from earlier commits and were either fixed there (read-only lockfile check, invalid-env handling, early state check, doc comments, side-effect assert — 3030a45 / e39d710) or rejected for TS parity with reasoning in the previous triage comments ( Written by an agent (Claude Code, claude-fable-5). |
|
Code review by qodo was updated up to the latest commit 47257df |
|
TS CI failure root cause + fix (67e9b56): the failing jobs never reached any test — the Fix: a hidden global Note for other PRs: this unblocks their TS CI as well once it lands. Written by an agent (Claude Code, claude-fable-5). |
pnpm installs a workspace whose root has no package.json with no root importer and never creates one. pacquet's State::init scaffolded the init-template package.json there instead, which diverges on disk and, since the verify-deps-before-run gate started spawning an install ahead of every run (pnpm#12910), poisoned recursive runs: the scaffolded manifest carries npm's default failing test script, the root joined the workspace graph as a selectable project, and a root change (like pnpm-workspace.yaml) selected it — which is what broke run_recursive's test_pattern_from_workspace_yaml_is_respected_by_the_test_script on main after pnpm#12910 landed on top of pnpm#12914. Inside a workspace the stand-in root manifest now stays in memory only. Non-workspace installs keep scaffolding, and commands that save the manifest (add) still persist it through their explicit save. The remaining shape difference — pacquet still writes an empty root importer to pnpm-lock.yaml where pnpm writes none — is a separate, smaller parity gap. Co-Authored-By: Claude Fable 5 <[email protected]>
pnpm installs a workspace whose root has no package.json with no root importer and never creates one. pacquet's State::init scaffolded the init-template package.json there instead, which diverges on disk and, since the verify-deps-before-run gate started spawning an install ahead of every run (pnpm#12910), poisoned recursive runs: the scaffolded manifest carries npm's default failing test script, the root joined the workspace graph as a selectable project, and a root change (like pnpm-workspace.yaml) selected it — which is what broke run_recursive's test_pattern_from_workspace_yaml_is_respected_by_the_test_script on main after pnpm#12910 landed on top of pnpm#12914. Inside a workspace the stand-in root manifest now stays in memory only. Non-workspace installs keep scaffolding, and commands that save the manifest (add) still persist it through their explicit save. The remaining shape difference — pacquet still writes an empty root importer to pnpm-lock.yaml where pnpm writes none — is a separate, smaller parity gap. Co-Authored-By: Claude Fable 5 <[email protected]>
pnpm installs a workspace whose root has no package.json with no root importer and never creates one. pacquet's State::init scaffolded the init-template package.json there instead, which diverges on disk and, since the verify-deps-before-run gate started spawning an install ahead of every run (pnpm#12910), poisoned recursive runs: the scaffolded manifest carries npm's default failing test script, the root joined the workspace graph as a selectable project, and a root change (like pnpm-workspace.yaml) selected it — which is what broke run_recursive's test_pattern_from_workspace_yaml_is_respected_by_the_test_script on main after pnpm#12910 landed on top of pnpm#12914. Inside a workspace the stand-in root manifest now stays in memory only. Non-workspace installs keep scaffolding, and commands that save the manifest (add) still persist it through their explicit save. The remaining shape difference — pacquet still writes an empty root importer to pnpm-lock.yaml where pnpm writes none — is a separate, smaller parity gap. Co-Authored-By: Claude Fable 5 <[email protected]>
pnpm installs a workspace whose root has no package.json with no root importer and never creates one. pacquet's State::init scaffolded the init-template package.json there instead, which diverges on disk and, since the verify-deps-before-run gate started spawning an install ahead of every run (pnpm#12910), poisoned recursive runs: the scaffolded manifest carries npm's default failing test script, the root joined the workspace graph as a selectable project, and a root change (like pnpm-workspace.yaml) selected it — which is what broke run_recursive's test_pattern_from_workspace_yaml_is_respected_by_the_test_script on main after pnpm#12910 landed on top of pnpm#12914. Inside a workspace the stand-in root manifest now stays in memory only. Non-workspace installs keep scaffolding, and commands that save the manifest (add) still persist it through their explicit save. The remaining shape difference — pacquet still writes an empty root importer to pnpm-lock.yaml where pnpm writes none — is a separate, smaller parity gap. Co-Authored-By: Claude Fable 5 <[email protected]>
…o pnpr (#12922) Port `pnpm stage` (publish, list, view, approve, reject, download) to the Rust CLI, mirroring the TypeScript command's flags, error codes, endpoints, and output. `stage publish` reuses the publish pipeline (PublishArgs is split into a reusable PublishFlags, and the pipeline returns summaries instead of printing); approve/reject drive the shared OTP / web-auth flow; download summarizes the tarball with the same traversal protections as the TypeScript implementation. Also fixes the staged-publish route in pacquet-publish to POST -/stage/package/:pkg (libnpmpublish's stage route) instead of the regular packument PUT — previously unreachable because the CLI hardcoded stage: false. pnpr grows the server half: POST /-/stage/package/:pkg validates and authorizes like a direct publish and holds the document under a UUID; list/view/tarball inspect held records; approve replays the document through the regular validate/stage/commit flow; reject deletes it. Records persist under a reserved .staged/ namespace on the fs and S3 backends, with stage-id validation ahead of any path or object key. Shared plumbing: the capped response-body reader moves from the dist-tag command into pacquet-network, and pacquet-pack exports its en-locale path sort for the tarball summary. Also fixes a broken test on main (semantic conflict between #12910 and #12914): State::init no longer persists a scaffolded root package.json when a pnpm-workspace.yaml sits next to the missing manifest, so a verify-deps-before-run install can't turn the workspace root into a selectable project with the init template's failing test script.
Summary
Running pnpm in a directory without a
package.json— most commonly through a mistyped command that falls back topnpm run(e.g.pnpm witch 10 login) — crashed with a confusing error under the defaultverify-deps-before-run: install:checkDepsStatusfound no workspace state and reported the dependencies as outdated, sorunDepsStatusCheckspawned apnpm installthat could only fail withNO_PKG_MANIFEST, and the parent process dumped a raw execa stack trace.TypeScript fix:
checkDepsStatusnow reports "unknown" (upToDate: undefined) when there is no root manifest, no workspace, and no project list.runDepsStatusCheckalready skips the check in that case, so the command fails with the regular, single-line "no package.json found" error.pacquet: this PR also ports the entire
verify-deps-before-rungate to pacquet (it was in theNOT_PORTEDparity list), including the fix above:VerifyDepsBeforeRunconfig setting (installdefault matching pnpm'sdefaultOptions), readable frompnpm-workspace.yaml, the globalconfig.yaml,PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN/pnpm_config_verify_deps_before_run, and--config.verify-deps-before-run=...; moved fromNOT_PORTEDto the mapped parity rows.check_deps_status_before_runinpacquet-package-manager: a second consumer of the deps-status machinery behind the install fast path, with the run gate's differences — runs regardless ofoptimisticRepeatInstall, no local-file-dep bail, ignoresdev/optional/productiondrift, compares configuration dependencies, and reports pnpm's user-facing issue wording. The no-project guard returns "skip" so a mistyped command outside a project never spawns a doomed install (the same fix as the TS side).run,exec, their recursive paths, and the top-level fallback, with theinstall/prompt/error/warnactions (ERR_PNPM_VERIFY_DEPS_BEFORE_RUN, non-interactiveprompterror,--production/--dev/--no-optionalinstall args derived from the recorded workspace state).pnpm_config_verify_deps_before_run=false, and that env var outranks every other config source for this key (infinite loop with a postinstall task andverifyDepsBeforeRun: install#10060).pacquet installin apackage.yamlproject used to scaffold a defaultpackage.jsonthat shadowed the real manifest;State::initnow loads an existing alternate manifest base name instead.Known message divergences (noted for follow-up): deep lockfile-content mismatches reuse pacquet's existing diagnostic strings rather than pnpm's exact issue wording, and lockfile merge conflicts surface as a parse failure instead of pnpm's dedicated conflict message. Both only affect the text shown by
warn/errormodes.Squash Commit Body
Checklist
pacquet/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 (Claude Code, claude-fable-5).
Summary by CodeRabbit
New Features
verify-deps-before-rungate forpnpm runandpnpm exec, supportinginstall,warn,error,prompt, and boolean modes.Bug Fixes