New branch discovery strategy: only explicitly listed#762
Open
hcorg wants to merge 2 commits intojenkinsci:masterfrom
Open
New branch discovery strategy: only explicitly listed#762hcorg wants to merge 2 commits intojenkinsci:masterfrom
hcorg wants to merge 2 commits intojenkinsci:masterfrom
Conversation
d303fbf to
0ca0e05
Compare
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.
Use case: I want to build only "main" branch and MRs. Existing "Only Branches that are filed as MRs" strategy has built-in bug - it does build branch when there's only one MR. It might be required by it being "legacy" (I've filled issue #761). This MR adds new strategy that filters out all branches except for the ones matching the regex pattern.
As part of the MR I've also extracted duplicated pattern checking code to the base class.
I think that this strategy could replace "Only Branches that are filed as MRs", because it looks like the strategy that one was supposed to be (they behave the same when there are more than one MR, or to be precise - MRs with various source branches). But maybe the "legacy behaviour" is important. Let me know - I can change the PR to replace old strategy.
Testing done
My local instance of the Jenkins runs with the option enabled and it works as expected:
Submitter checklist