Class ForkPullRequestDiscoveryTrait

  • All Implemented Interfaces:
    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
    • Field Detail

      • MERGE

        public static final int MERGE
        Merging the pull request with the current target branch revision.
        See Also:
        Constant Field Values
      • HEAD_AND_MERGE

        public static final int HEAD_AND_MERGE
        Both the current pull request revision and the pull request merged with the current target branch revision.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ForkPullRequestDiscoveryTrait

        @DataBoundConstructor
        public ForkPullRequestDiscoveryTrait​(int strategyId,
                                             @NonNull
                                             jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest,​? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2,​? extends jenkins.scm.api.SCMRevision> trust)
        Constructor for stapler.
        Parameters:
        strategyId - the strategy id.
        trust - the authority to use.
      • 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 - the ChangeRequestCheckoutStrategy instances.
        trust - the authority.
    • Method Detail

      • getStrategyId

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

        @NonNull
        public Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getStrategies()
        Returns the strategies.
        Returns:
        the strategies.
      • getTrust

        @NonNull
        public jenkins.scm.api.trait.SCMHeadAuthority<? super GitHubSCMSourceRequest,​? extends jenkins.scm.api.mixin.ChangeRequestSCMHead2,​? extends jenkins.scm.api.SCMRevision> getTrust()
        Gets the authority.
        Returns:
        the authority.
      • 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