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 Summary
ConstructorsConstructorDescriptionGitHubSCMSourceContext(jenkins.scm.api.SCMSourceCriteria criteria, jenkins.scm.api.SCMHeadObserver observer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>Returns the set ofChangeRequestCheckoutStrategyto create for each fork pull request.newRequest(jenkins.scm.api.SCMSource source, TaskListener listener) final booleanReturnstrueif notifications should be disabled.Returns the strategies used to notify Github of build status.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>Returns the set ofChangeRequestCheckoutStrategyto create for each origin pull request.final booleanReturnstrueif theGitHubSCMSourceRequestwill need information about branches.wantBranches(boolean include) Adds a requirement for branch details to anyGitHubSCMSourceRequestfor this context.final booleanReturnstrueif theGitHubSCMSourceRequestwill need information about fork pull requests.wantForkPRs(boolean include) Adds a requirement for fork pull request details to anyGitHubSCMSourceRequestfor this context.final booleanReturnstrueif theGitHubSCMSourceRequestwill need information about origin pull requests.wantOriginPRs(boolean include) Adds a requirement for origin pull request details to anyGitHubSCMSourceRequestfor this context.final booleanwantPRs()Returnstrueif theGitHubSCMSourceRequestwill need information about pull requests.final booleanwantTags()Returnstrueif theGitHubSCMSourceRequestwill need information about tags.wantTags(boolean include) Adds a requirement for tag details to anyGitHubSCMSourceRequestfor this context.withForkPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategyinstances to create for each fork pull request.final GitHubSCMSourceContextwithNotificationsDisabled(boolean disabled) Defines the notification mode to use in this context.final GitHubSCMSourceContextReplaces the list of strategies used to notify Github of build status.final GitHubSCMSourceContextAdd a strategy used to notify Github of build status.withOriginPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategyinstances to create for each origin pull request.Methods inherited from class jenkins.scm.api.trait.SCMSourceContext
authorities, criteria, filters, observer, prefilters, withAuthority, withCriteria, withFilter, withPrefilter, withTrait, withTraits, withTraits
-
Constructor Details
-
GitHubSCMSourceContext
public GitHubSCMSourceContext(@CheckForNull jenkins.scm.api.SCMSourceCriteria criteria, @NonNull jenkins.scm.api.SCMHeadObserver observer) Constructor.- Parameters:
criteria- (optional) criteria.observer- theSCMHeadObserver.
-
-
Method Details
-
wantBranches
public final boolean wantBranches()Returnstrueif theGitHubSCMSourceRequestwill need information about branches.- Returns:
trueif theGitHubSCMSourceRequestwill need information about branches.
-
wantTags
public final boolean wantTags()Returnstrueif theGitHubSCMSourceRequestwill need information about tags.- Returns:
trueif theGitHubSCMSourceRequestwill need information about tags.
-
wantPRs
public final boolean wantPRs()Returnstrueif theGitHubSCMSourceRequestwill need information about pull requests.- Returns:
trueif theGitHubSCMSourceRequestwill need information about pull requests.
-
wantOriginPRs
public final boolean wantOriginPRs()Returnstrueif theGitHubSCMSourceRequestwill need information about origin pull requests.- Returns:
trueif theGitHubSCMSourceRequestwill need information about origin pull requests.
-
wantForkPRs
public final boolean wantForkPRs()Returnstrueif theGitHubSCMSourceRequestwill need information about fork pull requests.- Returns:
trueif theGitHubSCMSourceRequestwill need information about fork pull requests.
-
originPRStrategies
Returns the set ofChangeRequestCheckoutStrategyto create for each origin pull request.- Returns:
- the set of
ChangeRequestCheckoutStrategyto create for each origin pull request.
-
forkPRStrategies
Returns the set ofChangeRequestCheckoutStrategyto create for each fork pull request.- Returns:
- the set of
ChangeRequestCheckoutStrategyto create for each fork pull request.
-
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()Returnstrueif notifications should be disabled.- Returns:
trueif notifications should be disabled.
-
wantBranches
Adds a requirement for branch details to anyGitHubSCMSourceRequestfor this context.- Parameters:
include-trueto add the requirement orfalseto leave the requirement as is (makes simpler with method chaining)- Returns:
thisfor method chaining.
-
wantTags
Adds a requirement for tag details to anyGitHubSCMSourceRequestfor this context.- Parameters:
include-trueto add the requirement orfalseto leave the requirement as is (makes simpler with method chaining)- Returns:
thisfor method chaining.
-
wantOriginPRs
Adds a requirement for origin pull request details to anyGitHubSCMSourceRequestfor this context.- Parameters:
include-trueto add the requirement orfalseto leave the requirement as is (makes simpler with method chaining)- Returns:
thisfor method chaining.
-
wantForkPRs
Adds a requirement for fork pull request details to anyGitHubSCMSourceRequestfor this context.- Parameters:
include-trueto add the requirement orfalseto leave the requirement as is (makes simpler with method chaining)- Returns:
thisfor method chaining.
-
withOriginPRStrategies
@NonNull public GitHubSCMSourceContext withOriginPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategyinstances to create for each origin pull request.- Parameters:
strategies- the strategies.- Returns:
thisfor method chaining.
-
withForkPRStrategies
@NonNull public GitHubSCMSourceContext withForkPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategyinstances to create for each fork pull request.- Parameters:
strategies- the strategies.- Returns:
thisfor 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:
thisfor 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:
thisfor method chaining.- Since:
- 2.3.2
-
withNotificationsDisabled
Defines the notification mode to use in this context.- Parameters:
disabled-trueto disable automatic notifications.- Returns:
thisfor method chaining.
-
newRequest
@NonNull public GitHubSCMSourceRequest newRequest(@NonNull jenkins.scm.api.SCMSource source, @CheckForNull TaskListener listener) - Specified by:
newRequestin classjenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,GitHubSCMSourceRequest>
-