refactor(cli): extract shared ADO REST helpers into src/ado/mod.rs#580
Conversation
Lifts the shared Azure DevOps REST helpers out of src/configure.rs into a new src/ado/mod.rs so the forthcoming pipeline lifecycle commands (enable, disable, remove, list, run, status, secrets) can draw from one well instead of pub use-ing each other's internals. No behaviour change: �do-aw configure still walks the same code paths via a thin orchestration shim. What moves to src/ado/mod.rs (now all pub): - AdoContext, parse_ado_remote, get_git_remote_url, normalize_org_url, normalize_ado_yaml_path - AdoAuth + apply, resolve_auth, try_azure_cli_token, resolve_ado_context - DefinitionListResponse / DefinitionSummary / ProcessInfo - MatchMethod, MatchedDefinition, FuzzyMatchResult, fuzzy_match_by_name - list_definitions, match_definitions, get_definition_name, update_pipeline_variable, resolve_definitions - All shared unit tests (parse_ado_remote, normalize_org_url, fuzzy match, YAML path) New stub signatures (unimplemented!()) added so PRs 2-8 can depend on stable surfaces from day one: - get_repository_id, get_definition_full, patch_queue_status, delete_definition, create_definition, queue_build, get_build, get_latest_build src/configure.rs shrinks to ~155 lines of GITHUB_TOKEN orchestration that calls into crate::ado::*. src/main.rs and src/compile/extensions/mod.rs switch from crate::configure:: to crate::ado:: for the relocated symbols. Foundation for the Phase 1 CLI overhaul tracked in the session plan. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Clean extraction — looks good overall, with one actionable concern on the stubs and one minor edge case to note. Findings
|
|
@copilot implement suggestions |
…nput behavior Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/df14608b-778c-4bf3-863c-acebcb62281f Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Implemented in d41d20f. I replaced all lifecycle stub Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Why
Foundation for the Phase 1 CLI overhaul (planned in the session). Lifts the shared Azure DevOps REST helpers out of src/configure.rs into a new src/ado/mod.rs so the forthcoming pipeline lifecycle commands (�nable, disable,
emove, list,
un, status, secrets) can draw from one well instead of
pub use-ing each other's internals.No behaviour change:
ado-aw configurestill walks the same code paths via a thin orchestration shim.What moves to
src/ado/mod.rs(now allpub)AdoContext,parse_ado_remote,get_git_remote_url,normalize_org_url,normalize_ado_yaml_pathAdoAuth+apply,resolve_auth,try_azure_cli_token,resolve_ado_contextDefinitionListResponse/DefinitionSummary/ProcessInfoMatchMethod,MatchedDefinition,FuzzyMatchResult,fuzzy_match_by_namelist_definitions,match_definitions,get_definition_name,update_pipeline_variable,resolve_definitionsparse_ado_remote,normalize_org_url, fuzzy match, YAML path)New stub signatures
Added so PRs 2-8 can depend on stable surfaces from day one — bodies fill in as each command lands:
get_repository_id(enable)get_definition_full(enable / disable)patch_queue_status(enable / disable)delete_definition(remove)create_definition(enable)queue_build(run)get_build(run)get_latest_build(list / status)What stays in
src/configure.rsShrinks to ~155 lines of
GITHUB_TOKEN-specific orchestration that calls intocrate::ado::*:resolve_token(interactiveGITHUB_TOKENprompt)apply_token_updates(per-definition fail-soft loop)pub async fn run(the CLI entry point)Call-site updates
src/main.rsdeclarespub mod ado;and switchesconfigure::get_git_remote_url→ado::get_git_remote_urlin the GitHub-remote guard.src/compile/extensions/mod.rsswitchescrate::configure::AdoContext/get_git_remote_url/parse_ado_remote→crate::ado::.git grep 'crate::configure::'outside the entry point returns zero.Verification
cargo build— cleancargo test— 1471 unit + 108 integration tests passing (no regression)cargo clippy --all-targets --all-features— only pre-existing warnings (the twouseless_veclints in the moved test fixtures existed onmainbefore this PR;clippy-fixeralready handles them)Next
After this lands, PRs 2-8 are independent and parallelize cleanly:
feat(cli): add ado-aw enablefeat(cli): add ado-aw disablefeat(cli): add ado-aw removefeat(cli): add ado-aw listfeat(cli): add ado-aw runfeat(cli): add ado-aw statusfeat(cli): rename configure -> secrets with subcommands