public interface BuildPromotion extends java.lang.Comparable<BuildPromotion>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NOT_EXISTING_BUILD_TYPE_ID
A stub value that is returned by
getBuildTypeExternalId() when build type external id
does not exist. |
Modifier and Type | Method and Description |
---|---|
SQueuedBuild |
addToQueue(SBuildAgent buildAgent,
java.lang.String triggeredBy)
Creates a new build on the base of this promotion
(and all necessary builds for the promotions this one depends on) and adds it to the Queue.
|
SQueuedBuild |
addToQueue(java.lang.String triggeredBy)
Creates a new build on the base of this promotion
(and all necessary builds for the promotions this one depends on) and adds it to the Queue.
|
BuildPromotion |
copy(boolean copyRevisions)
Creates copy of this build promotion (a copy will have different id).
|
BuildPromotion[] |
findTops()
Return a collection of top-level build promotions for sequence builds this build promotion participates in.
|
java.util.List<? extends BuildPromotion> |
getAllDependencies()
Returns the full list of snapshot dependencies (including transitive ones)
of this build promotion filtered according to current user permissions.
|
java.util.List<SArtifactDependency> |
getArtifactDependencies()
Returns collection of artifact dependencies to be sent to an agent.
|
java.io.File |
getArtifactsDirectory() |
SBuild |
getAssociatedBuild()
Returns running or finished build associated with this promotion or null if there is no such build.
|
java.lang.Long |
getAssociatedBuildId()
Returns id of the build associated with this promotion, or null if there is no such build.
|
Branch |
getBranch() |
Comment |
getBuildComment()
Returns build comment assigned for this promotion
|
BuildLog |
getBuildLog() |
java.util.Map<java.lang.String,java.lang.String> |
getBuildParameters()
Returns combined map of default and custom defined build parameters.
|
SBuildType |
getBuildType()
Returns build configuration to which this promotion corresponds.
|
java.lang.String |
getBuildTypeExternalId()
Returns the external id of the associated build type.
|
java.lang.String |
getBuildTypeId()
Returns internal id of build configuration to which this promotion corresponds, same as
getBuildType() .getBuildTypeId() |
java.util.Collection<SBuildAgent> |
getCanRunOnAgents(java.util.Collection<SBuildAgent> available)
Returns collection of agents where this build promotion can be executed.
|
BuildChanges |
getChanges(ChangesCalculationOptions options)
Returns build changes according to the specified options
|
java.util.List<SVcsModification> |
getChanges(SelectPrevBuildPolicy policy,
boolean returnChangesIfNoPreviousBuild)
Returns changes containing in this promotion according to the specified policy.
|
UserSet<SUser> |
getCommitters(SelectPrevBuildPolicy selectPrevBuildPolicy)
Returns committers of this build selected according to specified policy
|
java.util.Map<SBuildAgent,CompatibilityResult> |
getCompatibilityMap(java.util.Collection<SBuildAgent> available)
Returns compatibility map for given set of agents.
|
java.util.Collection<SBuildAgent> |
getCompatibleAgents(java.util.Collection<SBuildAgent> available)
Returns compatible agents only, does not check that build configuration is allowed to be executed on the agents
|
java.util.List<SVcsModification> |
getContainingChanges()
Returns changes containing in this promotion.
|
java.lang.String |
getCreatorNodeId() |
java.util.Map<java.lang.String,java.lang.String> |
getCustomParameters()
Returns map of user-defined build and configuration parameters associated with this build promotion.
|
java.util.Map<java.lang.String,java.lang.String> |
getDefaultParameters()
Returns map of default build and configuration parameters associated with this build promotion.
|
java.util.Collection<? extends BuildDependency> |
getDependedOnMe()
Returns snapshot dependencies of parent build promotions depending on this promotion.
|
java.util.Collection<? extends BuildDependency> |
getDependencies()
Returns the direct snapshot dependencies of this build promotion filtered according to current user permissions.
|
long |
getId()
Returns id of this promotion, promotion id is unique among all other build promotions
and is not changed during promotion life cycle.
|
java.lang.Long |
getLastModificationId()
Returns id of the last change associated with this promotion or null if changes collecting is not performed yet.
|
int |
getNumberOfDependedOnMe()
Returns total number of parent snapshot dependencies (without permissions filtering).
|
int |
getNumberOfDependencies()
Returns total number of snapshot dependencies (without permissions filtering).
|
SUser |
getOwner()
For personal builds returns owner of the build.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Returns combined map of default and custom parameters.
|
java.lang.String |
getParameterValue(java.lang.String paramName) |
SBuildType |
getParentBuildType()
Returns base build configuration to which this promotion corresponds, i.e.
|
java.lang.String |
getParentBuildTypeId()
For non personal builds returns same as
getBuildTypeId() . |
java.util.List<SVcsModification> |
getPersonalChanges()
Returns personal changes associated with this build promotion.
|
BuildPromotion |
getPreviousBuildPromotion(SelectPrevBuildPolicy policy)
Returns previous promotion created before this one and corresponding to the specified policy.
|
java.util.List<java.lang.String> |
getPrivateTags(SUser user)
Returns list of private tag labels in lexicographical order for particular user for this build promotion
|
java.lang.String |
getProjectExternalId()
Returns the project external id
|
java.lang.String |
getProjectId()
Returns the project internal id.
|
SQueuedBuild |
getQueuedBuild()
Returns queued build associated with this promotion or null if there is no such build in the queue
|
java.util.Date |
getQueuedDate()
Returns the date when the build was added to queue.
|
java.util.List<BuildRevision> |
getRevisions()
Returns VCS root revisions associated with this promotion.
|
java.util.Date |
getServerStartDate()
Returns the timestamp when the build was removed from the queue.
|
java.util.Collection<TagData> |
getTagDatas()
Returns list of all tags for this build promotion, no special order is preserved
|
java.util.List<java.lang.String> |
getTags()
Returns list of public tag labels in lexicographical order for the build promotion
|
java.util.List<VcsRootInstanceEntry> |
getVcsRootEntries()
Returns VCS root entries associated with this promotion.
|
boolean |
isCanceled()
Return true if associated build is canceled
|
boolean |
isChangesDetached() |
boolean |
isCompositeBuild() |
boolean |
isEquivalentTo(BuildPromotion promotion)
Returns true if this build promotion is equivalent to specified promotion, i.e.
|
boolean |
isFailedToCollectChanges() |
boolean |
isLaterThan(BuildPromotion promotion)
Returns true if this promotion contains more recent changes
comparing to the specified promotion.
|
boolean |
isOutOfChangesSequence()
Returns true if there is a build started before this build promotion associated build which contains more recent changes.
|
boolean |
isPartOfBuildChain() |
boolean |
isPersonal()
Return true if this build promotion relates to personal build
|
boolean |
isUsed()
Returns true if there is a reference to this build promotion from queued, running or history build.
|
void |
setBuildComment(User user,
java.lang.String comment)
Assigns the build comment for this promotion
|
void |
setDesiredBranchName(java.lang.String branchName) |
void |
setPrivateTags(java.util.List<java.lang.String> labels,
SUser user)
Set private tags for particular user
Attention! Replace all private tags related to the particular user with new set
|
void |
setTagDatas(java.util.Collection<TagData> tags)
Changes tag set for this build promotion.
|
void |
setTags(java.util.List<java.lang.String> labels)
Set public tags.
|
static final java.lang.String NOT_EXISTING_BUILD_TYPE_ID
getBuildTypeExternalId()
when build type external id
does not exist. The value is deliberately invalid in terms of external id rules to avoid a possibility of clash.long getId()
@Nullable SUser getOwner()
@Nullable SBuildType getBuildType()
If the correspondent build configuration is deleted - returns null.
@NotNull java.lang.String getBuildTypeId()
getBuildType()
.getBuildTypeId()@NotNull java.lang.String getBuildTypeExternalId()
If the external identifier does not exist (this might happen for a running build if the build type was deleted, and
a new build type with same external id was created), a NOT_EXISTING_BUILD_TYPE_ID
value is returned.
@Nullable SBuildType getParentBuildType()
@NotNull java.lang.String getParentBuildTypeId()
getBuildTypeId()
.
For personal builds returns id of parent build configuration: getParentBuildType().getBuildTypeId()@Nullable java.lang.String getProjectId()
@Nullable java.lang.String getProjectExternalId()
@NotNull java.util.List<BuildRevision> getRevisions()
@NotNull java.util.List<VcsRootInstanceEntry> getVcsRootEntries()
@NotNull java.util.List<SVcsModification> getContainingChanges()
@NotNull java.util.List<SVcsModification> getPersonalChanges()
@NotNull java.util.List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
policy
- policyreturnChangesIfNoPreviousBuild
- whether to return changes if there is no previous build in the history.@NotNull BuildChanges getChanges(@NotNull ChangesCalculationOptions options)
options
- changes calculation optionsUserSet<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy)
selectPrevBuildPolicy
- policy@Nullable java.lang.Long getLastModificationId()
boolean isPersonal()
@Nullable SBuild getAssociatedBuild()
@Nullable java.lang.Long getAssociatedBuildId()
@Nullable SQueuedBuild getQueuedBuild()
@Nullable Comment getBuildComment()
void setBuildComment(@NotNull User user, @Nullable java.lang.String comment)
user
- user who sets the commentcomment
- text of the commentboolean isLaterThan(@NotNull BuildPromotion promotion)
promotion
- promotion@NotNull java.util.Map<java.lang.String,java.lang.String> getCustomParameters()
@NotNull java.util.Map<java.lang.String,java.lang.String> getDefaultParameters()
@NotNull java.util.Map<java.lang.String,java.lang.String> getParameters()
ParametersPreprocessor
for more details.@Nullable java.lang.String getParameterValue(@NotNull java.lang.String paramName)
paramName
- parameter name@NotNull java.util.Map<java.lang.String,java.lang.String> getBuildParameters()
ParametersPreprocessor
for more details.boolean isEquivalentTo(@NotNull BuildPromotion promotion)
promotion
- build promotion@NotNull java.util.Collection<? extends BuildDependency> getDependencies()
@NotNull java.util.List<? extends BuildPromotion> getAllDependencies()
int getNumberOfDependencies()
@NotNull java.util.Collection<? extends BuildDependency> getDependedOnMe()
int getNumberOfDependedOnMe()
BuildPromotion[] findTops()
@Nullable SQueuedBuild addToQueue(@NotNull java.lang.String triggeredBy)
triggeredBy
- contains details about who triggered build, see also TriggeredByBuilder
@Nullable SQueuedBuild addToQueue(@NotNull SBuildAgent buildAgent, @NotNull java.lang.String triggeredBy)
buildAgent
- build agent where the build is to runtriggeredBy
- contains details about who triggered build, see also TriggeredByBuilder
@Nullable BuildPromotion getPreviousBuildPromotion(@NotNull SelectPrevBuildPolicy policy)
policy
- policyboolean isUsed()
BuildPromotion copy(boolean copyRevisions)
copyRevisions
- indicates whether to copy revisions associated with this promotion or notboolean isOutOfChangesSequence()
boolean isChangesDetached()
boolean isPartOfBuildChain()
boolean isCanceled()
boolean isFailedToCollectChanges()
@NotNull java.util.List<SArtifactDependency> getArtifactDependencies()
@NotNull java.util.Collection<SBuildAgent> getCanRunOnAgents(@NotNull java.util.Collection<SBuildAgent> available)
@NotNull java.util.Map<SBuildAgent,CompatibilityResult> getCompatibilityMap(@NotNull java.util.Collection<SBuildAgent> available)
@NotNull java.util.Collection<SBuildAgent> getCompatibleAgents(@NotNull java.util.Collection<SBuildAgent> available)
@Nullable Branch getBranch()
@NotNull BuildLog getBuildLog()
@NotNull java.io.File getArtifactsDirectory() throws BuildTypeNotFoundException
BuildTypeNotFoundException
- in some rare cases when path to the artifacts directory is not known to this build promotion and there is no build configuration anymore
so it is not possible to find this location without performing expensive disk scan operationsSBuildType.getArtifactsDirectory()
,
SBuild.getArtifactsDirectory()
void setTagDatas(@NotNull java.util.Collection<TagData> tags)
tags
- tagsTagDataUtil
,
for variety of tag-releated actions
@NotNull java.util.Collection<TagData> getTagDatas()
TagDataUtil
,
for variety of tag-releated actions
@NotNull java.util.List<java.lang.String> getPrivateTags(@NotNull SUser user)
void setPrivateTags(@Nullable java.util.List<java.lang.String> labels, @NotNull SUser user)
labels
- new tag labelsuser
- a particular user which tags should be updatedfor variety of tag-releated actions
@NotNull java.util.List<java.lang.String> getTags()
void setTags(java.util.List<java.lang.String> labels)
labels
- tag labelsfor variety of tag-releated actions
@Nullable java.util.Date getQueuedDate()
@Nullable java.util.Date getServerStartDate()
void setDesiredBranchName(@NotNull java.lang.String branchName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
boolean isCompositeBuild()
@NotNull java.lang.String getCreatorNodeId()