feat(cli): make init always overwrite; --force bypasses GitHub remote guard#465
Conversation
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/e8a46b21-15ab-4b8c-abe5-215eff7bd7fe Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
@copilot Sorry, this is quite an invasive change. Can you make it so cargo r -- init --force works. WE should not actually modify the production codepath |
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/894f7a19-183c-4f52-abe7-3fff415b43ed Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Reverted the production-path change. |
init --force to bypass GitHub remote guard
|
@copilot that is a great change. The default behaviour should be to always overwrite ado-aw agent file when init is used. --force should only required in the exception case (e.g. to override github remote detection) |
…uard Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/0ad2fb85-cc7d-49fe-aae4-e43a542f5e08 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Done. |
init --force to bypass GitHub remote guardinit always overwrite; --force bypasses GitHub remote guard
Summary
ado-aw initbails when the git origin is on GitHub, redirecting users to gh-aw. The only existing exception is the integration-test env var, so maintainers running the released binary inside a GitHub-hosted repo (e.g.githubnext/ado-awitself, to recompile in-tree examples) hit the bail.This PR makes two related changes to
ado-aw init:initnow unconditionally (re)writes.github/agents/ado-aw.agent.mdso it stays in sync with the installed compiler version. The previous "already exists, use --force to overwrite" bail is removed.--forcerepurposed for the GitHub-remote exception: the--forceflag now only bypasses the GitHub-remote guard, allowingcargo r -- init --forceto run insidegithubnext/ado-aw(or other GitHub-hosted forks) without altering the defaultinitcodepath or thecompilecodepath.Help text for
--forceanddocs/cli.mdare updated to reflect the new semantics.Test plan
cargo build --bin ado-awsucceeds.cargo test --test init_tests— 3/3 passing, including:test_init_creates_agent_file(unchanged)test_init_overwrites_by_default(new — verifies defaultinitoverwrites a tampered file without--force)test_init_force_overwrites(verifies--forcealso overwrites)cargo r -- init --forceinside a GitHub-origin repo proceeds;cargo r -- initin the same repo still bails with the existing gh-aw message.