Class GitHubSCMSourceContext

java.lang.Object
jenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,GitHubSCMSourceRequest>
org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceContext

public class GitHubSCMSourceContext extends jenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,GitHubSCMSourceRequest>
The SCMSourceContext for GitHub.
Since:
2.2.0
  • Constructor Details

    • GitHubSCMSourceContext

      public GitHubSCMSourceContext(@CheckForNull jenkins.scm.api.SCMSourceCriteria criteria, @NonNull jenkins.scm.api.SCMHeadObserver observer)
      Constructor.
      Parameters:
      criteria - (optional) criteria.
      observer - the SCMHeadObserver.
  • Method Details

    • wantBranches

      public final boolean wantBranches()
      Returns true if the GitHubSCMSourceRequest will need information about branches.
      Returns:
      true if the GitHubSCMSourceRequest will need information about branches.
    • wantTags

      public final boolean wantTags()
      Returns true if the GitHubSCMSourceRequest will need information about tags.
      Returns:
      true if the GitHubSCMSourceRequest will need information about tags.
    • wantPRs

      public final boolean wantPRs()
      Returns true if the GitHubSCMSourceRequest will need information about pull requests.
      Returns:
      true if the GitHubSCMSourceRequest will need information about pull requests.
    • wantOriginPRs

      public final boolean wantOriginPRs()
      Returns true if the GitHubSCMSourceRequest will need information about origin pull requests.
      Returns:
      true if the GitHubSCMSourceRequest will need information about origin pull requests.
    • wantForkPRs

      public final boolean wantForkPRs()
      Returns true if the GitHubSCMSourceRequest will need information about fork pull requests.
      Returns:
      true if the GitHubSCMSourceRequest will need information about fork pull requests.
    • originPRStrategies

      @NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> originPRStrategies()
      Returns the set of ChangeRequestCheckoutStrategy to create for each origin pull request.
      Returns:
      the set of ChangeRequestCheckoutStrategy to create for each origin pull request.
    • forkPRStrategies

      @NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> forkPRStrategies()
      Returns the set of ChangeRequestCheckoutStrategy to create for each fork pull request.
      Returns:
      the set of ChangeRequestCheckoutStrategy to create for each fork pull request.
    • notificationStrategies

      public final List<AbstractGitHubNotificationStrategy> notificationStrategies()
      Returns the strategies used to notify Github of build status.
      Returns:
      the strategies used to notify Github of build status.
      Since:
      2.3.2
    • notificationsDisabled

      public final boolean notificationsDisabled()
      Returns true if notifications should be disabled.
      Returns:
      true if notifications should be disabled.
    • wantBranches

      @NonNull public GitHubSCMSourceContext wantBranches(boolean include)
      Adds a requirement for branch details to any GitHubSCMSourceRequest for this context.
      Parameters:
      include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
      Returns:
      this for method chaining.
    • wantTags

      @NonNull public GitHubSCMSourceContext wantTags(boolean include)
      Adds a requirement for tag details to any GitHubSCMSourceRequest for this context.
      Parameters:
      include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
      Returns:
      this for method chaining.
    • wantOriginPRs

      @NonNull public GitHubSCMSourceContext wantOriginPRs(boolean include)
      Adds a requirement for origin pull request details to any GitHubSCMSourceRequest for this context.
      Parameters:
      include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
      Returns:
      this for method chaining.
    • wantForkPRs

      @NonNull public GitHubSCMSourceContext wantForkPRs(boolean include)
      Adds a requirement for fork pull request details to any GitHubSCMSourceRequest for this context.
      Parameters:
      include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
      Returns:
      this for method chaining.
    • withOriginPRStrategies

      @NonNull public GitHubSCMSourceContext withOriginPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies)
      Defines the ChangeRequestCheckoutStrategy instances to create for each origin pull request.
      Parameters:
      strategies - the strategies.
      Returns:
      this for method chaining.
    • withForkPRStrategies

      @NonNull public GitHubSCMSourceContext withForkPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies)
      Defines the ChangeRequestCheckoutStrategy instances to create for each fork pull request.
      Parameters:
      strategies - the strategies.
      Returns:
      this for method chaining.
    • withNotificationStrategies

      @NonNull public final GitHubSCMSourceContext withNotificationStrategies(List<AbstractGitHubNotificationStrategy> strategies)
      Replaces the list of strategies used to notify Github of build status.
      Parameters:
      strategies - the strategies used to notify Github of build status.
      Returns:
      this for method chaining.
      Since:
      2.3.2
    • withNotificationStrategy

      @NonNull public final GitHubSCMSourceContext withNotificationStrategy(AbstractGitHubNotificationStrategy strategy)
      Add a strategy used to notify Github of build status.
      Parameters:
      strategy - a strategy used to notify Github of build status.
      Returns:
      this for method chaining.
      Since:
      2.3.2
    • withNotificationsDisabled

      @NonNull public final GitHubSCMSourceContext withNotificationsDisabled(boolean disabled)
      Defines the notification mode to use in this context.
      Parameters:
      disabled - true to disable automatic notifications.
      Returns:
      this for method chaining.
    • newRequest

      @NonNull public GitHubSCMSourceRequest newRequest(@NonNull jenkins.scm.api.SCMSource source, @CheckForNull TaskListener listener)
      Specified by:
      newRequest in class jenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,GitHubSCMSourceRequest>