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
ConstructorDescriptionGitHubSCMSourceContext
(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 ofChangeRequestCheckoutStrategy
to create for each fork pull request.newRequest
(jenkins.scm.api.SCMSource source, TaskListener listener) final boolean
Returnstrue
if notifications should be disabled.Returns the strategies used to notify Github of build status.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
Returns the set ofChangeRequestCheckoutStrategy
to create for each origin pull request.final boolean
Returnstrue
if theGitHubSCMSourceRequest
will need information about branches.wantBranches
(boolean include) Adds a requirement for branch details to anyGitHubSCMSourceRequest
for this context.final boolean
Returnstrue
if theGitHubSCMSourceRequest
will need information about fork pull requests.wantForkPRs
(boolean include) Adds a requirement for fork pull request details to anyGitHubSCMSourceRequest
for this context.final boolean
Returnstrue
if theGitHubSCMSourceRequest
will need information about origin pull requests.wantOriginPRs
(boolean include) Adds a requirement for origin pull request details to anyGitHubSCMSourceRequest
for this context.final boolean
wantPRs()
Returnstrue
if theGitHubSCMSourceRequest
will need information about pull requests.final boolean
wantTags()
Returnstrue
if theGitHubSCMSourceRequest
will need information about tags.wantTags
(boolean include) Adds a requirement for tag details to anyGitHubSCMSourceRequest
for this context.withForkPRStrategies
(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategy
instances to create for each fork pull request.final GitHubSCMSourceContext
withNotificationsDisabled
(boolean disabled) Defines the notification mode to use in this context.final GitHubSCMSourceContext
Replaces the list of strategies used to notify Github of build status.final GitHubSCMSourceContext
Add a strategy used to notify Github of build status.withOriginPRStrategies
(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies) Defines theChangeRequestCheckoutStrategy
instances 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()Returnstrue
if theGitHubSCMSourceRequest
will need information about branches.- Returns:
true
if theGitHubSCMSourceRequest
will need information about branches.
-
wantTags
public final boolean wantTags()Returnstrue
if theGitHubSCMSourceRequest
will need information about tags.- Returns:
true
if theGitHubSCMSourceRequest
will need information about tags.
-
wantPRs
public final boolean wantPRs()Returnstrue
if theGitHubSCMSourceRequest
will need information about pull requests.- Returns:
true
if theGitHubSCMSourceRequest
will need information about pull requests.
-
wantOriginPRs
public final boolean wantOriginPRs()Returnstrue
if theGitHubSCMSourceRequest
will need information about origin pull requests.- Returns:
true
if theGitHubSCMSourceRequest
will need information about origin pull requests.
-
wantForkPRs
public final boolean wantForkPRs()Returnstrue
if theGitHubSCMSourceRequest
will need information about fork pull requests.- Returns:
true
if theGitHubSCMSourceRequest
will need information about fork pull requests.
-
originPRStrategies
Returns the set ofChangeRequestCheckoutStrategy
to create for each origin pull request.- Returns:
- the set of
ChangeRequestCheckoutStrategy
to create for each origin pull request.
-
forkPRStrategies
Returns the set ofChangeRequestCheckoutStrategy
to create for each fork pull request.- Returns:
- the set of
ChangeRequestCheckoutStrategy
to 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()Returnstrue
if notifications should be disabled.- Returns:
true
if notifications should be disabled.
-
wantBranches
Adds a requirement for branch details to anyGitHubSCMSourceRequest
for this context.- Parameters:
include
-true
to add the requirement orfalse
to leave the requirement as is (makes simpler with method chaining)- Returns:
this
for method chaining.
-
wantTags
Adds a requirement for tag details to anyGitHubSCMSourceRequest
for this context.- Parameters:
include
-true
to add the requirement orfalse
to leave the requirement as is (makes simpler with method chaining)- Returns:
this
for method chaining.
-
wantOriginPRs
Adds a requirement for origin pull request details to anyGitHubSCMSourceRequest
for this context.- Parameters:
include
-true
to add the requirement orfalse
to leave the requirement as is (makes simpler with method chaining)- Returns:
this
for method chaining.
-
wantForkPRs
Adds a requirement for fork pull request details to anyGitHubSCMSourceRequest
for this context.- Parameters:
include
-true
to add the requirement orfalse
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 theChangeRequestCheckoutStrategy
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 theChangeRequestCheckoutStrategy
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
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 classjenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,
GitHubSCMSourceRequest>
-