From d2906c1a4c8d312ef843620e845bcb398c8d7c59 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 09:02:06 +0000 Subject: [PATCH] refactor: split operations() catalog builder by capability group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split the 391-line operations() function in src/ado_proxy/catalog.rs into five smaller helpers grouped by capability: discovery_operations(), core_operations(), repos_operations(), pipelines_operations(), and boards_operations(). operations() now just concatenates their results. No behavior change — same Vec is produced. Full suite (3229 tests) + clippy pass. Cognitive-complexity (too_many_lines) for the group reduced from 391/100 to a max of 148/100 across the split functions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ado_proxy/catalog.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/ado_proxy/catalog.rs b/src/ado_proxy/catalog.rs index 576823db..9d75abe5 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.*` operations: service-topology lookups every client performs +/// before its first real call (host/area OPTIONS probes, resource-area +/// discovery, connection data). +fn discovery_operations() -> Vec { vec![ Operation { id: "discovery.host-options", @@ -325,6 +337,12 @@ pub fn operations() -> Vec { Json, &["connectOptions", "lastChangeId", "lastChangeId64"] ), + ] +} + +/// `core.*` operations: project lookup and validation. +fn core_operations() -> Vec { + vec![ get!( "core.project-get", Core, @@ -352,6 +370,13 @@ pub fn operations() -> Vec { "getDefaultTeamImageUrl", ] ), + ] +} + +/// `repos.*` operations: repository metadata, refs, items, commits, pull +/// requests. +fn repos_operations() -> Vec { + vec![ get!( "repos.repository-get", Repos, @@ -498,6 +523,13 @@ pub fn operations() -> Vec { Json, NO_QUERY ), + ] +} + +/// `pipelines.*` operations: build/release definitions, builds, timelines, +/// and modern YAML pipeline runs. +fn pipelines_operations() -> Vec { + vec![ get!( "pipelines.definitions-list", Pipelines, @@ -601,6 +633,12 @@ pub fn operations() -> Vec { Json, NO_QUERY ), + ] +} + +/// `boards.*` operations: work item lookup, comments, updates, and revisions. +fn boards_operations() -> Vec { + vec![ get!( "boards.work-item-get", Boards,