refactor: reduce complexity of validate_pr_filters/validate_pipeline_filters in filter_ir.rs - #1708
Merged
jamesadevine merged 1 commit intoJul 29, 2026
Conversation
|
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
marked this pull request as ready for review
July 29, 2026 14:09
…filters in filter_ir.rs Extract three private helpers to eliminate duplicated inline blocks: - validate_time_window: shared HH:MM + zero-width check used by both validate_pr_filters and validate_pipeline_filters (was copy-pasted verbatim) - check_include_exclude_overlap: single helper for the include/exclude conflict pattern repeated for author, build-reason (PR) and build-reason (pipeline) - validate_labels_filter: isolates the three labels sub-checks (any-of ∩ none-of, all-of ∩ none-of, empty-filter warning) validate_pr_filters shrinks from 112 lines to ~30; validate_pipeline_filters from 46 to ~12. Observable behaviour is identical — all tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
force-pushed
the
refactor/reduce-complexity-validate-filters-1e43d1b0a62a17bd
branch
from
July 29, 2026 14:09
b18afe3 to
a1ea6a2
Compare
|
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
deleted the
refactor/reduce-complexity-validate-filters-1e43d1b0a62a17bd
branch
July 29, 2026 14:14
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
validate_pr_filters(112 lines) andvalidate_pipeline_filters(46 lines) insrc/compile/filter_ir.rsboth contained:find_overlap+if !overlap.is_empty() { diags.push(...) }idiom appeared inline 3 times invalidate_pr_filters(forauthor,build-reason, and twice in labels).validate_pr_filters.What changed
Extracted three private helpers, keeping public API signatures unchanged:
validate_time_windowcheck_include_exclude_overlapvalidate_labels_filterBefore / After
validate_pr_filtersvalidate_pipeline_filtersVerification
cargo build— cleancargo test— all 2580+ tests pass, 0 failuresWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.