Package jenkins.branch
Class BranchBuildStrategy
- All Implemented Interfaces:
ExtensionPoint
,Describable<BranchBuildStrategy>
public abstract class BranchBuildStrategy
extends AbstractDescribableImpl<BranchBuildStrategy>
implements ExtensionPoint
An extension point that allows controlling whether a specific
SCMHead
should be automatically built when
discovered.
Methods marked as SPI:
are intended to be implemented by implementers of BranchBuildStrategy
.
Methods marked as API:
are intended to be invoked consumers of BranchBuildStrategy
.
A consumer invoking a SPI:
method may get a UnsupportedOperationException
.
Methods marked as SPI:
are only to be invoked through the API methods in order to allow safe evolution.
Changing the API may require updating any SPI implementations that are also API consumers, specifically the Any,
All and None implementations in basic-branch-build-strategies
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
automaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?final boolean
automaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision, TaskListener listener) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?final boolean
automaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision lastBuiltRevision, jenkins.scm.api.SCMRevision lastSeenRevision, TaskListener listener) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?boolean
isAutomaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head) Deprecated.boolean
isAutomaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision) Deprecated.boolean
isAutomaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision) boolean
isAutomaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision, TaskListener listener) Deprecated.abstract boolean
isAutomaticBuild
(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision lastBuiltRevision, jenkins.scm.api.SCMRevision lastSeenRevision, TaskListener listener) SPI: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?
-
Constructor Details
-
BranchBuildStrategy
public BranchBuildStrategy()
-
-
Method Details
-
isAutomaticBuild
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) public boolean isAutomaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head) Deprecated.SPI: Should the specifiedSCMHead
for the specifiedSCMSource
be built whenever it is detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
- Returns:
true
if and only if theSCMHead
should be automatically built when detected as created / modified.
-
isAutomaticBuild
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) public boolean isAutomaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision revision) Deprecated.SPI: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
revision
- theSCMRevision
- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.0.12
-
isAutomaticBuild
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) public boolean isAutomaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision prevRevision) SPI: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the head is now atprevRevision
- theSCMRevision
that the head was last seen at ornull
if this is a newly discovered head. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.0.17
-
isAutomaticBuild
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) public boolean isAutomaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision prevRevision, @NonNull TaskListener listener) Deprecated.SPI: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the head is now atprevRevision
- theSCMRevision
that the head was last seen at ornull
if this is a newly discovered head. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.listener
- theTaskListener
that can be used for outputting any rational for the decision- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.1.3
-
isAutomaticBuild
@Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) public abstract boolean isAutomaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision lastBuiltRevision, @CheckForNull jenkins.scm.api.SCMRevision lastSeenRevision, @NonNull TaskListener listener) SPI: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the build head is now atlastBuiltRevision
- theSCMRevision
that the build head was last seen at ornull
if this is a newly discovered head. It replaces prevRevision from the previous SPI version. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.lastSeenRevision
- theSCMRevision
that the head was last seenlistener
- theTaskListener
that can be used for outputting any rational for the decision- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.4.2
-
automaticBuild
public final boolean automaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision prevRevision) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the head is now atprevRevision
- theSCMRevision
that the head was last seen at ornull
if this is a newly discovered head. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.0.17
-
automaticBuild
public final boolean automaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision prevRevision, @NonNull TaskListener listener) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the head is now atprevRevision
- theSCMRevision
that the head was last seen at ornull
if this is a newly discovered head. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.listener
- the TaskListener to be used- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.1.3
-
automaticBuild
public final boolean automaticBuild(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @NonNull jenkins.scm.api.SCMRevision currRevision, @CheckForNull jenkins.scm.api.SCMRevision lastBuiltRevision, @CheckForNull jenkins.scm.api.SCMRevision lastSeenRevision, @NonNull TaskListener listener) API: Should the specifiedSCMRevision
of theSCMHead
for the specifiedSCMSource
be triggered when theSCMHead
has been detected as created / modified?- Parameters:
source
- theSCMSource
head
- theSCMHead
currRevision
- theSCMRevision
that the head is now atlastBuiltRevision
- theSCMRevision
that the build head was last seen at ornull
if this is a newly discovered head. Care should be taken to consider the case of nonSCMRevision.isDeterministic()
previous revisions as polling for changes will have confirmed that there is a change between this andcurrRevision
even if the two are equal.lastSeenRevision
- theSCMRevision
that the head was last seenlistener
- the TaskListener to be used- Returns:
true
if and only if theSCMRevision
should be automatically built when theSCMHead
has been detected as created / modified.- Since:
- 2.4.2
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<BranchBuildStrategy>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<BranchBuildStrategy>
-
automaticBuild(SCMSource, SCMHead, SCMRevision, SCMRevision)