Skip to content

refactor(ado-proxy): split catalog operations() by capability group - #2025

Open
github-actions[bot] wants to merge 2 commits into
mainfrom
refactor/reduce-complexity-catalog-operations-a8f8335e1d449825
Open

refactor(ado-proxy): split catalog operations() by capability group#2025
github-actions[bot] wants to merge 2 commits into
mainfrom
refactor/reduce-complexity-catalog-operations-a8f8335e1d449825

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What was complex

operations() in src/ado_proxy/catalog.rs built the entire Vec<Operation> for the ADO-proxy read-operation catalog as a single 391-line function (clippy::too_many_lines, threshold 100), mixing five unrelated capability groups (discovery, core, repos, pipelines, boards) inline.

What changed

Split the single function into one helper per capability group, each returning the Vec<Operation> for its area:

  • discovery_operations()
  • core_operations()
  • repos_operations()
  • pipelines_operations()
  • boards_operations()

operations() now just concatenates the five vectors in the original order, so the returned catalog content and ordering are byte-for-byte identical to before.

No public API changes — operations() keeps its signature and behavior.

Before / after

  • Before: operations() — 391/100 (too_many_lines)
  • After: largest helper (repos_operations()) — 148/100; pipelines_operations() — 105/100; others below threshold

Verification

  • cargo build — clean
  • cargo test --bin ado-aw — 3229 passed, 0 failed
  • cargo clippy --all-targets --all-features — clean (one pre-existing, unrelated warning in create_work_item.rs)

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 · 81.5 AIC · ⌖ 12.4 AIC · ⊞ 11.4K ·

Extracts discovery_operations, core_operations, repos_operations,
pipelines_operations, and boards_operations from the single
operations() function in src/ado_proxy/catalog.rs, which had grown to
391 lines (clippy::too_many_lines). Each helper builds the Operation
list for its capability area; operations() now just concatenates them.

No behavior change: the returned Vec<Operation> is identical in
content and order. Full test suite (3229 tests) and
cargo clippy --all-targets --all-features pass clean.

Before: operations() 391/100 (too_many_lines)
After: largest helper (repos_operations) 148/100

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.

@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.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

PR Security Reviewer completed the security review.

🔒 Security review by PR Security Reviewer

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Rust Code Quality Reviewer completed the Rust code quality review.

🦀 Rust code quality review by Rust Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed the test quality analysis.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Compiler Contract Reviewer was cancelled during the compiler contract review.

🏗️ Compiler contract review by Compiler Contract Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review: this diff is a pure refactor of src/ado_proxy/catalog.rs::operations() into five private helper functions (discovery_operations, core_operations, repos_operations, pipelines_operations, boards_operations), concatenated in the original order. No new inputs, no changes to validation, sanitization, token projection, or the AWF network allowlist — purely mechanical decomposition to satisfy clippy::too_many_lines. Security-neutral.

🔒 Security review by PR Security Reviewer · auto · 14.7 AIC · ⌖ 2.86 AIC · ⊞ 11.7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage assessment

No test changes are needed here, and none were made — this is a pure structural extraction. operations() keeps its exact signature, and its output is asserted to be unchanged (same concatenated order) by the existing operation_ids_are_unique_and_routes_are_normalized and discovery_and_response_scoped_operations_are_explicit tests in catalog.rs, both of which call operations() directly and would fail if the split introduced any ordering/content drift across the five new helper functions. The five new private helpers (discovery_operations, core_operations, repos_operations, pipelines_operations, boards_operations) are implementation details behind that already-tested public surface, so adding per-helper tests would just restate the same fixture data without protecting new behavior.

No weakened or deleted assertions, no untested new branches, no error paths introduced. Nothing to flag from a test-quality perspective.

🧪 Test quality analysis by Test Quality Sentinel · auto · 20.2 AIC · ⌖ 2.17 AIC · ⊞ 11.2K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust review: no issues

Clean mechanical extraction of operations() into five capability-grouped private helpers (discovery_operations, core_operations, repos_operations, pipelines_operations, boards_operations), concatenated in original order. Each new function is appropriately doc-commented and kept private (no visibility widening). No logic, error-handling, or ordering changes. rust-critic sub-agent returned no findings.

🦀 Rust code quality review by Rust Code Quality Reviewer · auto · 24.9 AIC · ⌖ 2.87 AIC · ⊞ 11.5K
Comment /review to run again

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a791be18-ce7e-40f4-80a1-f03d6eceba6c
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