From 172acd74e24b7eba8629c08eb2a0c089498a57b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Sep 2026 08:58:12 +0000 Subject: [PATCH] refactor(ado_proxy): split catalog operations() into capability-group helpers Splits the 391-line operations() function in src/ado_proxy/catalog.rs into five smaller helper functions grouped by Capability: discovery_operations, core_operations, repos_operations, pipelines_operations, and boards_operations. operations() now simply concatenates their results. No behavior change: the returned Vec is identical in content and order. All 3322 tests pass; clippy is clean. Before: too_many_lines fired at 391/100 for operations(). After: largest remaining helper (repos_operations) is 148/100. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ado_proxy/catalog.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/ado_proxy/catalog.rs b/src/ado_proxy/catalog.rs index 576823db..ec59fab9 100644 --- a/src/ado_proxy/catalog.rs +++ b/src/ado_proxy/catalog.rs @@ -249,6 +249,18 @@ pub fn catalog() -> Catalog { } pub fn operations() -> Vec { + let mut ops = discovery_operations(); + ops.extend(core_operations()); + ops.extend(repos_operations()); + ops.extend(pipelines_operations()); + ops.extend(boards_operations()); + ops +} + +/// Discovery-capability operations: unauthenticated host/area/resource-area +/// probes plus the connection-data handshake that every ADO client issues +/// before its first data call. +fn discovery_operations() -> Vec { vec![ Operation { id: "discovery.host-options", @@ -325,6 +337,12 @@ pub fn operations() -> Vec { Json, &["connectOptions", "lastChangeId", "lastChangeId64"] ), + ] +} + +/// Core-capability operations: project lookup and validation probes. +fn core_operations() -> Vec { + vec![ get!( "core.project-get", Core, @@ -352,6 +370,13 @@ pub fn operations() -> Vec { "getDefaultTeamImageUrl", ] ), + ] +} + +/// Repos-capability operations: repository metadata, refs, items, commits, +/// and pull-request read paths. +fn repos_operations() -> Vec { + vec![ get!( "repos.repository-get", Repos, @@ -498,6 +523,13 @@ pub fn operations() -> Vec { Json, NO_QUERY ), + ] +} + +/// Pipelines-capability operations: build/release definitions, builds, +/// timelines, and pipeline runs. +fn pipelines_operations() -> Vec { + vec![ get!( "pipelines.definitions-list", Pipelines, @@ -601,6 +633,13 @@ pub fn operations() -> Vec { Json, NO_QUERY ), + ] +} + +/// Boards-capability operations: work item read, comments, updates, and +/// revision history. +fn boards_operations() -> Vec { + vec![ get!( "boards.work-item-get", Boards,