Skip to content

refactor: split operations() catalog builder by capability group - #2066

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-catalog-operations-2-222cbdb3e5463be1
Closed

refactor: split operations() catalog builder by capability group#2066
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-catalog-operations-2-222cbdb3e5463be1

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What was complex

operations() in src/ado_proxy/catalog.rs was a single 391-line function (Clippy too_many_lines, 391/100) that built the entire flat Vec<Operation> catalog for every capability (discovery, core, repos, pipelines, boards) inline in one vec![...] literal.

What changed

Split the function into five smaller helpers, one per capability group, each returning its own Vec<Operation>:

  • discovery_operations() — service-topology OPTIONS probes, resource-area discovery, connection data
  • core_operations() — project lookup/validation
  • repos_operations() — repository metadata, refs, items, commits, pull requests
  • pipelines_operations() — build/release definitions, builds, timelines, pipeline runs
  • boards_operations() — work item lookup, comments, updates, revisions

operations() now just concatenates the five helper outputs in the same order as before, so the returned Vec<Operation> is byte-for-byte identical to the pre-refactor version.

Behavior

No public API or observable behavior change — same operation list, same order, same Operation values.

Verification

  • cargo test --bin ado-aw — all 3229 tests pass (0 failed, 1 pre-existing ignored)
  • cargo clippy --all-targets --all-features — clean (one pre-existing, unrelated warning in create_work_item.rs)
  • Cognitive-complexity re-check (-W clippy::too_many_lines) on src/ado_proxy/catalog.rs: max reported complexity dropped from 391/100 to 148/100 across the split functions.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Cyclomatic Complexity Reducer · auto · 107.3 AIC · ⌖ 9.38 AIC · ⊞ 11.4K ·

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<Operation> 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>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jamesadevine

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #2025. The executable catalog split is the same, while #2025 has the more accurate description.

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