refactor(ado-proxy): split catalog operations() by capability group - #2025
refactor(ado-proxy): split catalog operations() by capability group#2025github-actions[bot] wants to merge 2 commits into
Conversation
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: 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: 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. |
|
✅ PR Security Reviewer completed the security review.
|
|
✅ Rust Code Quality Reviewer completed the Rust code quality review.
|
|
✅ Test Quality Sentinel completed the test quality analysis.
|
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
What was complex
operations()insrc/ado_proxy/catalog.rsbuilt the entireVec<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
operations()— 391/100 (too_many_lines)repos_operations()) — 148/100;pipelines_operations()— 105/100; others below thresholdVerification
cargo build— cleancargo test --bin ado-aw— 3229 passed, 0 failedcargo clippy --all-targets --all-features— clean (one pre-existing, unrelated warning increate_work_item.rs)Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.