Class ForkPullRequestDiscoveryTrait
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.ForkPullRequestDiscoveryTrait
- All Implemented Interfaces:
ExtensionPoint
,Describable<jenkins.scm.api.trait.SCMSourceTrait>
public class ForkPullRequestDiscoveryTrait
extends jenkins.scm.api.trait.SCMSourceTrait
A
Discovery
trait for GitHub that will discover pull requests from forks of the
repository.- Since:
- 2.2.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Our descriptor.static class
Trust policy for forked pull requests.static class
AnSCMHeadAuthority
that trusts contributors to the repository.static class
AnSCMHeadAuthority
that trusts everyone.static class
AnSCMHeadAuthority
that trusts nothing.static class
AnSCMHeadAuthority
that trusts those with write permission to the repository.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The current pull request revision.static final int
Both the current pull request revision and the pull request merged with the current target branch revision.static final int
Merging the pull request with the current target branch revision.static final int
None strategy. -
Constructor Summary
ConstructorDescriptionForkPullRequestDiscoveryTrait
(int strategyId, jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest, ? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends jenkins.scm.api.SCMRevision> trust) Deprecated.ForkPullRequestDiscoveryTrait
(int strategyId, ForkPullRequestDiscoveryTrait.GitHubForkTrustPolicy trust) Constructor for stapler.ForkPullRequestDiscoveryTrait
(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies, jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest, ? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends jenkins.scm.api.SCMRevision> trust) Constructor for programmatic instantiation. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
decorateContext
(jenkins.scm.api.trait.SCMSourceContext<?, ?> context) Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
Returns the strategies.int
Gets the strategy id.jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest,
? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends jenkins.scm.api.SCMRevision> getTrust()
Gets the authority.boolean
includeCategory
(jenkins.scm.api.SCMHeadCategory category) Methods inherited from class jenkins.scm.api.trait.SCMSourceTrait
_for, _for, all, applyToBuilder, applyToContext, applyToObserver, decorateBuilder, decorateObserver, getDescriptor, isCategoryEnabled
Methods inherited from class jenkins.scm.api.trait.SCMTrait
asSetList, asSetList, find
-
Field Details
-
NONE
public static final int NONENone strategy.- See Also:
-
MERGE
public static final int MERGEMerging the pull request with the current target branch revision.- See Also:
-
HEAD
public static final int HEADThe current pull request revision.- See Also:
-
HEAD_AND_MERGE
public static final int HEAD_AND_MERGEBoth the current pull request revision and the pull request merged with the current target branch revision.- See Also:
-
-
Constructor Details
-
ForkPullRequestDiscoveryTrait
@DataBoundConstructor public ForkPullRequestDiscoveryTrait(int strategyId, @NonNull ForkPullRequestDiscoveryTrait.GitHubForkTrustPolicy trust) Constructor for stapler.- Parameters:
strategyId
- the strategy id.trust
- the authority to use.
-
ForkPullRequestDiscoveryTrait
@Deprecated public ForkPullRequestDiscoveryTrait(int strategyId, @NonNull jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest, ? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends jenkins.scm.api.SCMRevision> trust) Deprecated. -
ForkPullRequestDiscoveryTrait
public ForkPullRequestDiscoveryTrait(@NonNull Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies, @NonNull jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest, ? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, ? extends jenkins.scm.api.SCMRevision> trust) Constructor for programmatic instantiation.- Parameters:
strategies
- theChangeRequestCheckoutStrategy
instances.trust
- the authority.
-
-
Method Details
-
getStrategyId
public int getStrategyId()Gets the strategy id.- Returns:
- the strategy id.
-
getStrategies
Returns the strategies.- Returns:
- the strategies.
-
getTrust
@NonNull public jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest,? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2, getTrust()? extends jenkins.scm.api.SCMRevision> Gets the authority.- Returns:
- the authority.
-
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
-