Class BranchDiscoveryTrait.BranchDiscoverySCMHeadFilter

java.lang.Object
jenkins.scm.api.trait.SCMHeadFilter
io.jenkins.plugins.gitlabbranchsource.BranchDiscoveryTrait.BranchDiscoverySCMHeadFilter
Direct Known Subclasses:
BranchDiscoveryTrait.ExcludeOriginMRBranchesSCMHeadFilter, BranchDiscoveryTrait.OnlyExplicitlyListedBranchesSCMHeadFilter, BranchDiscoveryTrait.OnlyOriginMRBranchesSCMHeadFilter
Enclosing class:
BranchDiscoveryTrait

public abstract static class BranchDiscoveryTrait.BranchDiscoverySCMHeadFilter extends jenkins.scm.api.trait.SCMHeadFilter
Base class for branch filters that support an always-included regex. Handles the common filter then delegates to isExcludedBranch(jenkins.scm.api.trait.SCMSourceRequest, io.jenkins.plugins.gitlabbranchsource.BranchSCMHead) for strategy-specific logic.
  • Constructor Details

    • BranchDiscoverySCMHeadFilter

      protected BranchDiscoverySCMHeadFilter(Pattern branchesAlwaysIncludedRegexPattern)
      Constructor
      Parameters:
      branchesAlwaysIncludedRegexPattern - the branchesAlwaysIncludedRegexPattern.
  • Method Details

    • isExcluded

      public final boolean isExcluded(@NonNull jenkins.scm.api.trait.SCMSourceRequest request, @NonNull jenkins.scm.api.SCMHead head)
      Specified by:
      isExcluded in class jenkins.scm.api.trait.SCMHeadFilter
    • isExcludedBranch

      protected abstract boolean isExcludedBranch(@NonNull jenkins.scm.api.trait.SCMSourceRequest request, @NonNull BranchSCMHead head)
      Strategy-specific exclusion logic, called only for branch heads not covered by the always-included regex.
      Parameters:
      request - the current SCM source request.
      head - the branch head being evaluated.
      Returns:
      true if the branch should be excluded from discovery.