refactor: split operations() catalog builder by capability group - #2066
Closed
github-actions[bot] wants to merge 1 commit into
Closed
refactor: split operations() catalog builder by capability group#2066github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
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: 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. |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was complex
operations()insrc/ado_proxy/catalog.rswas a single 391-line function (Clippytoo_many_lines, 391/100) that built the entire flatVec<Operation>catalog for every capability (discovery,core,repos,pipelines,boards) inline in onevec![...]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 datacore_operations()— project lookup/validationrepos_operations()— repository metadata, refs, items, commits, pull requestspipelines_operations()— build/release definitions, builds, timelines, pipeline runsboards_operations()— work item lookup, comments, updates, revisionsoperations()now just concatenates the five helper outputs in the same order as before, so the returnedVec<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
Operationvalues.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 increate_work_item.rs)-W clippy::too_many_lines) onsrc/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.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.