Repository navigation
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:
📝 WalkthroughWalkthroughThis PR adds package.yaml support to manifest reading and workspace discovery, threads recursive CLI options through dispatch and validation, and updates recursive run/exec flows to use shared manifest loading and honor sort control. ChangesManifest and recursive CLI updates
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: ✨ 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 Qodofix(pacquet): add package.yaml support to manifest reader and script dispatch
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
51 rules 1.
|
Micro-Benchmark ResultsLinux |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
pacquet/crates/workspace/src/projects.rs (2)
188-228: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winManifest-format precedence relies on incidental lexicographic sort, not an explicit invariant.
package.jsonwinning overpackage.yamlfor the same directory (as asserted bypackage_json_wins_when_both_manifest_files_exist) currently works only becausesort_byis stable andBTreeSet<PathBuf>happens to order"package.json"before"package.yaml"alphabetically ('j' < 'y'). The sort key itself (Line 190-194) only comparesdir_left/dir_right, so the precedence for same-directory manifests is an accidental byproduct of string ordering rather than a codified rule tied toPROJECT_MANIFEST_BASENAMES's declared order.This is fragile: any future manifest basename that doesn't happen to sort after
"package.json"(e.g. something starting witha-i) would silently invert precedence without any test catching it until runtime.Consider making the tie-break explicit, e.g.:
♻️ Suggested explicit precedence tie-break
let mut sorted: Vec<PathBuf> = manifest_paths.into_iter().collect(); sorted.sort_by(|left, right| { let dir_left = left.parent().unwrap_or_else(|| Path::new("")); let dir_right = right.parent().unwrap_or_else(|| Path::new("")); - dir_left.cmp(dir_right) + dir_left.cmp(dir_right).then_with(|| { + let rank = |p: &Path| { + let name = p.file_name().and_then(|n| n.to_str()).unwrap_or(""); + PROJECT_MANIFEST_BASENAMES.iter().position(|b| *b == name).unwrap_or(usize::MAX) + }; + rank(left).cmp(&rank(right)) + }) });This makes
package.json-over-package.yamlprecedence a documented, testable contract driven byPROJECT_MANIFEST_BASENAMES's order rather than a side effect ofPathBuf'sOrdimpl.As per pacquet's coding conventions, "Keep comments focused on non-obvious contracts/invariants ... prefer renaming/extraction over commentary" (CODE_STYLE_GUIDE.md) — this invariant is currently neither documented nor enforced explicitly.
🤖 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/workspace/src/projects.rs` around lines 188 - 228, The manifest selection in the project discovery logic relies on incidental path ordering instead of an explicit precedence rule. Update the sorting/selection in the workspace project scan so same-directory manifests are ordered by the declared manifest basename priority from PROJECT_MANIFEST_BASENAMES, with package.json consistently winning over package.yaml, rather than depending on PathBuf lexicographic behavior. Keep the existing deduping in the projects collection, but make the tie-break explicit in the manifest_paths sorting and any helper used by read_exact_project_manifest / FindWorkspaceProjectsError handling.Source: Path instructions
152-179: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winDoubles glob-walk I/O per include pattern.
Each user-supplied include pattern now runs a full separate
glob.walk(workspace_root)forpackage.jsonand again forpackage.yaml, effectively doubling directory-tree traversal cost for workspace project discovery. For large monorepos this is extra work on what is effectively a startup hot path.Consider combining both basenames into a single glob using brace alternation (e.g.
{trimmed}/{package.json,package.yaml}, since wax already treats{/}as glob metacharacters peris_literal_pattern) so each pattern only needs one walk. Note this would require adjusting the literal-pattern fast-path (Line 155) since a brace-alternation glob is no longer "literal" — you'd need to check both file paths individually for that case instead.As per path instructions, "Keep performance in mind for filesystem-probing changes (avoid extra work on hot paths)" (REVIEW_GUIDE.md).
🤖 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/workspace/src/projects.rs` around lines 152 - 179, The workspace discovery loop in find_workspace_projects is doing a separate glob.walk(workspace_root) for each include pattern variant, which doubles filesystem traversal for package.json and package.yaml. Refactor the pattern handling so both manifest basenames are matched in a single glob (using brace alternation or equivalent) and keep only one walk per user-supplied pattern. Update the is_literal_pattern fast-path to handle the combined glob case by checking both candidate manifest paths individually before skipping. Keep the existing error mapping and manifest_paths insertion behavior unchanged.Source: Path instructions
pacquet/crates/workspace/src/project_manifest.rs (1)
49-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBasename list duplicated across the crate — drift risk.
The
["package.json", "package.yaml"]list here is duplicated asPROJECT_MANIFEST_BASENAMESinpacquet/crates/workspace/src/projects.rs(Line 238). If a third manifest format is ever added, it's easy to update one list and forget the other, silently breaking discovery/dispatch parity betweentry_read_project_manifestand workspace project enumeration.Consider hoisting a single
pub(crate) const PROJECT_MANIFEST_BASENAMES: &[&str](e.g. in this file) and reusing it fromprojects.rs.🤖 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/workspace/src/project_manifest.rs` around lines 49 - 72, The manifest basename list is duplicated between try_read_project_manifest and workspace project enumeration, so update the code to use one shared source of truth instead of hardcoding ["package.json", "package.yaml"] in multiple places. Hoist a pub(crate) constant like PROJECT_MANIFEST_BASENAMES in project_manifest.rs, then have try_read_project_manifest and the project scanning logic in projects.rs reference that constant so any future manifest format change stays in sync.
🤖 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/workspace/src/project_manifest.rs`:
- Around line 49-72: The manifest basename list is duplicated between
try_read_project_manifest and workspace project enumeration, so update the code
to use one shared source of truth instead of hardcoding ["package.json",
"package.yaml"] in multiple places. Hoist a pub(crate) constant like
PROJECT_MANIFEST_BASENAMES in project_manifest.rs, then have
try_read_project_manifest and the project scanning logic in projects.rs
reference that constant so any future manifest format change stays in sync.
In `@pacquet/crates/workspace/src/projects.rs`:
- Around line 188-228: The manifest selection in the project discovery logic
relies on incidental path ordering instead of an explicit precedence rule.
Update the sorting/selection in the workspace project scan so same-directory
manifests are ordered by the declared manifest basename priority from
PROJECT_MANIFEST_BASENAMES, with package.json consistently winning over
package.yaml, rather than depending on PathBuf lexicographic behavior. Keep the
existing deduping in the projects collection, but make the tie-break explicit in
the manifest_paths sorting and any helper used by read_exact_project_manifest /
FindWorkspaceProjectsError handling.
- Around line 152-179: The workspace discovery loop in find_workspace_projects
is doing a separate glob.walk(workspace_root) for each include pattern variant,
which doubles filesystem traversal for package.json and package.yaml. Refactor
the pattern handling so both manifest basenames are matched in a single glob
(using brace alternation or equivalent) and keep only one walk per user-supplied
pattern. Update the is_literal_pattern fast-path to handle the combined glob
case by checking both candidate manifest paths individually before skipping.
Keep the existing error mapping and manifest_paths insertion behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f3013cec-f133-4fe2-8319-a69ef8aee97a
📒 Files selected for processing (8)
pacquet/crates/cli/src/cli_args/dispatch_script.rspacquet/crates/cli/src/cli_args/exec.rspacquet/crates/cli/src/cli_args/run.rspacquet/crates/cli/tests/run.rspacquet/crates/workspace/src/project_manifest.rspacquet/crates/workspace/src/project_manifest/tests.rspacquet/crates/workspace/src/projects.rspacquet/crates/workspace/src/projects/tests.rs
PR Code Suggestions ✨Latest suggestions up to 0f2ef1d Warning
Previous suggestionsSuggestions
|
||||||||||||||||||
|
Code review by qodo was updated up to the latest commit 2089d9e |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12842 +/- ##
==========================================
+ Coverage 85.80% 85.83% +0.03%
==========================================
Files 448 448
Lines 69402 69558 +156
==========================================
+ Hits 59552 59708 +156
Misses 9850 9850 ☔ 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": 4.2515360514,
"stddev": 0.1786515745488082,
"median": 4.1623380147999995,
"user": 3.9543601599999993,
"system": 3.5888201599999996,
"min": 4.0685445067999995,
"max": 4.5810889567999995,
"times": [
4.5810889567999995,
4.4257046868,
4.1628905138,
4.4892882628,
4.1124427238,
4.1345255407999995,
4.0685445067999995,
4.1607507448,
4.1617855158,
4.2183390618
]
},
{
"command": "pacquet@main",
"mean": 4.148353102700001,
"stddev": 0.09601389129684276,
"median": 4.1368538183,
"user": 3.91993776,
"system": 3.54930716,
"min": 4.0399657328,
"max": 4.3012845618,
"times": [
4.2535353038,
4.3012845618,
4.1226995588,
4.0399657328,
4.0471896998,
4.0820683928,
4.1931842468,
4.0476627257999995,
4.2449327268,
4.151008077799999
]
},
{
"command": "pnpr@HEAD",
"mean": 2.1912338625000003,
"stddev": 0.1393684487175056,
"median": 2.1783313593000004,
"user": 2.6977536599999996,
"system": 3.08141936,
"min": 1.9905536477999999,
"max": 2.3707178058,
"times": [
1.9905536477999999,
2.3232242548,
2.0715093448,
2.1439872498000003,
2.1274002308,
2.0312766278,
2.3694800138,
2.3707178058,
2.2126754688,
2.2715139808
]
},
{
"command": "pnpr@main",
"mean": 2.1743578568,
"stddev": 0.11251774718626001,
"median": 2.1337666748000004,
"user": 2.6878424599999997,
"system": 3.02886716,
"min": 2.0540624648000003,
"max": 2.3452500838000003,
"times": [
2.1134530758000003,
2.0704554208,
2.1243362838,
2.0540624648000003,
2.0666359678000004,
2.2942479668,
2.3452500838000003,
2.1431970658000004,
2.1969573018,
2.3349829368000004
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6569783462400001,
"stddev": 0.008443813567052115,
"median": 0.65636040264,
"user": 0.38890562,
"system": 1.3522325999999998,
"min": 0.64126006564,
"max": 0.67167830764,
"times": [
0.65466100364,
0.67167830764,
0.65601785864,
0.65388240464,
0.65670294664,
0.66110826264,
0.66405731364,
0.66188360064,
0.64126006564,
0.64853169864
]
},
{
"command": "pacquet@main",
"mean": 0.67687547714,
"stddev": 0.03028777599973449,
"median": 0.67369282764,
"user": 0.38697992000000003,
"system": 1.3517705999999998,
"min": 0.63950268964,
"max": 0.73829833964,
"times": [
0.65547413464,
0.64816630664,
0.68395900764,
0.63950268964,
0.71159693964,
0.67726021064,
0.65703717564,
0.73829833964,
0.6873345226400001,
0.67012544464
]
},
{
"command": "pnpr@HEAD",
"mean": 0.7589205214400001,
"stddev": 0.11358827268773368,
"median": 0.72551446164,
"user": 0.41926191999999995,
"system": 1.3870215,
"min": 0.70749900264,
"max": 1.0807345856400001,
"times": [
0.73405244564,
0.72205214864,
0.7092765036400001,
0.71180884564,
0.70749900264,
0.73595071164,
0.72459484164,
0.72643408164,
0.73680204764,
1.0807345856400001
]
},
{
"command": "pnpr@main",
"mean": 0.76611917224,
"stddev": 0.07208537534814752,
"median": 0.74208604814,
"user": 0.42873372,
"system": 1.4101803,
"min": 0.71147252864,
"max": 0.95908083464,
"times": [
0.72865315364,
0.75414127064,
0.77672723264,
0.79170579064,
0.73495715364,
0.72028166164,
0.74359331164,
0.95908083464,
0.71147252864,
0.74057878464
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.36062641054,
"stddev": 0.029547893906004246,
"median": 4.3668851248400005,
"user": 3.8260220600000006,
"system": 3.4748171400000003,
"min": 4.31570284734,
"max": 4.39523939334,
"times": [
4.31570284734,
4.31934924634,
4.3914514683400006,
4.34604425934,
4.3795857083400005,
4.33914470834,
4.38597622434,
4.39523939334,
4.3776789893400005,
4.35609126034
]
},
{
"command": "pacquet@main",
"mean": 4.38808502054,
"stddev": 0.0635167635126956,
"median": 4.39259119184,
"user": 3.8879980599999997,
"system": 3.46806564,
"min": 4.25519098834,
"max": 4.46049619234,
"times": [
4.35064662134,
4.25519098834,
4.32877556434,
4.38815676734,
4.3970256163400006,
4.38172187134,
4.46049619234,
4.423532589340001,
4.45015775534,
4.4451462393400005
]
},
{
"command": "pnpr@HEAD",
"mean": 2.14858165554,
"stddev": 0.1031391718472752,
"median": 2.1103784183400003,
"user": 2.52504756,
"system": 2.9657509400000004,
"min": 2.0527256633400004,
"max": 2.3797698623400003,
"times": [
2.3797698623400003,
2.22794582534,
2.20950304634,
2.0867170343400003,
2.07136895134,
2.06237423534,
2.0527256633400004,
2.18078612434,
2.0805860103400002,
2.1340398023400002
]
},
{
"command": "pnpr@main",
"mean": 2.1755977974400005,
"stddev": 0.13751341488802019,
"median": 2.13404139834,
"user": 2.52765086,
"system": 2.94216774,
"min": 2.03988131434,
"max": 2.45980893734,
"times": [
2.09039866834,
2.09826956634,
2.45980893734,
2.1396199043400004,
2.03988131434,
2.1489856133400003,
2.3934831573400004,
2.10000665134,
2.12846289234,
2.15706126934
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.4264860960999999,
"stddev": 0.04556734837476126,
"median": 1.4132115345,
"user": 1.39274464,
"system": 1.7192585999999999,
"min": 1.396156631,
"max": 1.5535311059999999,
"times": [
1.429057636,
1.396156631,
1.415378777,
1.40914955,
1.417471789,
1.4110442920000001,
1.5535311059999999,
1.409421233,
1.402999348,
1.420650599
]
},
{
"command": "pacquet@main",
"mean": 1.4583357709,
"stddev": 0.06498743699125681,
"median": 1.4422796945,
"user": 1.39795404,
"system": 1.7622276,
"min": 1.4144859539999999,
"max": 1.639290512,
"times": [
1.423462159,
1.447105067,
1.639290512,
1.428422282,
1.434864884,
1.437454322,
1.4144859539999999,
1.4502964409999999,
1.451123618,
1.45685247
]
},
{
"command": "pnpr@HEAD",
"mean": 0.692585837,
"stddev": 0.026702919780642247,
"median": 0.6840781765,
"user": 0.35648124,
"system": 1.3220002,
"min": 0.669168968,
"max": 0.755759383,
"times": [
0.7190507770000001,
0.684632078,
0.6767295560000001,
0.669168968,
0.6710961670000001,
0.755759383,
0.691040603,
0.675948226,
0.698908337,
0.683524275
]
},
{
"command": "pnpr@main",
"mean": 0.7171637110000002,
"stddev": 0.06447515240087863,
"median": 0.6999282015,
"user": 0.36629533999999997,
"system": 1.3302215999999996,
"min": 0.679535546,
"max": 0.898308638,
"times": [
0.695319479,
0.707457733,
0.712499187,
0.6953929360000001,
0.679535546,
0.702054309,
0.700943406,
0.898308638,
0.698912997,
0.681212879
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.12941413486,
"stddev": 0.055894254961717384,
"median": 3.11575405556,
"user": 1.8472150199999997,
"system": 2.0115265399999998,
"min": 3.05197273406,
"max": 3.26209013906,
"times": [
3.15010250906,
3.1547249760600002,
3.14409637306,
3.11188740406,
3.09207557706,
3.11898651606,
3.09568352506,
3.26209013906,
3.11252159506,
3.05197273406
]
},
{
"command": "pacquet@main",
"mean": 3.0980936829599997,
"stddev": 0.027872962665241464,
"median": 3.09323251656,
"user": 1.8295474200000001,
"system": 1.99837554,
"min": 3.0552275300600003,
"max": 3.15032522906,
"times": [
3.09227391806,
3.0552275300600003,
3.09276809806,
3.06645925306,
3.10794851506,
3.09290150106,
3.15032522906,
3.09356353206,
3.13297013506,
3.09649911806
]
},
{
"command": "pnpr@HEAD",
"mean": 0.67833608046,
"stddev": 0.01090290014803154,
"median": 0.67920258506,
"user": 0.34485802,
"system": 1.3065845399999998,
"min": 0.65913398306,
"max": 0.69832943006,
"times": [
0.68285011106,
0.68755037106,
0.67911761606,
0.69832943006,
0.67928755406,
0.68075102206,
0.66597834006,
0.65913398306,
0.67802340706,
0.67233897006
]
},
{
"command": "pnpr@main",
"mean": 0.6768418173599999,
"stddev": 0.029425340622255176,
"median": 0.66699241206,
"user": 0.35024321999999997,
"system": 1.29692094,
"min": 0.65998377706,
"max": 0.75889801406,
"times": [
0.67204628506,
0.66241733206,
0.66781915406,
0.67834709206,
0.66616567006,
0.67528577606,
0.75889801406,
0.65998377706,
0.66398809206,
0.66346698106
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6661095080399999,
"stddev": 0.0061221062910061476,
"median": 0.6668753403400001,
"user": 0.6325304,
"system": 0.153965,
"min": 0.65181926734,
"max": 0.67502290334,
"times": [
0.66698040434,
0.66777678034,
0.66621006034,
0.67116238534,
0.66677027634,
0.66290302534,
0.66885532334,
0.65181926734,
0.66359465434,
0.67502290334
]
},
{
"command": "pacquet@main",
"mean": 0.66895160354,
"stddev": 0.008233631294613285,
"median": 0.67044503784,
"user": 0.6325826,
"system": 0.15716739999999998,
"min": 0.65596986834,
"max": 0.68130056934,
"times": [
0.67078581334,
0.67010426234,
0.65674497434,
0.66501541434,
0.65596986834,
0.66600443834,
0.67796558034,
0.68130056934,
0.67251935534,
0.67310575934
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10805222434000002,
"stddev": 0.0009755430541288474,
"median": 0.10796489834,
"user": 0.027842838461538462,
"system": 0.019451115384615383,
"min": 0.10637298034,
"max": 0.11173324834000001,
"times": [
0.10637298034,
0.10765642334,
0.11173324834000001,
0.10945076934,
0.10797284334000001,
0.10742222634000001,
0.10749304834000001,
0.10852916634000001,
0.10828196034000001,
0.10799752234000001,
0.10770643634,
0.10743030134,
0.10795299634000001,
0.10872803034,
0.10724557034000001,
0.10795695334000001,
0.10817166334,
0.10811074034000001,
0.10817200434,
0.10726502434,
0.10700277434000001,
0.10882609034,
0.10817608534,
0.10788005034,
0.10825885734,
0.10756406634
]
},
{
"command": "pnpr@main",
"mean": 0.10793444586000003,
"stddev": 0.0004993677618097993,
"median": 0.10784424334,
"user": 0.028712819999999993,
"system": 0.01872306,
"min": 0.10701145734,
"max": 0.10905916834000001,
"times": [
0.10905916834000001,
0.10701145734,
0.10823655334,
0.10803254234000001,
0.10763396034,
0.10834636834000001,
0.10789623834,
0.10716238134,
0.10833188134,
0.10868078234,
0.10741497934000001,
0.10784424334,
0.10773048034,
0.10763678534000001,
0.10753532634,
0.10904050234000001,
0.10795613034000001,
0.10769720734,
0.10774851334,
0.10767055734,
0.10836471134,
0.10774385434,
0.10785494834,
0.10791842934000001,
0.10781314434
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.990317135740002,
"stddev": 0.23382595057200595,
"median": 6.93910876474,
"user": 4.0979000999999995,
"system": 3.8273091999999993,
"min": 6.75174214774,
"max": 7.49418516274,
"times": [
6.87402993674,
7.09606376274,
7.49418516274,
6.99231068374,
7.23066668674,
6.75222377974,
6.81490406574,
6.88590684574,
7.01113828574,
6.75174214774
]
},
{
"command": "pacquet@main",
"mean": 6.972131405240001,
"stddev": 0.17629497828682295,
"median": 6.97004559024,
"user": 4.0947588,
"system": 3.8545339999999997,
"min": 6.78663771374,
"max": 7.39658175574,
"times": [
6.99919578774,
7.39658175574,
6.84531112874,
6.94935123674,
6.78663771374,
6.79178151274,
7.05407382474,
6.89233492274,
7.01530622574,
6.99073994374
]
},
{
"command": "pnpr@HEAD",
"mean": 5.04149538144,
"stddev": 0.10720305185519284,
"median": 4.9855636282399995,
"user": 2.8169528,
"system": 3.2742652,
"min": 4.93108502674,
"max": 5.21882543374,
"times": [
5.07435050974,
5.14162896774,
5.21882543374,
5.19181987774,
5.00666694574,
4.96386087874,
4.96446031074,
4.96121254274,
4.96104332074,
4.93108502674
]
},
{
"command": "pnpr@main",
"mean": 5.060361786540001,
"stddev": 0.11128430057453742,
"median": 5.05193569574,
"user": 2.8021585,
"system": 3.3020289,
"min": 4.86185937474,
"max": 5.25197597874,
"times": [
4.86185937474,
5.01238356174,
5.15397056974,
5.15674957874,
5.06508975974,
4.96329543474,
5.00051914374,
5.03878163174,
5.25197597874,
5.09899283174
]
}
]
} |
|
| Branch | pr/12842 |
| 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,148.58 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 678.34 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 692.59 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 108.05 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,191.23 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 5,041.50 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 758.92 ms |
|
Code review by qodo was updated up to the latest commit 49ec162 |
PR Code Suggestions ✨Warning
|
|||||||||
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pacquet/crates/cli/src/cli_args/exec/recursive.rs (1)
82-91: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSort/no-sort chunking is duplicated with
run/recursive.rs.The
if args.sort { sort_filtered_projects(...) } else { graph.keys()... }block here is byte-for-byte identical to the one inrun/recursive.rs(lines 98-107). Sincesort_filtered_projectsalready lives in the sharedpacquet/crates/cli/src/cli_args/recursive.rsmodule, consider moving this branch there too (e.g.fn chunk_projects(graph, full_graph, prod_all, prod_only_selected, sort: bool) -> Vec<Vec<PathBuf>>) so both recursive runners call one shared function instead of keeping two copies in sync.♻️ Suggested shared helper (in recursive.rs)
+pub fn chunk_filtered_projects<Pkg>( + selected: &ProjectGraph<Pkg>, + all: &ProjectGraph<Pkg>, + prod_all: Option<&ProjectGraph<Pkg>>, + prod_only_selected: &HashSet<PathBuf>, + sort: bool, +) -> Vec<Vec<PathBuf>> { + if sort { + sort_filtered_projects(selected, all, prod_all, prod_only_selected) + } else { + selected.keys().cloned().map(|root| vec![root]).collect() + } +}🤖 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/src/cli_args/exec/recursive.rs` around lines 82 - 91, The chunk-building logic in recursive execution is duplicated between recursive.rs and run/recursive.rs, so move the sort/no-sort branch into the shared recursive helper module and have both callers use it. Add a shared function such as chunk_projects that takes graph, full_graph, prod_all, prod_only_selected, and sort, and returns the Vec<Vec<PathBuf>> currently built in the local block. Update the recursive runner in recursive.rs to call that helper instead of inlining the if args.sort { sort_filtered_projects(...) } else { graph.keys()... } branch, keeping sort_filtered_projects as the shared implementation detail.Source: Path instructions
pacquet/crates/cli/src/cli_args/dispatch_script.rs (1)
83-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate option-copying logic between the two helpers.
with_recursive_run_optionsandwith_recursive_exec_optionscopy the exact same four fields (resume_from,report_summary,no_bail,sort) fromctx, differing only in the arg type. Consider a small generic helper/trait to avoid the two functions drifting out of sync when a fifth recursive option is added later.♻️ Suggested consolidation
-fn with_recursive_run_options(ctx: &RunCtx<'_>, mut args: RunArgs) -> RunArgs { - args.resume_from = ctx.recursive_resume_from.map(str::to_string); - args.report_summary = ctx.recursive_report_summary; - args.no_bail = ctx.recursive_no_bail; - args.sort = ctx.recursive_sort; - args -} - -fn with_recursive_exec_options(ctx: &RunCtx<'_>, mut args: ExecArgs) -> ExecArgs { - args.resume_from = ctx.recursive_resume_from.map(str::to_string); - args.report_summary = ctx.recursive_report_summary; - args.no_bail = ctx.recursive_no_bail; - args.sort = ctx.recursive_sort; - args -} +trait RecursiveOptions { + fn set_recursive_options(&mut self, ctx: &RunCtx<'_>); +} + +impl RecursiveOptions for RunArgs { + fn set_recursive_options(&mut self, ctx: &RunCtx<'_>) { + self.resume_from = ctx.recursive_resume_from.map(str::to_string); + self.report_summary = ctx.recursive_report_summary; + self.no_bail = ctx.recursive_no_bail; + self.sort = ctx.recursive_sort; + } +} + +impl RecursiveOptions for ExecArgs { + fn set_recursive_options(&mut self, ctx: &RunCtx<'_>) { + self.resume_from = ctx.recursive_resume_from.map(str::to_string); + self.report_summary = ctx.recursive_report_summary; + self.no_bail = ctx.recursive_no_bail; + self.sort = ctx.recursive_sort; + } +}🤖 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/src/cli_args/dispatch_script.rs` around lines 83 - 97, The two helpers with_recursive_run_options and with_recursive_exec_options contain duplicated recursive option-copying logic for the same ctx fields, so consolidate the shared assignments into a small generic helper or trait-based function and have both helpers delegate to it. Keep the existing behavior for resume_from, report_summary, no_bail, and sort, but centralize the copying so future recursive options are added in one place and the RunArgs/ExecArgs wrappers stay in sync.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/src/cli_args/dispatch_script.rs`:
- Around line 83-97: The two helpers with_recursive_run_options and
with_recursive_exec_options contain duplicated recursive option-copying logic
for the same ctx fields, so consolidate the shared assignments into a small
generic helper or trait-based function and have both helpers delegate to it.
Keep the existing behavior for resume_from, report_summary, no_bail, and sort,
but centralize the copying so future recursive options are added in one place
and the RunArgs/ExecArgs wrappers stay in sync.
In `@pacquet/crates/cli/src/cli_args/exec/recursive.rs`:
- Around line 82-91: The chunk-building logic in recursive execution is
duplicated between recursive.rs and run/recursive.rs, so move the sort/no-sort
branch into the shared recursive helper module and have both callers use it. Add
a shared function such as chunk_projects that takes graph, full_graph, prod_all,
prod_only_selected, and sort, and returns the Vec<Vec<PathBuf>> currently built
in the local block. Update the recursive runner in recursive.rs to call that
helper instead of inlining the if args.sort { sort_filtered_projects(...) } else
{ graph.keys()... } branch, keeping sort_filtered_projects as the shared
implementation detail.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 372a4808-c979-43e7-b8ad-6dcc24f3886d
📒 Files selected for processing (14)
pacquet/crates/cli/src/cli_args/cli_command.rspacquet/crates/cli/src/cli_args/dispatch.rspacquet/crates/cli/src/cli_args/dispatch_script.rspacquet/crates/cli/src/cli_args/exec.rspacquet/crates/cli/src/cli_args/exec/recursive.rspacquet/crates/cli/src/cli_args/install.rspacquet/crates/cli/src/cli_args/install/tests.rspacquet/crates/cli/src/cli_args/pipelines.rspacquet/crates/cli/src/cli_args/restart.rspacquet/crates/cli/src/cli_args/run.rspacquet/crates/cli/src/cli_args/run/recursive.rspacquet/crates/cli/src/cli_args/stop.rspacquet/crates/cli/src/cli_args/tests.rspacquet/crates/cli/tests/run_recursive.rs
💤 Files with no reviewable changes (3)
- pacquet/crates/cli/src/cli_args/install/tests.rs
- pacquet/crates/cli/src/cli_args/pipelines.rs
- pacquet/crates/cli/src/cli_args/install.rs
✅ Files skipped from review due to trivial changes (1)
- pacquet/crates/cli/src/cli_args/tests.rs
|
Code review by qodo was updated up to the latest commit 0f2ef1d |
|
Code review by qodo was updated up to the latest commit ec1710f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@pacquet/crates/cli/src/cli_args/cli_command.rs`:
- Around line 184-193: Update validate_script_scoped_global_option in CliCommand
so it treats Test, Start, Stop(_), and Restart(_) the same as Run, Exec, and
External when allowing script-scoped global options. Also extend
script_scoped_global_flags_parse_before_script_commands to include those command
variants, so flags like --resume-from, --report-summary, and --no-bail are
accepted for these valid script commands.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b7fc6f8b-309c-4553-958e-0b6ef3cae90c
📒 Files selected for processing (3)
pacquet/crates/cli/src/cli_args/cli_command.rspacquet/crates/cli/src/cli_args/tests.rspacquet/crates/cli/src/lib.rs
|
Code review by qodo was updated up to the latest commit 4b7db34 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
|
Code review by qodo was updated up to the latest commit 1cad2bd |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Summary
Pacquet now reads
package.yamlas a project manifest in the shared workspace manifest reader. Script commands (run, top-level shorthand fallback,test,start, andstop) use that reader, sopnpm --dir=pnpm11/__fixtures__ prepareFixturesworks when the target project only haspackage.yaml.Workspace project discovery also matches
package.yamlprojects while preservingpackage.jsonprecedence when both files exist.Pacquet also parses recursive script options before a fallback script command, matching pnpm's CI shape for
pn --no-sort --workspace-concurrency=1 -r --report-summary .test.--no-sortnow preserves workspace order for recursiverunandexec, lifecycle aliases that TypeScript pnpm treats like run scripts (test,start, andstop) accept the same recursive script flags, and unrelated commands still reject them.publish --report-summaryis preserved when it is captured by the shared parser, so filtered publish jobs can write an empty summary instead of failing during argument validation.Related to #12811.
Squash Commit Body
Checklist
pacquet/port, or the description notes what still needs porting. TypeScript pnpm already supportspackage.yamlproject manifests and the recursive script option shape; this PR fills the pacquet gaps.Written by an agent (Codex, GPT-5).
Summary by CodeRabbit
New Features
package.jsonandpackage.yaml.run/execnow support--sort/--no-sortordering controls.--workspace-concurrencyfor supported recursive commands.Bug Fixes
Chores