Class BranchDiscoveryTrait
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<T>
-
- jenkins.scm.api.trait.SCMTrait<jenkins.scm.api.trait.SCMSourceTrait>
-
- jenkins.scm.api.trait.SCMSourceTrait
-
- org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<jenkins.scm.api.trait.SCMSourceTrait>
public class BranchDiscoveryTrait extends jenkins.scm.api.trait.SCMSourceTrait
ADiscovery
trait for GitHub that will discover branches on the repository.- Since:
- 2.2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BranchDiscoveryTrait.BranchSCMHeadAuthority
Trusts branches from the origin repository.static class
BranchDiscoveryTrait.DescriptorImpl
Our descriptor.static class
BranchDiscoveryTrait.ExcludeOriginPRBranchesSCMHeadFilter
Filter that excludes branches that are also filed as a pull request.static class
BranchDiscoveryTrait.OnlyOriginPRBranchesSCMHeadFilter
Filter that excludes branches that are not also filed as a pull request.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALL_BRANCHES
All branches.static int
EXCLUDE_PRS
Exclude branches that are also filed as PRs.static int
NONE
None strategy.static int
ONLY_PRS
Only branches that are also filed as PRs.
-
Constructor Summary
Constructors Constructor Description BranchDiscoveryTrait(boolean buildBranch, boolean buildBranchWithPr)
Constructor for legacy code.BranchDiscoveryTrait(int strategyId)
Constructor for stapler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decorateContext(jenkins.scm.api.trait.SCMSourceContext<?,?> context)
int
getStrategyId()
Returns the strategy id.boolean
includeCategory(jenkins.scm.api.SCMHeadCategory category)
boolean
isBuildBranch()
Returnstrue
if building branches that are not filed as a PR.boolean
isBuildBranchesWithPR()
Returnstrue
if building branches that are filed as a PR.
-
-
-
Field Detail
-
NONE
public static final int NONE
None strategy.- See Also:
- Constant Field Values
-
EXCLUDE_PRS
public static final int EXCLUDE_PRS
Exclude branches that are also filed as PRs.- See Also:
- Constant Field Values
-
ONLY_PRS
public static final int ONLY_PRS
Only branches that are also filed as PRs.- See Also:
- Constant Field Values
-
ALL_BRANCHES
public static final int ALL_BRANCHES
All branches.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BranchDiscoveryTrait
@DataBoundConstructor public BranchDiscoveryTrait(int strategyId)
Constructor for stapler.- Parameters:
strategyId
- the strategy id.
-
BranchDiscoveryTrait
public BranchDiscoveryTrait(boolean buildBranch, boolean buildBranchWithPr)
Constructor for legacy code.- Parameters:
buildBranch
- build branches that are not filed as a PR.buildBranchWithPr
- build branches that are also PRs.
-
-
Method Detail
-
getStrategyId
public int getStrategyId()
Returns the strategy id.- Returns:
- the strategy id.
-
isBuildBranch
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isBuildBranch()
Returnstrue
if building branches that are not filed as a PR.- Returns:
true
if building branches that are not filed as a PR.
-
isBuildBranchesWithPR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isBuildBranchesWithPR()
Returnstrue
if building branches that are filed as a PR.- Returns:
true
if building branches that are filed as a PR.
-
decorateContext
protected void decorateContext(jenkins.scm.api.trait.SCMSourceContext<?,?> context)
- Overrides:
decorateContext
in classjenkins.scm.api.trait.SCMSourceTrait
-
includeCategory
public boolean includeCategory(@NonNull jenkins.scm.api.SCMHeadCategory category)
- Overrides:
includeCategory
in classjenkins.scm.api.trait.SCMSourceTrait
-
-