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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanautomaticBuild(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision) API: Should the specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?final booleanautomaticBuild(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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?final booleanautomaticBuild(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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?booleanisAutomaticBuild(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head) Deprecated.booleanisAutomaticBuild(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision) Deprecated.booleanisAutomaticBuild(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision) booleanisAutomaticBuild(jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision currRevision, jenkins.scm.api.SCMRevision prevRevision, TaskListener listener) Deprecated.abstract booleanisAutomaticBuild(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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas 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 specifiedSCMHeadfor the specifiedSCMSourcebe built whenever it is detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHead- Returns:
trueif and only if theSCMHeadshould 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadrevision- theSCMRevision- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the head is now atprevRevision- theSCMRevisionthat the head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the head is now atprevRevision- theSCMRevisionthat the head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.listener- theTaskListenerthat can be used for outputting any rational for the decision- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the build head is now atlastBuiltRevision- theSCMRevisionthat the build head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.lastSeenRevision- theSCMRevisionthat the head was last seenlistener- theTaskListenerthat can be used for outputting any rational for the decision- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the head is now atprevRevision- theSCMRevisionthat the head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the head is now atprevRevision- theSCMRevisionthat the head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.listener- the TaskListener to be used- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas 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 specifiedSCMRevisionof theSCMHeadfor the specifiedSCMSourcebe triggered when theSCMHeadhas been detected as created / modified?- Parameters:
source- theSCMSourcehead- theSCMHeadcurrRevision- theSCMRevisionthat the head is now atlastBuiltRevision- theSCMRevisionthat the build head was last seen at ornullif 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 andcurrRevisioneven if the two are equal.lastSeenRevision- theSCMRevisionthat the head was last seenlistener- the TaskListener to be used- Returns:
trueif and only if theSCMRevisionshould be automatically built when theSCMHeadhas been detected as created / modified.- Since:
- 2.4.2
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<BranchBuildStrategy>- Overrides:
getDescriptorin classAbstractDescribableImpl<BranchBuildStrategy>
-
automaticBuild(SCMSource, SCMHead, SCMRevision, SCMRevision)