Skip to content

feat(compile): add --force flag to bypass GitHub-remote guard#577

Merged
jamesadevine merged 1 commit into
mainfrom
feat/compile-force-flag
May 16, 2026
Merged

feat(compile): add --force flag to bypass GitHub-remote guard#577
jamesadevine merged 1 commit into
mainfrom
feat/compile-force-flag

Conversation

@jamesadevine
Copy link
Copy Markdown
Collaborator

Summary

Adds a --force flag to ado-aw compile, mirroring the existing ado-aw init --force escape hatch. Maintainers can now compile pipelines inside githubnext/ado-aw itself (or any GitHub-hosted fork) without needing to set CARGO_BIN_EXE_ado-aw to bypass the GitHub-remote guard.

Previously the guard refused every ado-aw command in a GitHub repository except init (which already had --force). That made it awkward to dogfood the compiler against the project's own examples and smoke pipelines from a regular shell.

Changes

  • src/main.rs
    • Add force: bool to the Compile clap variant (#[arg(long)]).
    • Gate the ensure_non_github_remote_for_ado_aw("compile", …) call behind if !force, identical to the existing init dispatch pattern.
    • Extend the guard's bail message to mention --force as the supported bypass.
  • docs/cli.md — document the new --force flag under the compile entry.

Verification

  • cargo build — clean.
  • cargo test --bin ado-aw — 1466 passed, 0 failed (existing is_github_remote tests still pass).
  • cargo run -- compile -h--force now appears in the help output.

Usage

# Inside githubnext/ado-aw itself
cargo run -- compile --force path/to/agent.md
cargo run -- compile --force            # auto-discover all pipelines

Mirrors the existing 'ado-aw init --force' escape hatch on the compile subcommand so maintainers can compile pipelines inside 'githubnext/ado-aw' (or any GitHub-hosted fork) without setting CARGO_BIN_EXE_ado-aw.

Also clarifies the guard's error message to mention --force as the bypass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine merged commit 562ff7f into main May 16, 2026
12 of 16 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Rust PR Review

Summary: Looks good — clean, minimal change that exactly mirrors the existing init --force escape hatch.

Findings

✅ What Looks Good

  • Exact pattern match with init --force — the Compile variant gets force: bool with #[arg(long)], the match arm extracts it, and the guard is wrapped in if !force { ... }. This is character-for-character consistent with lines 114 and 572 for Init.
  • Bail message update — the new hint in ensure_non_github_remote_for_ado_aw applies to both compile and init (since the function is shared), which is correct: both commands now support --force and the message accurately reflects that.
  • CARGO_BIN_EXE_ado-aw env-var bypass is preserved — the test-harness escape hatch is untouched, so CI integration tests are unaffected.
  • No new unwrap/expect, no new fallible paths, no user input embedded into generated YAML — this change touches only the CLI dispatch layer.
  • Docs updated in the right place--force is listed under compile in docs/cli.md immediately after --output, mirroring where it appears in init's entry.

No issues found.

Generated by Rust PR Reviewer for issue #577 · ● 430.1K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant