Class BranchDiscoveryTrait

  • All Implemented Interfaces:
    ExtensionPoint, Describable<jenkins.scm.api.trait.SCMSourceTrait>

    public class BranchDiscoveryTrait
    extends jenkins.scm.api.trait.SCMSourceTrait
    A Discovery trait for GitLab that will discover branches on the repository.
    • Constructor Detail

      • BranchDiscoveryTrait

        @DataBoundConstructor
        public BranchDiscoveryTrait​(int strategyId)
        Constructor for stapler.
        Parameters:
        strategyId - the strategy id.
      • BranchDiscoveryTrait

        public BranchDiscoveryTrait​(boolean buildBranch,
                                    boolean buildBranchWithMr)
        Constructor for legacy code.
        Parameters:
        buildBranch - build branches that are not filed as a MR.
        buildBranchWithMr - build branches that are also MRs.
    • Method Detail

      • getStrategyId

        public int getStrategyId()
        Returns the strategy id.
        Returns:
        the strategy id.
      • getBranchesAlwaysIncludedRegex

        public String getBranchesAlwaysIncludedRegex()
        Returns the branchesAlwaysIncludedRegex.
        Returns:
        the branchesAlwaysIncludedRegex.
      • setBranchesAlwaysIncludedRegex

        @DataBoundSetter
        public void setBranchesAlwaysIncludedRegex​(@CheckForNull
                                                   String branchesAlwaysIncludedRegex)
        Sets the branchesAlwaysIncludedRegex.
      • getBranchesAlwaysIncludedRegexPattern

        public Pattern getBranchesAlwaysIncludedRegexPattern()
        Returns the compiled Pattern of the branchesAlwaysIncludedRegex.
        Returns:
        the branchesAlwaysIncludedRegexPattern.
      • isBuildBranch

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isBuildBranch()
        Returns true if building branches that are not filed as a MR.
        Returns:
        true if building branches that are not filed as a MR.
      • isBuildBranchesWithMR

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isBuildBranchesWithMR()
        Returns true if building branches that are filed as a MR.
        Returns:
        true if building branches that are filed as a MR.
      • decorateContext

        protected void decorateContext​(jenkins.scm.api.trait.SCMSourceContext<?,​?> context)
        Overrides:
        decorateContext in class jenkins.scm.api.trait.SCMSourceTrait
      • includeCategory

        public boolean includeCategory​(@NonNull
                                       jenkins.scm.api.SCMHeadCategory category)
        Overrides:
        includeCategory in class jenkins.scm.api.trait.SCMSourceTrait