refactor(ado_proxy): reduce complexity of operations() in catalog.rs - #2102
Draft
github-actions[bot] wants to merge 1 commit into
Draft
refactor(ado_proxy): reduce complexity of operations() in catalog.rs#2102github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
… helpers Splits the 391-line operations() function in src/ado_proxy/catalog.rs into five smaller helper functions grouped by Capability: discovery_operations, core_operations, repos_operations, pipelines_operations, and boards_operations. operations() now simply concatenates their results. No behavior change: the returned Vec<Operation> is identical in content and order. All 3322 tests pass; clippy is clean. Before: too_many_lines fired at 391/100 for operations(). After: largest remaining helper (repos_operations) is 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. |
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 (flagged byclippy::too_many_linesat 391/100) building one largevec![...]literal containing every ADO proxy read-operation entry across all capability groups (Discovery, Core, Repos, Pipelines, Boards).What changed
Split
operations()into five smaller helper functions, one perCapabilitygroup:discovery_operations()core_operations()repos_operations()pipelines_operations()boards_operations()operations()itself now just concatenates the five vectors in the original order:No
Operationentries were added, removed, or reordered — this is a pure structural split with a short doc comment on each new helper.Before / after
operations()— 391/100 lines (too_many_lines)repos_operations()at 148/100;operations()itself is well below thresholdVerification
cargo build— cleancargo test --bin ado-aw— 3322 passed, 0 failed, 1 ignoredcargo clippy --all-targets --all-features— cleantoo_many_lineslint scoped tocatalog.rs— no function above 148/100 remainsWarning
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.