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>
TheSCMSourceContext
for GitHub.- Since:
- 2.2.0
-
-
Constructor Summary
Constructors Constructor Description GitHubSCMSourceContext(jenkins.scm.api.SCMSourceCriteria criteria, jenkins.scm.api.SCMHeadObserver observer)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
forkPRStrategies()
Returns the set ofChangeRequestCheckoutStrategy
to create for each fork pull request.GitHubSCMSourceRequest
newRequest(jenkins.scm.api.SCMSource source, TaskListener listener)
boolean
notificationsDisabled()
Returnstrue
if notifications should be disabled.List<AbstractGitHubNotificationStrategy>
notificationStrategies()
Returns the strategies used to notify Github of build status.Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
originPRStrategies()
Returns the set ofChangeRequestCheckoutStrategy
to create for each origin pull request.boolean
wantBranches()
Returnstrue
if theGitHubSCMSourceRequest
will need information about branches.GitHubSCMSourceContext
wantBranches(boolean include)
Adds a requirement for branch details to anyGitHubSCMSourceRequest
for this context.boolean
wantForkPRs()
Returnstrue
if theGitHubSCMSourceRequest
will need information about fork pull requests.GitHubSCMSourceContext
wantForkPRs(boolean include)
Adds a requirement for fork pull request details to anyGitHubSCMSourceRequest
for this context.boolean
wantOriginPRs()
Returnstrue
if theGitHubSCMSourceRequest
will need information about origin pull requests.GitHubSCMSourceContext
wantOriginPRs(boolean include)
Adds a requirement for origin pull request details to anyGitHubSCMSourceRequest
for this context.boolean
wantPRs()
Returnstrue
if theGitHubSCMSourceRequest
will need information about pull requests.boolean
wantTags()
Returnstrue
if theGitHubSCMSourceRequest
will need information about tags.GitHubSCMSourceContext
wantTags(boolean include)
Adds a requirement for tag details to anyGitHubSCMSourceRequest
for this context.GitHubSCMSourceContext
withForkPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies)
Defines theChangeRequestCheckoutStrategy
instances to create for each fork pull request.GitHubSCMSourceContext
withNotificationsDisabled(boolean disabled)
Defines the notification mode to use in this context.GitHubSCMSourceContext
withNotificationStrategies(List<AbstractGitHubNotificationStrategy> strategies)
Replaces the list of strategies used to notify Github of build status.GitHubSCMSourceContext
withNotificationStrategy(AbstractGitHubNotificationStrategy strategy)
Add a strategy used to notify Github of build status.GitHubSCMSourceContext
withOriginPRStrategies(Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> strategies)
Defines theChangeRequestCheckoutStrategy
instances to create for each origin pull request.
-
-
-
Method Detail
-
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
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> 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
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> 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
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()
Returnstrue
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 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
@NonNull public GitHubSCMSourceContext wantTags(boolean include)
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
@NonNull public GitHubSCMSourceContext wantOriginPRs(boolean include)
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
@NonNull public GitHubSCMSourceContext wantForkPRs(boolean include)
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
@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 classjenkins.scm.api.trait.SCMSourceContext<GitHubSCMSourceContext,GitHubSCMSourceRequest>
-
-