fix(add): accept dangerously-allow-all-builds - #1016
Conversation
📝 WalkthroughWalkthroughThe ChangesDangerously allow all builds
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AddCLI
participant AddRun
participant GlobalAdd
participant InstallRun
AddCLI->>AddRun: parse dangerously_allow_all_builds
AddRun->>GlobalAdd: forward flag for global installs
AddRun->>InstallRun: apply install option and CLI flag
GlobalAdd->>InstallRun: invoke inner add with forwarded flag
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is a targeted flag addition that threads through existing infrastructure with no new install logic. The three code paths (local, filtered, global) each correctly call the shared helper before the install pipeline. The deny_build clap conflict is enforced at parse time. Documentation is updated consistently across KDL, Markdown, and the generated JSON. Tests cover the parse regression and the global E2E path that triggered the original bug report. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(add): reject conflicting build polic..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/aube/src/commands/add/global.rs (1)
21-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsider bundling the growing bool/Vec parameter list into a struct.
run_global/run_global_innernow carry several adjacent same-typed parameters (allow_low_downloads: bool,dangerously_allow_all_builds: bool, plusallow_build/deny_build: Vec<String>). The compiler can't catch an accidental positional swap between the twoboolparams since they're structurally identical — this PR itself had to touch three call sites in lockstep to add the new flag correctly. A smallBuildPolicy/AddFlagsstruct passed by value would make future additions safer against silent argument-order bugs.This is optional since the team already suppresses
clippy::too_many_argumentshere, indicating an accepted tradeoff — not blocking.Also applies to: 118-129
🤖 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 `@crates/aube/src/commands/add/global.rs` around lines 21 - 31, Consider replacing the adjacent build-related parameters in run_global and run_global_inner with a dedicated value object such as BuildPolicy or AddFlags containing allow_build, deny_build, allow_low_downloads, and dangerously_allow_all_builds. Update both function signatures and all call sites to pass the struct, preserving existing behavior while preventing positional swaps and simplifying future flag additions.
🤖 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 `@crates/aube/src/commands/add/global.rs`:
- Around line 21-31: Consider replacing the adjacent build-related parameters in
run_global and run_global_inner with a dedicated value object such as
BuildPolicy or AddFlags containing allow_build, deny_build, allow_low_downloads,
and dangerously_allow_all_builds. Update both function signatures and all call
sites to pass the struct, preserving existing behavior while preventing
positional swaps and simplifying future flag additions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 3565678a-f069-4592-b867-59c2e24b3d29
📒 Files selected for processing (8)
aube.usage.kdlcrates/aube/src/commands/add/filtered.rscrates/aube/src/commands/add/global.rscrates/aube/src/commands/add/mod.rscrates/aube/src/lib.rsdocs/cli/add.mddocs/cli/commands.jsontest/global_install.bats
Summary
--dangerously-allow-all-buildsonaube add--deny-build=<pkg>Root cause
The failure was reported in this mise discussion comment: mise invokes
aube add --global <package> --dangerously-allow-all-builds, but aube declared the broad flag only onInstallArgs. Clap therefore rejected it beforeaddcould enter the install pipeline.aube addalready chains into that pipeline, and its selective--allow-build=<pkg>option is forwarded through the synthetic global install. The broad option was simply absent fromAddArgsand from that forwarding path. This seems unintentional given aube's pnpm CLI parity goal and pnpm's support for the same command-line setting onadd. If keeping this escape hatch install-only is intentional, please feel free to close this PR.The new option is invocation-scoped; it does not persist
dangerouslyAllowAllBuilds=truein project configuration.Validation
cargo test -p aube— 644 unit tests, 7 Rust e2e testsmise run test:bats test/global_install.bats— 24 testscargo clippy --all-targets -- -D warningscargo fmt --checkmise run rendergit diff --checkSummary by CodeRabbit
New Features
aube add --dangerously-allow-all-buildsto permit all dependency lifecycle scripts for a single invocation, bypassing the build allowlist (including for-g/--globalinstalls).Bug Fixes
Documentation
--deny-buildhelp to note it conflicts with--dangerously-allow-all-builds.Tests