Package jetbrains.buildServer
Class MockBuildPromotion
- java.lang.Object
-
- jetbrains.buildServer.MockBuildPromotion
-
- All Implemented Interfaces:
Comparable<BuildPromotion>
,BuildPromotionInfo
,BuildPromotion
,BuildPromotionEx
,InternalParameters
,ReadOnlyUserParameters
public class MockBuildPromotion extends Object implements BuildPromotionEx
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildPromotionEx
BuildPromotionEx.ArtifactsState, BuildPromotionEx.ArtifactsStateInfo, BuildPromotionEx.CompatibilityCacheUpdateMode, BuildPromotionEx.PromotionPersistMode, BuildPromotionEx.UpdateReason
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.serverSide.BuildPromotion
NOT_EXISTING_BUILD_TYPE_ID
-
Fields inherited from interface jetbrains.buildServer.serverSide.BuildPromotionEx
MAIN_NODE_MARKER, MAX_BRANCH_NAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description MockBuildPromotion()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBuildProblem(BuildProblemData buildProblem)
Adds build problem, currently it actually causes build failurevoid
addDependedOnMe(BuildPromotionEx promoEx, DependencyOptions options)
Adds link to parent promotionvoid
addDependedOnMeIfCached(BuildPromotionEx promotion, DependencyOptions options)
Adds link to parent promotion only if depended on me list is already loaded from DB for this promotionvoid
addDependency(BuildPromotionEx promo, DependencyOptions options)
Adds a build dependencySQueuedBuild
addToQueue(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(SBuildAgent buildAgent, 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.boolean
allDependenciesFinished()
void
artifactsChanged(boolean scheduleUpdate)
Should be called when artifacts are changed on disk.void
associatedBuildFinished()
void
buildEvictedFromCache()
Called when finished build associated with this promotion is removed from the builds cache.void
buildFinished()
Must be called when build history entry created for this promotion.void
cancelCheckingForChanges()
void
clearPrevPromotionCache(Collection<BuildPromotion> targetPromos)
int
compareTo(BuildPromotion o)
boolean
containsChange(SVcsModification m)
Returns true if promotion contains specified modification among its changes.BuildPromotionEx
copy(boolean copyRevisions)
Creates copy of this build promotion (a copy will have different id).Predicate<BuildPromotion>
createBuildPromotionAccessChecker()
OrderedBuild
createOrderedBuild()
Returns an OrderedBuild with all fields filled.int
decreaseExpirationCounter(int decreaseAmount)
void
deleteBuildProblem(String identity)
Deletes build problem Deleting build problem may change build status to SUCCESSvoid
detachChanges()
Marks build as build with detached changes, i.e.void
ensureBuildLogFlushed()
Makes sure that messages in the build log buffer are flushed on disk.void
fillDetectedChanges(List<ChangeDescriptor> accumulator, ChangesCalculationOptionsEx options)
Computes changes according to the specified options and add them to the given accumulatorvoid
fillDetectedChanges(List<ChangeDescriptor> accumulator, SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges, VcsModificationProcessor callback)
BuildPromotionEx
findSelfOrDependencyWithProblem(Predicate<BuildProblemData> predicate)
Traverses build problems of the current build promotion and all of its dependencies using breadth first search and returns the first one for which the supplied predicate returns trueBuildPromotionEx[]
findTops()
Return a collection of top-level build promotions for sequence builds this build promotion participates in.void
freezeSettings()
Freeze buildType settings for this promotion.void
freezeSettings(File settings, String settingsOrigin)
Freeze settings for this promotion using the given settings file.void
freezeSettings(BuildTypeEx buildType, String settingsOrigin)
Freeze buildType settings for this promotion using the given buildType.void
freezeSettings(BuildTypeSettingsEx settings, String settingsOrigin)
Freeze settings for this promotion using the given buildSettings.void
freezeSettingsWithForcedPostprocessing(BuildTypeSettingsEx settings, String origin)
Freeze settings for this promotion using the given buildSettings and mark that postprocessing is still required for this promotion.String
generateAgentAccessCode()
Generates agent access code for communication with TeamCity during buildCompatibilityResult
getAgentCompatibility(AgentDescription agentDescription)
Map<SAgentType,CompatibilityResult>
getAgentTypeCompatibilityMap(Collection<SAgentType> available)
Returns map of agent types to compatibility result.List<? extends BuildPromotion>
getAllDependencies()
Returns the full list of snapshot dependencies (including transitive ones) of this build promotion filtered according to current user permissions.Map<VcsRootInstance,BuildRevisionEx>
getAllRevisionsMap()
Returns all vcs root revisions assciated with build, not only regular vcs roots attached to the build configurations.BuildPromotionEx
getAnchorBuildPromotion()
For the build promotion which runs in a virtual build configuration returns a build promotion which created it.List<SArtifactDependency>
getArtifactDependencies()
Returns collection of artifact dependencies to be sent to an agent.BuildArtifacts
getArtifacts(BuildArtifactsViewMode mode)
Returns artifacts of this build promotion.File
getArtifactsDirectory()
BuildPromotionEx.ArtifactsStateInfo
getArtifactStateInfo()
SBuild
getAssociatedBuild()
Returns running or finished build associated with this promotion or null if there is no such build.Long
getAssociatedBuildId()
Returns id of the build associated with this promotion, or null if there is no such build.Object
getAttribute(String attributeName)
Map<String,Object>
getAttributes()
AuditLog
getAuditLog()
List<AuditLogAction>
getAuditLogActions(AuditLogFilter filter)
String
getAutogeneratedBranchName()
Returns auto-generated branch name for the case if build promotion VCS roots differ from VCS roots in build configuration.Branch
getBranch()
List<BuildProblem>
getBuildChainProblems(boolean omitInduced)
If omitInduced is false, simply traverses all of the dependencies of this promotion and returns collection of all build problems (including this promotion own problems).Comment
getBuildComment()
Returns build comment assigned for this promotionCollection<SBuildFeatureDescriptor>
getBuildFeaturesOfType(String featureType)
Returns settings of the enabled build features of the specified type.List<Requirement>
getBuildFeaturesRequirements()
Returns requirements coming by build features, resolvedBuildLogEx
getBuildLog()
BuildLogEx
getBuildLogIfInitialized()
Map<String,String>
getBuildParameters()
Returns combined map of default and custom defined build parameters.List<BuildProblem>
getBuildProblems()
Returns all build problems for this promotion with extended information about muting.List<BuildPromotion>
getBuildPromotionsWithArtifactDependenciesOnMe(List<BuildPromotion> buildPromotions)
Checks artifact dependencies of the build promotions provided as an argument and returns those which have a direct artifact dependency (by build id) on this build promotion.BuildSettings
getBuildSettings()
Returns settings specified toBuildPromotionEx.freezeSettings(BuildTypeEx, String)
method or settings of this buildType this promotion belongs to ifBuildPromotionEx.freezeSettings(BuildTypeEx, String)
wasn't calledBuildTypeEx
getBuildType()
Returns build configuration to which this promotion corresponds.String
getBuildTypeExternalId()
Returns the external id of the associated build type.String
getBuildTypeId()
Returns internal id of build configuration to which this promotion corresponds, same asBuildPromotion.getBuildType()
.getBuildTypeId()Collection<SBuildAgent>
getCanRunOnAgents(Collection<SBuildAgent> available)
Returns collection of agents where this build promotion can be executed.Collection<SAgentType>
getCanRunOnAgentTypes(Collection<SAgentType> available)
Long
getChainModificationId()
Returns max modification id (max result of #getLastModificationId()) among this promotion all all its dependencies transitively.BuildChanges
getChanges(ChangesCalculationOptions options)
Returns build changes according to the specified optionsList<SVcsModification>
getChanges(SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
Returns changes containing in this promotion according to the specified policy.List<SVcsModification>
getChanges(SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild, VcsModificationProcessor callback)
String
getCheckoutDirectory()
String
getCollectChangesError()
UserSet<SUser>
getCommitters(SelectPrevBuildPolicy selectPrevBuildPolicy)
Returns committers of this build selected according to specified policySet<SUser>
getCommitters(SelectPrevBuildPolicy selectPrevBuildPolicy, int maxChangesToProcess)
Same asBuildPromotion.getCommitters(SelectPrevBuildPolicy)
but allows to control number of changes which should be looked up when committers are computed.Map<SBuildAgent,CompatibilityResult>
getCompatibilityMap(Collection<SBuildAgent> available)
Returns compatibility map for given set of agents.Collection<SBuildAgent>
getCompatibleAgents(Collection<SBuildAgent> available)
Returns compatible agents only, does not check that build configuration is allowed to be executed on the agentsCollection<SAgentType>
getCompatibleAgentTypes(Collection<SAgentType> available)
List<SVcsModification>
getContainingChanges()
Returns changes containing in this promotion.String
getCreatorNodeId()
List<SArtifactDependency>
getCustomArtifactDependencies()
Map<String,String>
getCustomParameters()
Returns map of user-defined build and configuration parameters associated with this build promotion.Collection<Parameter>
getCustomParametersCollection()
Returns a collection of user-defined build and configuration parameters associated with this build promotion.String
getDefaultCheckoutDirectory(BuildTypeDescriptor.CheckoutType checkoutType)
Returns name of the checkout directory that should be used for the build if explicit checkout directory is not specified.Map<String,String>
getDefaultParameters()
Returns map of default build and configuration parameters associated with this build promotion.Collection<BuildDependencyEx>
getDependedOnMe()
Returns snapshot dependencies of parent build promotions depending on this promotion.Collection<Long>
getDependedOnMeIds()
Collection<BuildDependencyEx>
getDependencies()
Returns the direct snapshot dependencies of this build promotion filtered according to current user permissions.Collection<Long>
getDependenciesIds()
DependenciesSupplier
getDependenciesSupplier()
Creates a dependencies supplier from the snapshot dependencies of this build promotion.BuildDependencyGraph
getDependencyGraph()
Returns dependency graph as if this build promotion is the top of the graph.List<BuildPromotionEx>
getDependentCompositePromotions()
Date
getDetachedFromAgentDate()
List<ChangeDescriptor>
getDetectedChanges(ChangesCalculationOptionsEx options)
Returns changes according to the specified optionsList<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy)
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges, VcsModificationProcessor callback)
List<BuildDetectedChangesProvider>
getDetectedChangesProviders(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)
Collection<BuildPromotionInfo>
getDirectDependencies()
Returns direct snapshot dependencies of this build promotionList<BuildPromotionEx>
getEquivalentPromotions(List<BuildPromotionEx> promotions)
Returns build promotions from the build queue equivalent to this build promotion (same settings, changes and revisions)int
getExecutionTimeoutMin()
Returns build execution timeout in minutes, 0 indicates that there is no limitList<BuildProblemData>
getFailureReasons()
Returns non-muted build problems for this promotion Note that this mathod may cause DB call, if you only require the fact if there are any failure reasons use hasFailureReasons which is guaranteed fastList<SArtifactDependency>
getFinalArtifactDependencies()
Boolean
getFreezeSettings()
Returns true if we should freeze settings if it is enabled in buildType, false if settings shouldn't be frozen, null - use buildType's defaultsFile
getFrozenSettingsFile()
long
getId()
Returns id of this promotion, promotion id is unique among all other build promotions and is not changed during promotion life cycle.String
getInternalBranchName()
Long
getLastModificationId()
Returns id of the last change associated with this promotion or null if changes collecting is not performed yet.LimitedChangesCollection
getLimitedChanges(SelectPrevBuildPolicy policy, int limit)
int
getMaximumNumberOfBuildsPerBranch()
int
getNumberOfDependedOnMe()
Returns total number of parent snapshot dependencies (without permissions filtering).int
getNumberOfDependencies()
Returns total number of snapshot dependencies (without permissions filtering).Map<VcsRootInstance,VcsRootInstance>
getOverridenVcsRoots()
Get overriden vcs root map in this promotion.List<SVcsModification>
getOwnChanges(ChangesCalculationOptions options)
Returns changes in this promotion computed according to specified options, doesn't include changes from dependencies.SUser
getOwner()
For personal builds returns owner of the build.TeamCityNode
getOwnerNode()
String
getOwnerNodeUrl()
Returns url of the node which processes this build messages.Parameter
getParameter(String paramName)
Map<String,String>
getParameters()
Returns combined map of default and custom parameters.Collection<Parameter>
getParametersCollection()
Returns build and configuration parameters in single collection.ParametersProvider
getParametersProvider()
Creates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.String
getParameterValue(String paramName)
BuildTypeEx
getParentBuildType()
Returns base build configuration to which this promotion corresponds, i.e.String
getParentBuildTypeId()
For non personal builds returns same asBuildPromotion.getBuildTypeId()
.Long
getPersonalChangeId()
Returns personal change id associated with this build promotion.List<SVcsModification>
getPersonalChanges()
Returns personal changes associated with this build promotion.List<ChangeDescriptor>
getPersonalChanges(List<ChangeDescriptor> allChanges)
Takes all changes and returns only those that belong to current owner of build promotion.BuildPromotion
getPreviousBuildPromotion(SelectPrevBuildPolicy policy)
Returns previous promotion created before this one and corresponding to the specified policy.Stream<OrderedBuild>
getPreviousBuilds(Filter<String> branchFilter)
Returns stream of previous builds matched by specified branch filter and ordered by changesOrderedBuild
getPreviousOrderedBuild(SelectPrevBuildPolicy policy)
Returns previous OrderedBuild instance which corresponds to a build promotion which is created before this one and corresponding to the specified policy.List<String>
getPrivateTags(SUser user)
Returns list of private tag labels in lexicographical order for particular user for this build promotionString
getProjectExternalId()
Returns the project external idString
getProjectId()
Returns the project internal id.List<String>
getProjectPathIds()
Returns project path of a project where this build promotion belongs.PromotionCustomizationInfo
getPromotionCustomization()
Returns promotion customization details, if any Build promotion can be customized by pressing ...Map<Long,RepositoryVersion>
getProvidedUpperLimitRevisions()
QueuedBuildEx
getQueuedBuild()
Returns queued build associated with this promotion or null if there is no such build in the queueDate
getQueuedDate()
Returns the date when the build was added to queue.SBuild
getRealOrDummyBuild()
List<Requirement>
getRequirements()
Returns requirements configured for this build promotion.List<BuildRevision>
getRevisions()
Returns VCS root revisions associated with this promotion.Map<VcsRootInstance,BuildRevision>
getRevisionsMap()
List<Requirement>
getRunnersRequirements(SBuildStepsCollection steps)
Returns requirements exposed by runners.SBuild
getSequenceBuild()
Date
getServerStartDate()
Returns the timestamp when the build was removed from the queue.byte[]
getSettingsDigest(boolean compute)
Returns digest of build promotion settings.VcsRootInstance
getSettingsVcsRootInstance()
List<BuildPromotionEx>
getStartedEquivalentPromotions(int maxNumToProcess)
Returns build promotions with associated builds and equivalent to this build promotion (same settings, changes and revisions)Collection<TagData>
getTagDatas()
Returns list of all tags for this build promotion, no special order is preservedList<String>
getTags()
Returns list of public tag labels in lexicographical order for the build promotionTopBuildDependencyGraph
getTopDependencyGraph()
Returns topmost dependency graphCollection<BuildProblem>
getUnsortedBuildProblems()
Same asBuildPromotionEx.getBuildProblems()
but returns problems in any order and can work faster because of that.Map<VcsRootInstance,BuildRevisionEx>
getUpperLimitRevisions()
Returns upper limit revisions which were available when checking for changes operation was performed.List<VcsRootInstanceEntry>
getVcsRootEntries()
Returns VCS root entries associated with this promotion.List<VcsRootInstanceEntry>
getVcsRootEntries(boolean includeSettingsRoot)
Returns entries for VCS roots associated with this promotion.String
getVersionedSettingsRevision(VcsRootInstance vcsRoot)
Returns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.boolean
hasArtifactDependencyOn(BuildPromotion dependencyBuild)
Checks if this promotion artifact-depends on the passed one.boolean
hasBuildFeatureOfType(String featureType)
Returns true if this build promotion has a build feature of the specified typeboolean
hasBuildProblemsOfType(String type)
boolean
hasComputedArtifactsState()
boolean
hasComputedChanges(SelectPrevBuildPolicy policy, VcsModificationProcessor callback)
boolean
hasCustomPatch()
boolean
hasDependencyOn(long id)
boolean
hasFailureReasons()
boolean
hasFrozenSettings()
boolean
hasFrozenSettingsFromVcs()
boolean
hasLoadedTags()
Returns true if promotion loaded information about tags from dbboolean
hasStartedParent()
Returns true if there exists started build which has reference to this promotionboolean
hasUnpublishedPromotionPersistingEvent()
void
initBuildProblems()
Init build problems from databaseboolean
isAgentLessBuild()
Does it build cannot be executed on any usual agent but only by some external proccess.boolean
isAssociatedBuildFinished()
boolean
isCanceled()
Return true if associated build is canceledboolean
isChangeCollectingNeeded()
Return true if change collection is required for this build promotion (otherwise, changes are collected already).boolean
isChangeCollectingNeeded(boolean checkDependencies)
boolean
isChangesCollectingInProgress()
boolean
isChangesDetached()
boolean
isCompositeBuild()
boolean
isDeleted()
boolean
isDetachedFromAgent()
boolean
isEquivalentTo(BuildPromotion promotion)
Returns true if this build promotion is equivalent to specified promotion, i.e.EquivalenceCheckResult
isEquivalentTo(BuildPromotion promoToCompare, Boolean compareBranches)
boolean
isFailedToCollectChanges()
boolean
isFinished()
boolean
isForcedPostprocessingOfFrozenSettings()
boolean
isIncomplete()
Returns whether the build promotion is incomplete (canceled).boolean
isLaterThan(BuildPromotion promotion)
Returns true if this promotion contains more recent changes comparing to the specified promotion.boolean
isMaximumNumberOfBuildsPerBranchLimited()
boolean
isOutOfChangesSequence()
Returns true if there is a build started before this build promotion associated build which contains more recent changes.boolean
isPartOfBuildChain()
boolean
isPersisted()
boolean
isPersonal()
Return true if this build promotion relates to personal buildboolean
isUsed()
Returns true if there is a reference to this build promotion from queued, running or history build.boolean
isVirtual()
void
lockDependenciesOptimizing()
void
markAsIncompleteIfHasFailedToStartProblems()
Marks build promotion as incomplete if it has failed to start build problemsvoid
markDeleted()
Mark this promotion as deleted in the database.void
markIncomplete()
Mark build promotion as incomplete (canceled)void
muteBuildProblems(boolean muteIfTrue, SUser user, String comment)
Makes all existing build problems enabled or disabledboolean
needToFreezeSettings()
boolean
occupiesLicenseSlot()
Returns true when this build promotion should occupy one of license slots, false otherwise.void
persist()
Persists state of the build promotionvoid
persist(BuildPromotionEx.PromotionPersistMode persistMode)
void
persistDependencies()
void
persistVcsRootEntries()
Persists information about VCS roots used by this build promotion to the database.void
removeDependedOnMe(BuildPromotion promoEx)
Removes link to parent promotionvoid
removeDependency(BuildPromotionEx promo)
Removes dependency on specified promotionvoid
replaceDependency(BuildPromotionEx origDependency, BuildPromotionEx newDependency, DependencyOptions newOptions)
Replaces dependency on one promotion with dependency to another promotionvoid
resetAgentsCompatibilityCache()
Resets promotion compatibility cache for all agents and agent typesvoid
resetAllCompatibilityCaches()
void
resetArtifactsState(boolean scheduleUpdate)
Resets current artifacts state in the build promotionvoid
resetBuildLog()
void
resetBuildRevisions()
void
resetBuildSettings()
Resets cached build settings associated with promotionvoid
resetChangesCache()
Resets cache of changes in this promotionvoid
resetDependenciesHardRefs()
Each newly created build promotion keeps a reference to its direct dependencies (BuildPromotion instances).void
resetDependentOnMeCache()
reset only dependent on this cache of the promotion.void
resetDirectDependenciesCache()
reset only direct dependencies cache of the promotion.void
resetIncompatibleAgentsCache(Predicate<CompatibilityResult> compatibilityPredicate)
void
resetIncompatibleAgentTypesCache(Predicate<CompatibilityResult> compatibilityPredicate)
void
resetLogActionsCache()
Reset cached audit logvoid
resetRequirementsCache()
void
resetTagsCache()
Reset cached tagsboolean
sameBranch(BuildPromotionEx promotion)
boolean
scheduleCheckingForChangesIfNeeded()
void
setArtifactsDirectory(File artifactsDir)
Sets new artifacts directory to this build promotion.void
setAssociatedBuild(SBuild build)
Associates new build to this build promotionvoid
setAttribute(String name, Object value)
Sets some attribute to the build promotionvoid
setBuildComment(User user, String comment)
Assigns the build comment for this promotionvoid
setBuildRevisions(Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId)
Same asBuildPromotionEx.setBuildRevisions(Collection, long, long, boolean)
with validateBranch parameter set to true.void
setBuildRevisions(Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId, boolean validateBranch)
Sets revisions and modificationId into this build promotion.void
setCustomArtifactDependencies(List<SArtifactDependency> dependencies)
Sets custom artifact dependencies, those which override default (specified in build configuration).void
setCustomParameters(Collection<Parameter> parameters)
Same as#setCustomParameters(List)
but acceptingParameter
instancesvoid
setCustomParameters(Map<String,String> buildParameters)
Sets custom parameters in build promotion.void
setDesiredBranchName(String branchName)
void
setExpirationCounter(int counter)
void
setFailedToCollectChanges(Throwable t)
void
setFinalArtifactDependencies(List<SArtifactDependency> dependencies)
Sets the final artifact dependencies, i.e.void
setFreezeSettings(Boolean freezeSettings)
Indicates if we should freeze settings in buildvoid
setOverridenVcsRoots(Map<VcsRootInstance,VcsRootInstance> overridenVcsRootIds)
Override default vcs roots for this promotion.void
setOwnerNodeUrl(String url)
Sets url of the node which processes this build messages.void
setPrivateTags(List<String> labels, SUser user)
Set private tags for particular user Attention! Replace all private tags related to the particular user with new setvoid
setProvidedUpperLimitRevisions(Map<Long,RepositoryVersion> upperLimitRevisions)
Sets custom/provided upper limit revisions which will be used during the checking for changes process instead of the current repository version.void
setQueuedAt(Date queuedAt)
void
setRemoveFromQueueDate(Date removeFromQueueDate)
void
setTagDatas(Collection<TagData> tags)
Changes tag set for this build promotion.void
setTags(List<String> labels)
Set public tags.void
setVersionedSettingsRevision(VcsRootInstance vcsRoot, String revision)
Remmebers versioned settings revision for the specified VCS root.void
traverseDependedOnMe(DependencyConsumer<BuildPromotionEx> processor)
Traverses all build promotions depending on this one transitively.void
traverseDependencies(DependencyConsumer<BuildPromotionEx> processor)
Traverses all build promotion dependencies (breadth first).void
traverseSelfAndDependedOnMe(DependencyConsumer<BuildPromotionEx> consumer)
void
traverseSelfAndDependencies(DependencyConsumer<BuildPromotionEx> consumer)
void
unlockDependenciesOptimizing()
void
updateAgentsCompatibilityCache(Collection<SBuildAgent> agents, BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)
void
updateDependenciesCache(Supplier<Map<Long,Integer>> newDependenciesSupplier)
Updates dependencies cache of the promotion and resets "dependent on me" cache of the supplied dependencies.void
updateFromDB(BuildPromotionEx.UpdateReason reason)
Updates promotion data from databasevoid
updateSelfAndDependenciesFromDB()
Updates the build promotion and all its dependencies from the databasevoid
updateStateFromBuildData(AbstractBuildData runningBuildData)
Quickly updates some information in build promotion from DB information.void
waitForChangesCollectingToFinish(long timeoutMillis)
If checking for changes is in progress, blocks for the specified timeout-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
-
-
-
Method Detail
-
compareTo
public int compareTo(BuildPromotion o)
- Specified by:
compareTo
in interfaceComparable<BuildPromotion>
-
getId
public long getId()
Description copied from interface:BuildPromotion
Returns id of this promotion, promotion id is unique among all other build promotions and is not changed during promotion life cycle.- Specified by:
getId
in interfaceBuildPromotion
- Specified by:
getId
in interfaceBuildPromotionInfo
- Returns:
- id of this build promotion
-
getDirectDependencies
public Collection<BuildPromotionInfo> getDirectDependencies()
Description copied from interface:BuildPromotionInfo
Returns direct snapshot dependencies of this build promotion- Specified by:
getDirectDependencies
in interfaceBuildPromotionInfo
- Returns:
- see above
-
getParentBuildType
public BuildTypeEx getParentBuildType()
Description copied from interface:BuildPromotion
Returns base build configuration to which this promotion corresponds, i.e. for personal builds returns parent build configuration, not the personal build type- Specified by:
getParentBuildType
in interfaceBuildPromotion
- Specified by:
getParentBuildType
in interfaceBuildPromotionEx
- Returns:
- see above
-
getBuildType
public BuildTypeEx getBuildType()
Description copied from interface:BuildPromotion
Returns build configuration to which this promotion corresponds. If promotion is for personal build, returns RemoteBuildType.If the correspondent build configuration is deleted - returns null.
- Specified by:
getBuildType
in interfaceBuildPromotion
- Specified by:
getBuildType
in interfaceBuildPromotionEx
- Returns:
- the correspondent build configuration or null if that was deleted.
-
setOverridenVcsRoots
public void setOverridenVcsRoots(@NotNull Map<VcsRootInstance,VcsRootInstance> overridenVcsRootIds)
Description copied from interface:BuildPromotionEx
Override default vcs roots for this promotion.- Specified by:
setOverridenVcsRoots
in interfaceBuildPromotionEx
- Parameters:
overridenVcsRootIds
- map from original vcs root id to substitution root id
-
getOverridenVcsRoots
@NotNull public Map<VcsRootInstance,VcsRootInstance> getOverridenVcsRoots()
Description copied from interface:BuildPromotionEx
Get overriden vcs root map in this promotion.- Specified by:
getOverridenVcsRoots
in interfaceBuildPromotionEx
- Returns:
- map from original vcs root id to substitution root id
-
setAttribute
public void setAttribute(@NotNull String name, @Nullable Object value)
Description copied from interface:BuildPromotionEx
Sets some attribute to the build promotion- Specified by:
setAttribute
in interfaceBuildPromotionEx
- Parameters:
name
- attribute namevalue
- attribute value
-
getAttributes
@NotNull public Map<String,Object> getAttributes()
- Specified by:
getAttributes
in interfaceBuildPromotionEx
- Returns:
- map of arbitrary options associated with this promotion.
-
getAttribute
@Nullable public Object getAttribute(@NotNull String attributeName)
- Specified by:
getAttribute
in interfaceBuildPromotionEx
-
detachChanges
public void detachChanges()
Description copied from interface:BuildPromotionEx
Marks build as build with detached changes, i.e. changes of this build will be shown in the next build too.- Specified by:
detachChanges
in interfaceBuildPromotionEx
-
resetAgentsCompatibilityCache
public void resetAgentsCompatibilityCache()
Description copied from interface:BuildPromotionEx
Resets promotion compatibility cache for all agents and agent types- Specified by:
resetAgentsCompatibilityCache
in interfaceBuildPromotionEx
-
updateAgentsCompatibilityCache
public void updateAgentsCompatibilityCache(@NotNull Collection<SBuildAgent> agents, @NotNull BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)
- Specified by:
updateAgentsCompatibilityCache
in interfaceBuildPromotionEx
-
resetIncompatibleAgentsCache
public void resetIncompatibleAgentsCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)
- Specified by:
resetIncompatibleAgentsCache
in interfaceBuildPromotionEx
-
resetRequirementsCache
public void resetRequirementsCache()
- Specified by:
resetRequirementsCache
in interfaceBuildPromotionEx
-
resetAllCompatibilityCaches
public void resetAllCompatibilityCaches()
- Specified by:
resetAllCompatibilityCaches
in interfaceBuildPromotionEx
-
resetIncompatibleAgentTypesCache
public void resetIncompatibleAgentTypesCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)
- Specified by:
resetIncompatibleAgentTypesCache
in interfaceBuildPromotionEx
-
isChangesDetached
public boolean isChangesDetached()
- Specified by:
isChangesDetached
in interfaceBuildPromotion
- Returns:
- true if changes are detached from this promotion, i.e. next build will have all of the changes included in this promotion.
-
getProjectId
public String getProjectId()
Description copied from interface:BuildPromotion
Returns the project internal id.- Specified by:
getProjectId
in interfaceBuildPromotion
- Returns:
- project internal id
-
getProjectExternalId
public String getProjectExternalId()
Description copied from interface:BuildPromotion
Returns the project external id- Specified by:
getProjectExternalId
in interfaceBuildPromotion
- Returns:
- project external id
-
getOwner
public SUser getOwner()
Description copied from interface:BuildPromotion
For personal builds returns owner of the build. For non personal builds returns null.- Specified by:
getOwner
in interfaceBuildPromotion
- Returns:
- see above
-
getBuildTypeId
@NotNull public String getBuildTypeId()
Description copied from interface:BuildPromotion
Returns internal id of build configuration to which this promotion corresponds, same asBuildPromotion.getBuildType()
.getBuildTypeId()- Specified by:
getBuildTypeId
in interfaceBuildPromotion
- Returns:
- id of build configuration
-
getBuildTypeExternalId
@NotNull public String getBuildTypeExternalId()
Description copied from interface:BuildPromotion
Returns the external id of the associated build type. In case of the personal build - it is the identifier of the real build configuration (as for a regular build), without suffixes.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
BuildPromotion.NOT_EXISTING_BUILD_TYPE_ID
value is returned.- Specified by:
getBuildTypeExternalId
in interfaceBuildPromotion
- Returns:
- the external identifier of the associated build type.
-
getParentBuildTypeId
@NotNull public String getParentBuildTypeId()
Description copied from interface:BuildPromotion
For non personal builds returns same asBuildPromotion.getBuildTypeId()
. For personal builds returns id of parent build configuration: getParentBuildType().getBuildTypeId()- Specified by:
getParentBuildTypeId
in interfaceBuildPromotion
- Returns:
- see above
-
getRevisions
@NotNull public List<BuildRevision> getRevisions()
Description copied from interface:BuildPromotion
Returns VCS root revisions associated with this promotion.- Specified by:
getRevisions
in interfaceBuildPromotion
- Returns:
- VCS root revisions
-
getRevisionsMap
@NotNull public Map<VcsRootInstance,BuildRevision> getRevisionsMap()
- Specified by:
getRevisionsMap
in interfaceBuildPromotionEx
-
getAllRevisionsMap
@NotNull public Map<VcsRootInstance,BuildRevisionEx> getAllRevisionsMap()
Description copied from interface:BuildPromotionEx
Returns all vcs root revisions assciated with build, not only regular vcs roots attached to the build configurations.- Specified by:
getAllRevisionsMap
in interfaceBuildPromotionEx
- Returns:
- see above
-
getUpperLimitRevisions
@NotNull public Map<VcsRootInstance,BuildRevisionEx> getUpperLimitRevisions()
Description copied from interface:BuildPromotionEx
Returns upper limit revisions which were available when checking for changes operation was performed. Upper limit revision is a revision returned byVcsRootInstance.getCurrentRevision()
method at the moment when checking for changes was performed.- Specified by:
getUpperLimitRevisions
in interfaceBuildPromotionEx
-
getInternalBranchName
@NotNull public String getInternalBranchName()
- Specified by:
getInternalBranchName
in interfaceBuildPromotionEx
- Returns:
- internal branch name associated with build promotion. If build promotion belongs to default branch or is not branched, returns empty string.
-
getAutogeneratedBranchName
@Nullable public String getAutogeneratedBranchName()
Description copied from interface:BuildPromotionEx
Returns auto-generated branch name for the case if build promotion VCS roots differ from VCS roots in build configuration. The auto-generated name will have diff of changed settings.- Specified by:
getAutogeneratedBranchName
in interfaceBuildPromotionEx
- Returns:
- auto-generated name or null if settings do not differ
-
sameBranch
public boolean sameBranch(@NotNull BuildPromotionEx promotion)
- Specified by:
sameBranch
in interfaceBuildPromotionEx
- Returns:
- true if this promotion is from the same branch as promotion specified in parameter.
-
resetChangesCache
public void resetChangesCache()
Description copied from interface:BuildPromotionEx
Resets cache of changes in this promotion- Specified by:
resetChangesCache
in interfaceBuildPromotionEx
-
getAuditLogActions
@NotNull public List<AuditLogAction> getAuditLogActions(@Nullable AuditLogFilter filter)
- Specified by:
getAuditLogActions
in interfaceBuildPromotionEx
- Parameters:
filter
- if not null the filter is applied to the returned set of objects- Returns:
- audit log actions associated with this promotion
-
getAuditLog
@NotNull public AuditLog getAuditLog()
- Specified by:
getAuditLog
in interfaceBuildPromotionEx
- Returns:
- audit log which can be used to log user actions for this build promotion
-
resetLogActionsCache
public void resetLogActionsCache()
Description copied from interface:BuildPromotionEx
Reset cached audit log- Specified by:
resetLogActionsCache
in interfaceBuildPromotionEx
-
resetTagsCache
public void resetTagsCache()
Description copied from interface:BuildPromotionEx
Reset cached tags- Specified by:
resetTagsCache
in interfaceBuildPromotionEx
-
getAgentCompatibility
@NotNull public CompatibilityResult getAgentCompatibility(@NotNull AgentDescription agentDescription)
- Specified by:
getAgentCompatibility
in interfaceBuildPromotionEx
- Parameters:
agentDescription
- agent or agent type- Returns:
- compatibility of this build promotion with specified agent description (agent or agent type)
-
getBuildSettings
@NotNull public BuildSettings getBuildSettings()
Description copied from interface:BuildPromotionEx
Returns settings specified toBuildPromotionEx.freezeSettings(BuildTypeEx, String)
method or settings of this buildType this promotion belongs to ifBuildPromotionEx.freezeSettings(BuildTypeEx, String)
wasn't called- Specified by:
getBuildSettings
in interfaceBuildPromotion
- Specified by:
getBuildSettings
in interfaceBuildPromotionEx
-
updateDependenciesCache
public void updateDependenciesCache(@NotNull Supplier<Map<Long,Integer>> newDependenciesSupplier)
Description copied from interface:BuildPromotionEx
Updates dependencies cache of the promotion and resets "dependent on me" cache of the supplied dependencies.- Specified by:
updateDependenciesCache
in interfaceBuildPromotionEx
-
getVcsRootEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootEntries()
Description copied from interface:BuildPromotion
Returns VCS root entries associated with this promotion.- Specified by:
getVcsRootEntries
in interfaceBuildPromotion
- Returns:
- VCS root entries
-
getVcsRootEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootEntries(boolean includeSettingsRoot)
Description copied from interface:BuildPromotionEx
Returns entries for VCS roots associated with this promotion. If promotion has an implicit settings root (not attached to buildType) andincludeSettingsRoot
istrue
, then an entry for this settings root is included in the result.- Specified by:
getVcsRootEntries
in interfaceBuildPromotionEx
- Parameters:
includeSettingsRoot
- whether settings root should be included in result- Returns:
- see above
- See Also:
BuildTypeEx.getVcsRootInstanceEntries(boolean)
-
getRequirements
@NotNull public List<Requirement> getRequirements()
Description copied from interface:BuildPromotionEx
Returns requirements configured for this build promotion. If a requirement has a parameter reference in it's settings, this parameter reference will be resolved according to current promotion settings. Only enabled requirements are returned by this method.- Specified by:
getRequirements
in interfaceBuildPromotionEx
- Returns:
- see above
-
getRunnersRequirements
@NotNull public List<Requirement> getRunnersRequirements(@NotNull SBuildStepsCollection steps)
Description copied from interface:BuildPromotionEx
Returns requirements exposed by runners.- Specified by:
getRunnersRequirements
in interfaceBuildPromotionEx
- Returns:
-
getBuildFeaturesRequirements
@NotNull public List<Requirement> getBuildFeaturesRequirements()
Description copied from interface:BuildPromotionEx
Returns requirements coming by build features, resolved- Specified by:
getBuildFeaturesRequirements
in interfaceBuildPromotionEx
- Returns:
- see above
-
getContainingChanges
@NotNull public List<SVcsModification> getContainingChanges()
Description copied from interface:BuildPromotion
Returns changes containing in this promotion. Result is the same as for BuildPromotionEx#getDetectedChanges((SelectPrevBuildPolicy.SINCE_LAST_BUILD, false).stream() .map(ChangeDescriptor::getRelatedVcsChange).filter(Objects::nonNull).collect(Collectors.toList()); Ordering: last detected modifications goes first in the list- Specified by:
getContainingChanges
in interfaceBuildPromotion
- Returns:
- see above
-
getPersonalChanges
@NotNull public List<SVcsModification> getPersonalChanges()
Description copied from interface:BuildPromotion
Returns personal changes associated with this build promotion. If promotion is not personal (isPersonal == false), returns empty collection.- Specified by:
getPersonalChanges
in interfaceBuildPromotion
- Returns:
- see above
-
getChanges
@NotNull public List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
Description copied from interface:BuildPromotion
Returns changes containing in this promotion according to the specified policy. Ordering: last detected modifications goes first in the list- Specified by:
getChanges
in interfaceBuildPromotion
- Parameters:
policy
- policyreturnChangesIfNoPreviousBuild
- whether to return changes if there is no previous build in the history.- Returns:
- see above
-
getChanges
@NotNull public List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild, @NotNull VcsModificationProcessor callback)
- Specified by:
getChanges
in interfaceBuildPromotionEx
-
getLimitedChanges
@NotNull public LimitedChangesCollection getLimitedChanges(@NotNull SelectPrevBuildPolicy policy, int limit)
- Specified by:
getLimitedChanges
in interfaceBuildPromotionEx
-
resetDirectDependenciesCache
public void resetDirectDependenciesCache()
Description copied from interface:BuildPromotionEx
reset only direct dependencies cache of the promotion.- Specified by:
resetDirectDependenciesCache
in interfaceBuildPromotionEx
-
resetDependentOnMeCache
public void resetDependentOnMeCache()
Description copied from interface:BuildPromotionEx
reset only dependent on this cache of the promotion.- Specified by:
resetDependentOnMeCache
in interfaceBuildPromotionEx
-
ensureBuildLogFlushed
public void ensureBuildLogFlushed()
Description copied from interface:BuildPromotionEx
Makes sure that messages in the build log buffer are flushed on disk.- Specified by:
ensureBuildLogFlushed
in interfaceBuildPromotionEx
-
generateAgentAccessCode
public String generateAgentAccessCode()
Description copied from interface:BuildPromotionEx
Generates agent access code for communication with TeamCity during build- Specified by:
generateAgentAccessCode
in interfaceBuildPromotionEx
-
setProvidedUpperLimitRevisions
public void setProvidedUpperLimitRevisions(@NotNull Map<Long,RepositoryVersion> upperLimitRevisions)
Description copied from interface:BuildPromotionEx
Sets custom/provided upper limit revisions which will be used during the checking for changes process instead of the current repository version.- Specified by:
setProvidedUpperLimitRevisions
in interfaceBuildPromotionEx
- Parameters:
upperLimitRevisions
- map of VCS root instance id to revision object, vcs root instance can belong to the current build or its dependencies
-
getProvidedUpperLimitRevisions
@NotNull public Map<Long,RepositoryVersion> getProvidedUpperLimitRevisions()
- Specified by:
getProvidedUpperLimitRevisions
in interfaceBuildPromotionEx
- Returns:
- map of provided upper limit revisions for the checking for changes process
-
getVersionedSettingsRevision
@Nullable public String getVersionedSettingsRevision(@NotNull VcsRootInstance vcsRoot)
Description copied from interface:BuildPromotionEx
Returns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.- Specified by:
getVersionedSettingsRevision
in interfaceBuildPromotionEx
- Returns:
- see above
-
setVersionedSettingsRevision
public void setVersionedSettingsRevision(@NotNull VcsRootInstance vcsRoot, @NotNull String revision)
Description copied from interface:BuildPromotionEx
Remmebers versioned settings revision for the specified VCS root. Note: persist must be called explicitly for the information to be saved into the database. See alsoBuildPromotionEx.getVersionedSettingsRevision(VcsRootInstance)
.- Specified by:
setVersionedSettingsRevision
in interfaceBuildPromotionEx
-
getAnchorBuildPromotion
@Nullable public BuildPromotionEx getAnchorBuildPromotion()
Description copied from interface:BuildPromotionEx
For the build promotion which runs in a virtual build configuration returns a build promotion which created it. The anchor build promotion is visible to the user and collects all the results of the virtual build promotions.- Specified by:
getAnchorBuildPromotion
in interfaceBuildPromotionEx
- Returns:
- see above
-
isVirtual
public boolean isVirtual()
- Specified by:
isVirtual
in interfaceBuildPromotionEx
- Returns:
- true if the build promotion is running in a virtual build configuration
-
occupiesLicenseSlot
public boolean occupiesLicenseSlot()
Description copied from interface:BuildPromotionEx
Returns true when this build promotion should occupy one of license slots, false otherwise. Currently, the number of license slots is equal to the max number of authorized agents.- Specified by:
occupiesLicenseSlot
in interfaceBuildPromotionEx
- Returns:
- see above
- See Also:
LicensingPolicy.getMaxNumberOfAuthorizedAgents()
-
resetDependenciesHardRefs
public void resetDependenciesHardRefs()
Description copied from interface:BuildPromotionEx
Each newly created build promotion keeps a reference to its direct dependencies (BuildPromotion instances). These references are kept to avoid removal of them by GC. Once these dependencies are persisted to DB, these hard refs are no longer required. At this point this method should be called to free some memory.- Specified by:
resetDependenciesHardRefs
in interfaceBuildPromotionEx
-
getSettingsDigest
@NotNull public byte[] getSettingsDigest(boolean compute)
Description copied from interface:BuildPromotionEx
Returns digest of build promotion settings. If build promotion has build, then digest will be taken from the build artifacts. If there is no digest in artifacts, it will be computed by current settings if compute is set to true. Digest is always computed if build promotion does not have build associated. Returns empty array if digest cannot be computed or build does not have digest and compute is set to false- Specified by:
getSettingsDigest
in interfaceBuildPromotionEx
- Parameters:
compute
- if true and build promotion has build without digest, then digest will be calculated
-
getArtifactStateInfo
@NotNull public BuildPromotionEx.ArtifactsStateInfo getArtifactStateInfo()
- Specified by:
getArtifactStateInfo
in interfaceBuildPromotionEx
- Returns:
- state of the artifacts directory of this build promotion.
-
hasComputedArtifactsState
public boolean hasComputedArtifactsState()
- Specified by:
hasComputedArtifactsState
in interfaceBuildPromotionEx
-
getArtifacts
@NotNull public BuildArtifacts getArtifacts(@NotNull BuildArtifactsViewMode mode)
Description copied from interface:BuildPromotionEx
Returns artifacts of this build promotion.- Specified by:
getArtifacts
in interfaceBuildPromotionEx
- Parameters:
mode
- artifacts view mode- Returns:
- object describing artifacts of this build promotion.
-
artifactsChanged
public void artifactsChanged(boolean scheduleUpdate)
Description copied from interface:BuildPromotionEx
Should be called when artifacts are changed on disk.- Specified by:
artifactsChanged
in interfaceBuildPromotionEx
- Parameters:
scheduleUpdate
- if true, a task should be scheduled to update artifacts state
-
hasUnpublishedPromotionPersistingEvent
public boolean hasUnpublishedPromotionPersistingEvent()
- Specified by:
hasUnpublishedPromotionPersistingEvent
in interfaceBuildPromotionEx
- Returns:
- true if "promotion persisted" event for this build promotion is not yet stored in DB
-
resetArtifactsState
public void resetArtifactsState(boolean scheduleUpdate)
Description copied from interface:BuildPromotionEx
Resets current artifacts state in the build promotion- Specified by:
resetArtifactsState
in interfaceBuildPromotionEx
- Parameters:
scheduleUpdate
- if true, a task should be scheduled to update artifacts state, otherwise state will be calculated whenBuildPromotionEx.getArtifactStateInfo()
is called
-
getCommitters
public UserSet<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy)
Description copied from interface:BuildPromotion
Returns committers of this build selected according to specified policy- Specified by:
getCommitters
in interfaceBuildPromotion
- Parameters:
selectPrevBuildPolicy
- policy- Returns:
- see above
-
getLastModificationId
public Long getLastModificationId()
Description copied from interface:BuildPromotion
Returns id of the last change associated with this promotion or null if changes collecting is not performed yet. Returns -1 if changes collecting is performed but there were no changes detected and there were no changes in the build configuration since its creation.- Specified by:
getLastModificationId
in interfaceBuildPromotion
- Returns:
- see above
-
getChainModificationId
@Nullable public Long getChainModificationId()
Description copied from interface:BuildPromotionEx
Returns max modification id (max result of #getLastModificationId()) among this promotion all all its dependencies transitively. Returns null if changes are not collected for this promotion yet or if this is an old promotion created before the chain modification id was introduced. Returns -1 if changes collecting was performed but there were no changes detected and there were no changes in this build configuration and its dependencies since their creation.- Specified by:
getChainModificationId
in interfaceBuildPromotionEx
- Returns:
- see above
-
isPersonal
public boolean isPersonal()
Description copied from interface:BuildPromotion
Return true if this build promotion relates to personal build- Specified by:
isPersonal
in interfaceBuildPromotion
- Returns:
- see above
-
getPersonalChangeId
public Long getPersonalChangeId()
Description copied from interface:BuildPromotionEx
Returns personal change id associated with this build promotion. If promotion is not personal (isPersonal == false), returns null.- Specified by:
getPersonalChangeId
in interfaceBuildPromotionEx
- Returns:
- see above
-
hasCustomPatch
public boolean hasCustomPatch()
- Specified by:
hasCustomPatch
in interfaceBuildPromotionEx
- Returns:
- true if this build promotion has a custom patch associated with it which should be applied when build starts on an agent
-
getCustomParametersCollection
@NotNull public Collection<Parameter> getCustomParametersCollection()
Description copied from interface:BuildPromotionEx
Returns a collection of user-defined build and configuration parameters associated with this build promotion.- Specified by:
getCustomParametersCollection
in interfaceBuildPromotionEx
- Returns:
- see above
-
getAssociatedBuild
public SBuild getAssociatedBuild()
Description copied from interface:BuildPromotion
Returns running or finished build associated with this promotion or null if there is no such build.- Specified by:
getAssociatedBuild
in interfaceBuildPromotion
- Returns:
- see above
-
getArtifactsDirectory
@NotNull public File getArtifactsDirectory()
- Specified by:
getArtifactsDirectory
in interfaceBuildPromotion
- Returns:
- Artifacts directory for given build promotion
- See Also:
SBuildType.getArtifactsDirectory()
,SBuild.getArtifactsDirectory()
-
setTagDatas
public void setTagDatas(@NotNull Collection<TagData> tags)
Description copied from interface:BuildPromotion
Changes tag set for this build promotion. Attention! The whole set of tags will be replaced with new one. It means that even if new set contains only public tag the action will affect private tags as well.- Specified by:
setTagDatas
in interfaceBuildPromotion
- Parameters:
tags
- tags- See Also:
TagDataUtil
,for variety of tag-releated actions
-
getAssociatedBuildId
public Long getAssociatedBuildId()
Description copied from interface:BuildPromotion
Returns id of the build associated with this promotion, or null if there is no such build.- Specified by:
getAssociatedBuildId
in interfaceBuildPromotion
- Returns:
- see above
-
getQueuedBuild
public QueuedBuildEx getQueuedBuild()
Description copied from interface:BuildPromotion
Returns queued build associated with this promotion or null if there is no such build in the queue- Specified by:
getQueuedBuild
in interfaceBuildPromotion
- Specified by:
getQueuedBuild
in interfaceBuildPromotionEx
- Returns:
- see above
-
getCollectChangesError
public String getCollectChangesError()
- Specified by:
getCollectChangesError
in interfaceBuildPromotionEx
-
isFailedToCollectChanges
public boolean isFailedToCollectChanges()
- Specified by:
isFailedToCollectChanges
in interfaceBuildPromotion
- Returns:
- true if process of changes collecting failed for this build
-
getBuildComment
public Comment getBuildComment()
Description copied from interface:BuildPromotion
Returns build comment assigned for this promotion- Specified by:
getBuildComment
in interfaceBuildPromotion
- Returns:
- build comment
-
setBuildComment
public void setBuildComment(@NotNull User user, @Nullable String comment)
Description copied from interface:BuildPromotion
Assigns the build comment for this promotion- Specified by:
setBuildComment
in interfaceBuildPromotion
- Parameters:
user
- user who sets the commentcomment
- text of the comment
-
setFailedToCollectChanges
public void setFailedToCollectChanges(@Nullable Throwable t)
- Specified by:
setFailedToCollectChanges
in interfaceBuildPromotionEx
-
setFinalArtifactDependencies
public void setFinalArtifactDependencies(@NotNull List<SArtifactDependency> dependencies)
Description copied from interface:BuildPromotionEx
Sets the final artifact dependencies, i.e. those which must be sent to an agent.- Specified by:
setFinalArtifactDependencies
in interfaceBuildPromotionEx
- Parameters:
dependencies
- the artifact dependencies
-
setCustomArtifactDependencies
public void setCustomArtifactDependencies(@NotNull List<SArtifactDependency> dependencies) throws IllegalArgumentException
Description copied from interface:BuildPromotionEx
Sets custom artifact dependencies, those which override default (specified in build configuration). Custom artifact dependencies will override default completely. If list is empty, it will reset custom artifact dependencies.- Specified by:
setCustomArtifactDependencies
in interfaceBuildPromotionEx
- Parameters:
dependencies
- custom dependencies- Throws:
IllegalArgumentException
-
getCustomArtifactDependencies
@NotNull public List<SArtifactDependency> getCustomArtifactDependencies()
- Specified by:
getCustomArtifactDependencies
in interfaceBuildPromotionEx
-
getFinalArtifactDependencies
@NotNull public List<SArtifactDependency> getFinalArtifactDependencies()
- Specified by:
getFinalArtifactDependencies
in interfaceBuildPromotionEx
-
isIncomplete
public boolean isIncomplete()
Description copied from interface:BuildPromotionEx
Returns whether the build promotion is incomplete (canceled). Method is efficient enough, can be called often.- Specified by:
isIncomplete
in interfaceBuildPromotionEx
- Returns:
- true iff is incomplete
-
isLaterThan
public boolean isLaterThan(@NotNull BuildPromotion promotion)
Description copied from interface:BuildPromotion
Returns true if this promotion contains more recent changes comparing to the specified promotion.- Specified by:
isLaterThan
in interfaceBuildPromotion
- Parameters:
promotion
- promotion- Returns:
- see above
-
getCustomParameters
@NotNull public Map<String,String> getCustomParameters()
Description copied from interface:BuildPromotion
Returns map of user-defined build and configuration parameters associated with this build promotion.- Specified by:
getCustomParameters
in interfaceBuildPromotion
- Returns:
- see above
-
getDefaultParameters
@NotNull public Map<String,String> getDefaultParameters()
Description copied from interface:BuildPromotion
Returns map of default build and configuration parameters associated with this build promotion. Default parameters are taken from the build configuration when build promotion is created.- Specified by:
getDefaultParameters
in interfaceBuildPromotion
- Returns:
- see above
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:BuildPromotion
Returns combined map of default and custom parameters. Combined map contains both build and configuration parameters. Custom parameters take precedence over default parameters. Note that parameters returned by this method can be modified before they are passed to agent, seeParametersPreprocessor
for more details.- Specified by:
getParameters
in interfaceBuildPromotion
- Specified by:
getParameters
in interfaceBuildPromotionInfo
- Specified by:
getParameters
in interfaceReadOnlyUserParameters
- Returns:
- see above
-
getParameterValue
@Nullable public String getParameterValue(@NotNull String paramName)
- Specified by:
getParameterValue
in interfaceBuildPromotion
- Specified by:
getParameterValue
in interfaceReadOnlyUserParameters
- Parameters:
paramName
- parameter name- Returns:
- value of the parameter with given name or null if there is no such parameter
-
getParametersCollection
@NotNull public Collection<Parameter> getParametersCollection()
Description copied from interface:ReadOnlyUserParameters
Returns build and configuration parameters in single collection.- Specified by:
getParametersCollection
in interfaceReadOnlyUserParameters
- Returns:
- see above
-
getParameter
@Nullable public Parameter getParameter(@NotNull String paramName)
- Specified by:
getParameter
in interfaceReadOnlyUserParameters
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:BuildPromotionEx
Creates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.- Specified by:
getParametersProvider
in interfaceBuildPromotionEx
-
getBuildParameters
@NotNull public Map<String,String> getBuildParameters()
Description copied from interface:BuildPromotion
Returns combined map of default and custom defined build parameters. Custom build parameters takes precedence over default parameters. Note that parameters returned by this method can be modified before they are passed to agent, seeParametersPreprocessor
for more details.- Specified by:
getBuildParameters
in interfaceBuildPromotion
- Specified by:
getBuildParameters
in interfaceBuildPromotionInfo
- Returns:
- see above
-
getCanRunOnAgents
@NotNull public Collection<SBuildAgent> getCanRunOnAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns collection of agents where this build promotion can be executed. Returned agents are compatible with this build promotion, and build promotion build configuration is allowed to be executed on these agents.- Specified by:
getCanRunOnAgents
in interfaceBuildPromotion
- Specified by:
getCanRunOnAgents
in interfaceBuildPromotionInfo
- Returns:
- see above
-
getCompatibilityMap
@NotNull public Map<SBuildAgent,CompatibilityResult> getCompatibilityMap(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns compatibility map for given set of agents. Note: can return empty map if the current build promotion is marked for deletion or its build configuration no longer exists.- Specified by:
getCompatibilityMap
in interfaceBuildPromotion
- Returns:
- see above
-
getCompatibleAgents
@NotNull public Collection<SBuildAgent> getCompatibleAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns compatible agents only, does not check that build configuration is allowed to be executed on the agents- Specified by:
getCompatibleAgents
in interfaceBuildPromotion
- Returns:
- see above
-
getBranch
@Nullable public Branch getBranch()
- Specified by:
getBranch
in interfaceBuildPromotion
- Returns:
- branch associated with this build promotion if it exists and null otherwise.
-
isEquivalentTo
public boolean isEquivalentTo(@NotNull BuildPromotion promotion)
Description copied from interface:BuildPromotion
Returns true if this build promotion is equivalent to specified promotion, i.e. it corresponds to the same build configuration, contains same revisions and build parameters.- Specified by:
isEquivalentTo
in interfaceBuildPromotion
- Parameters:
promotion
- build promotion- Returns:
- see above
-
getDependencies
@NotNull public Collection<BuildDependencyEx> getDependencies()
Description copied from interface:BuildPromotion
Returns the direct snapshot dependencies of this build promotion filtered according to current user permissions.- Specified by:
getDependencies
in interfaceBuildPromotion
- Specified by:
getDependencies
in interfaceBuildPromotionEx
- Returns:
- see above
-
getDependedOnMeIds
@NotNull public Collection<Long> getDependedOnMeIds()
- Specified by:
getDependedOnMeIds
in interfaceBuildPromotionEx
-
getDependenciesIds
@NotNull public Collection<Long> getDependenciesIds()
- Specified by:
getDependenciesIds
in interfaceBuildPromotionEx
-
hasDependencyOn
public boolean hasDependencyOn(long id)
- Specified by:
hasDependencyOn
in interfaceBuildPromotionEx
-
getAllDependencies
@NotNull public List<? extends BuildPromotion> getAllDependencies()
Description copied from interface:BuildPromotion
Returns the full list of snapshot dependencies (including transitive ones) of this build promotion filtered according to current user permissions. Dependencies are returned "bottom-up", i.e. direct dependencies go to the end of the list.- Specified by:
getAllDependencies
in interfaceBuildPromotion
- Returns:
- see above
-
getNumberOfDependencies
public int getNumberOfDependencies()
Description copied from interface:BuildPromotion
Returns total number of snapshot dependencies (without permissions filtering).- Specified by:
getNumberOfDependencies
in interfaceBuildPromotion
- Returns:
- see above
-
getDependedOnMe
@NotNull public Collection<BuildDependencyEx> getDependedOnMe()
Description copied from interface:BuildPromotion
Returns snapshot dependencies of parent build promotions depending on this promotion. Parent build promotions are filtered according to current user permissions.- Specified by:
getDependedOnMe
in interfaceBuildPromotion
- Specified by:
getDependedOnMe
in interfaceBuildPromotionEx
- Returns:
- see above
-
getDependencyGraph
@NotNull public BuildDependencyGraph getDependencyGraph()
Description copied from interface:BuildPromotionEx
Returns dependency graph as if this build promotion is the top of the graph. See alsoBuildPromotionEx.findTops()
- Specified by:
getDependencyGraph
in interfaceBuildPromotionEx
- Returns:
- graph with this promotion at the top
-
getTopDependencyGraph
@NotNull public TopBuildDependencyGraph getTopDependencyGraph()
Description copied from interface:BuildPromotionEx
Returns topmost dependency graph- Specified by:
getTopDependencyGraph
in interfaceBuildPromotionEx
- Returns:
- see above
-
isChangeCollectingNeeded
public boolean isChangeCollectingNeeded()
Description copied from interface:BuildPromotionEx
Return true if change collection is required for this build promotion (otherwise, changes are collected already).- Specified by:
isChangeCollectingNeeded
in interfaceBuildPromotionEx
- Returns:
- see above
-
isChangeCollectingNeeded
public boolean isChangeCollectingNeeded(boolean checkDependencies)
- Specified by:
isChangeCollectingNeeded
in interfaceBuildPromotionEx
- Returns:
- same as
BuildPromotionEx.isChangeCollectingNeeded()
but can also check dependencies
-
markIncomplete
public void markIncomplete()
Description copied from interface:BuildPromotionEx
Mark build promotion as incomplete (canceled)- Specified by:
markIncomplete
in interfaceBuildPromotionEx
-
markAsIncompleteIfHasFailedToStartProblems
public void markAsIncompleteIfHasFailedToStartProblems()
Description copied from interface:BuildPromotionEx
Marks build promotion as incomplete if it has failed to start build problems- Specified by:
markAsIncompleteIfHasFailedToStartProblems
in interfaceBuildPromotionEx
-
markDeleted
public void markDeleted() throws IllegalStateException
Description copied from interface:BuildPromotionEx
Mark this promotion as deleted in the database. This makes this promotion 'invisible' for most queries, and it becomes a subject for cleanup. If there is an associated finishedBuild with this promotion, this finished build is considered deleted as well, i.e. various 'buildDeleted' events are sent.- Specified by:
markDeleted
in interfaceBuildPromotionEx
- Throws:
IllegalStateException
- if this promotion is associated with a build
-
isDeleted
public boolean isDeleted()
- Specified by:
isDeleted
in interfaceBuildPromotionEx
- Returns:
- true if promotion is marked as deleted
-
isPersisted
public boolean isPersisted()
- Specified by:
isPersisted
in interfaceBuildPromotionEx
- Returns:
- true if this promotion was ever persisted into the database, so the method will return true even if markDeleted() was called for this promotion and promotion was previously stored in database
-
hasStartedParent
public boolean hasStartedParent()
Description copied from interface:BuildPromotionEx
Returns true if there exists started build which has reference to this promotion- Specified by:
hasStartedParent
in interfaceBuildPromotionEx
- Returns:
- see above
-
persist
public void persist()
Description copied from interface:BuildPromotionEx
Persists state of the build promotion- Specified by:
persist
in interfaceBuildPromotionEx
-
persist
public void persist(BuildPromotionEx.PromotionPersistMode persistMode)
- Specified by:
persist
in interfaceBuildPromotionEx
-
clearPrevPromotionCache
public void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)
- Specified by:
clearPrevPromotionCache
in interfaceBuildPromotionEx
-
getNumberOfDependedOnMe
public int getNumberOfDependedOnMe()
Description copied from interface:BuildPromotion
Returns total number of parent snapshot dependencies (without permissions filtering).- Specified by:
getNumberOfDependedOnMe
in interfaceBuildPromotion
- Returns:
- see above
-
findTops
public BuildPromotionEx[] findTops()
Description copied from interface:BuildPromotion
Return a collection of top-level build promotions for sequence builds this build promotion participates in. This build promotion may have several tops only if it has an associated running or finished build. If this build promotion is a top of the graph, returns an array with itself as the only element. This method always returns at least one element. The array of build promotions is sorted in a way that the most recent top of the graph is returned first.- Specified by:
findTops
in interfaceBuildPromotion
- Specified by:
findTops
in interfaceBuildPromotionEx
- Returns:
- see above
-
traverseDependedOnMe
public void traverseDependedOnMe(@NotNull DependencyConsumer<BuildPromotionEx> processor)
Description copied from interface:BuildPromotionEx
Traverses all build promotions depending on this one transitively. If processor returns false, traversing stops.- Specified by:
traverseDependedOnMe
in interfaceBuildPromotionEx
-
traverseSelfAndDependedOnMe
public void traverseSelfAndDependedOnMe(@NotNull DependencyConsumer<BuildPromotionEx> consumer)
- Specified by:
traverseSelfAndDependedOnMe
in interfaceBuildPromotionEx
-
traverseDependencies
public void traverseDependencies(@NotNull DependencyConsumer<BuildPromotionEx> processor)
Description copied from interface:BuildPromotionEx
Traverses all build promotion dependencies (breadth first). If processor returns false, traversing stops.- Specified by:
traverseDependencies
in interfaceBuildPromotionEx
-
traverseSelfAndDependencies
public void traverseSelfAndDependencies(@NotNull DependencyConsumer<BuildPromotionEx> consumer)
- Specified by:
traverseSelfAndDependencies
in interfaceBuildPromotionEx
-
findSelfOrDependencyWithProblem
@Nullable public BuildPromotionEx findSelfOrDependencyWithProblem(@NotNull Predicate<BuildProblemData> predicate)
Description copied from interface:BuildPromotionEx
Traverses build problems of the current build promotion and all of its dependencies using breadth first search and returns the first one for which the supplied predicate returns true- Specified by:
findSelfOrDependencyWithProblem
in interfaceBuildPromotionEx
- Parameters:
predicate
- predicate to apply- Returns:
- found dependency or null
-
setBuildRevisions
public void setBuildRevisions(@NotNull Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId)
Description copied from interface:BuildPromotionEx
Same asBuildPromotionEx.setBuildRevisions(Collection, long, long, boolean)
with validateBranch parameter set to true.- Specified by:
setBuildRevisions
in interfaceBuildPromotionEx
- See Also:
BuildPromotion.getRevisions()
,BuildPromotion.getLastModificationId()
-
setBuildRevisions
public void setBuildRevisions(@NotNull Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId, boolean validateBranch)
Description copied from interface:BuildPromotionEx
Sets revisions and modificationId into this build promotion. If revisions list is empty, that means that changes were not collected for this build- Specified by:
setBuildRevisions
in interfaceBuildPromotionEx
- Parameters:
revisions
- list of revisions for this build. If empty, changes were not collected for the build (possibly, because of some failure)maxModificationId
- modification id associated with this build, used to determine changes in this buildchainModificationId
- max mod id associated with this build configuration or its dependencies transitively, cannot be smaller than maxModificationIdvalidateBranch
- if set to true then branch validation logic is enabled; the validation will check whether the current build branch exists in any of the VCS roots in the provided revisions, and if it does not then a build problem will be added to the build- See Also:
BuildPromotion.getRevisions()
,BuildPromotion.getLastModificationId()
-
resetBuildRevisions
public void resetBuildRevisions()
- Specified by:
resetBuildRevisions
in interfaceBuildPromotionEx
-
setCustomParameters
public void setCustomParameters(@NotNull Map<String,String> buildParameters)
Description copied from interface:BuildPromotionEx
Sets custom parameters in build promotion. Custom parameters contain both configuration and build parameters. Custom parameters override default parameters. BuildPromotion.persist() method should be called to persist them.- Specified by:
setCustomParameters
in interfaceBuildPromotionEx
- Parameters:
buildParameters
- custom parameters
-
setCustomParameters
public void setCustomParameters(@NotNull Collection<Parameter> parameters)
Description copied from interface:BuildPromotionEx
Same as#setCustomParameters(List)
but acceptingParameter
instances- Specified by:
setCustomParameters
in interfaceBuildPromotionEx
-
setAssociatedBuild
public void setAssociatedBuild(@Nullable SBuild build)
Description copied from interface:BuildPromotionEx
Associates new build to this build promotion- Specified by:
setAssociatedBuild
in interfaceBuildPromotionEx
-
addDependency
public void addDependency(@NotNull BuildPromotionEx promo, @NotNull DependencyOptions options) throws IllegalArgumentException
Description copied from interface:BuildPromotionEx
Adds a build dependency- Specified by:
addDependency
in interfaceBuildPromotionEx
- Parameters:
promo
- the Build Promotion we're depending upon- Throws:
IllegalArgumentException
- when dependency to the same build configuration is added
-
removeDependency
public void removeDependency(@NotNull BuildPromotionEx promo)
Description copied from interface:BuildPromotionEx
Removes dependency on specified promotion- Specified by:
removeDependency
in interfaceBuildPromotionEx
-
replaceDependency
public void replaceDependency(@NotNull BuildPromotionEx origDependency, @NotNull BuildPromotionEx newDependency, @NotNull DependencyOptions newOptions)
Description copied from interface:BuildPromotionEx
Replaces dependency on one promotion with dependency to another promotion- Specified by:
replaceDependency
in interfaceBuildPromotionEx
- Parameters:
origDependency
- original promotionnewDependency
- replacement
-
addToQueue
public SQueuedBuild addToQueue(@NotNull String triggeredBy)
Description copied from interface:BuildPromotion
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.- Specified by:
addToQueue
in interfaceBuildPromotion
- Parameters:
triggeredBy
- contains details about who triggered build, see alsoTriggeredByBuilder
- Returns:
- the queued build or null if adding to queue is impossible for some reason
-
addToQueue
public SQueuedBuild addToQueue(@NotNull SBuildAgent buildAgent, @NotNull String triggeredBy)
Description copied from interface:BuildPromotion
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.- Specified by:
addToQueue
in interfaceBuildPromotion
- Parameters:
buildAgent
- build agent where the build is to runtriggeredBy
- contains details about who triggered build, see alsoTriggeredByBuilder
- Returns:
- the queued build or null if adding to queue is impossible for some reason
-
getPreviousBuildPromotion
public BuildPromotion getPreviousBuildPromotion(@NotNull SelectPrevBuildPolicy policy)
Description copied from interface:BuildPromotion
Returns previous promotion created before this one and corresponding to the specified policy.- Specified by:
getPreviousBuildPromotion
in interfaceBuildPromotion
- Parameters:
policy
- policy- Returns:
- see above
-
isUsed
public boolean isUsed()
Description copied from interface:BuildPromotion
Returns true if there is a reference to this build promotion from queued, running or history build.- Specified by:
isUsed
in interfaceBuildPromotion
- Returns:
- see above
-
copy
public BuildPromotionEx copy(boolean copyRevisions)
Description copied from interface:BuildPromotion
Creates copy of this build promotion (a copy will have different id). Note that this method does not make a deep copy if dependencies exist.- Specified by:
copy
in interfaceBuildPromotion
- Specified by:
copy
in interfaceBuildPromotionEx
- Parameters:
copyRevisions
- indicates whether to copy revisions associated with this promotion or not- Returns:
- copy of this build promotion
-
getSequenceBuild
public SBuild getSequenceBuild()
- Specified by:
getSequenceBuild
in interfaceBuildPromotionEx
- See Also:
BuildPromotionOwner.getSequenceBuild()
-
getStartedEquivalentPromotions
@NotNull public List<BuildPromotionEx> getStartedEquivalentPromotions(int maxNumToProcess)
Description copied from interface:BuildPromotionEx
Returns build promotions with associated builds and equivalent to this build promotion (same settings, changes and revisions)- Specified by:
getStartedEquivalentPromotions
in interfaceBuildPromotionEx
- Parameters:
maxNumToProcess
- maximum number of promotions to process while searching for equivalent promotions, -1 means unlimited- Returns:
- see above
-
getEquivalentPromotions
@NotNull public List<BuildPromotionEx> getEquivalentPromotions(@NotNull List<BuildPromotionEx> promotions)
Description copied from interface:BuildPromotionEx
Returns build promotions from the build queue equivalent to this build promotion (same settings, changes and revisions)- Specified by:
getEquivalentPromotions
in interfaceBuildPromotionEx
- Returns:
- see above
-
isChangesCollectingInProgress
public boolean isChangesCollectingInProgress()
- Specified by:
isChangesCollectingInProgress
in interfaceBuildPromotionEx
-
waitForChangesCollectingToFinish
public void waitForChangesCollectingToFinish(long timeoutMillis) throws InterruptedException, ExecutionException, TimeoutException, CancellationException
Description copied from interface:BuildPromotionEx
If checking for changes is in progress, blocks for the specified timeout- Specified by:
waitForChangesCollectingToFinish
in interfaceBuildPromotionEx
- Parameters:
timeoutMillis
- timeout in milliseconds- Throws:
TimeoutException
- if operation did not finish within specified timeoutInterruptedException
ExecutionException
CancellationException
-
lockDependenciesOptimizing
public void lockDependenciesOptimizing()
- Specified by:
lockDependenciesOptimizing
in interfaceBuildPromotionEx
-
unlockDependenciesOptimizing
public void unlockDependenciesOptimizing()
- Specified by:
unlockDependenciesOptimizing
in interfaceBuildPromotionEx
-
addDependedOnMe
public void addDependedOnMe(@NotNull BuildPromotionEx promoEx, @NotNull DependencyOptions options)
Description copied from interface:BuildPromotionEx
Adds link to parent promotion- Specified by:
addDependedOnMe
in interfaceBuildPromotionEx
-
addDependedOnMeIfCached
public void addDependedOnMeIfCached(@NotNull BuildPromotionEx promotion, @NotNull DependencyOptions options)
Description copied from interface:BuildPromotionEx
Adds link to parent promotion only if depended on me list is already loaded from DB for this promotion- Specified by:
addDependedOnMeIfCached
in interfaceBuildPromotionEx
-
removeDependedOnMe
public void removeDependedOnMe(@NotNull BuildPromotion promoEx)
Description copied from interface:BuildPromotionEx
Removes link to parent promotion- Specified by:
removeDependedOnMe
in interfaceBuildPromotionEx
-
isOutOfChangesSequence
public boolean isOutOfChangesSequence()
Description copied from interface:BuildPromotion
Returns true if there is a build started before this build promotion associated build which contains more recent changes.- Specified by:
isOutOfChangesSequence
in interfaceBuildPromotion
- Returns:
- see above
-
isPartOfBuildChain
public boolean isPartOfBuildChain()
- Specified by:
isPartOfBuildChain
in interfaceBuildPromotion
- Returns:
- true if this build promotion is a part of build dependencies graph, i.e. there are promotions having dependencies on this promotion or this promotion has dependencies on other promotions.
-
isCanceled
public boolean isCanceled()
Description copied from interface:BuildPromotion
Return true if associated build is canceled- Specified by:
isCanceled
in interfaceBuildPromotion
- Returns:
- see above
-
getArtifactDependencies
@NotNull public List<SArtifactDependency> getArtifactDependencies()
Description copied from interface:BuildPromotion
Returns collection of artifact dependencies to be sent to an agent. This collection may or may not be the same as default build configuration dependencies because before sending to an agent revision rules are fixed (dependencies begin pointing to concrete builds).- Specified by:
getArtifactDependencies
in interfaceBuildPromotion
- Returns:
- see above
-
setDesiredBranchName
public void setDesiredBranchName(@NotNull String branchName)
- Specified by:
setDesiredBranchName
in interfaceBuildPromotion
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
fillDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
accumulator
- collection to add changes to, according to 'prevBuildPolicy' and 'includeDependencyChanges' options. Changes included are guaranteed to be at or _more_ than defined by the cut-off point in 'callback'callback
- allows to define changes iteration cut-off logic
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull ChangesCalculationOptionsEx options)
Description copied from interface:BuildPromotionEx
Returns changes according to the specified options- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
options
- changes calculation options- Returns:
- see above
-
getOwnChanges
@NotNull public List<SVcsModification> getOwnChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotionEx
Returns changes in this promotion computed according to specified options, doesn't include changes from dependencies.- Specified by:
getOwnChanges
in interfaceBuildPromotionEx
- Parameters:
options
- changes calculation options- Returns:
- see above
-
getChanges
@NotNull public BuildChanges getChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotion
Returns build changes according to the specified options- Specified by:
getChanges
in interfaceBuildPromotion
- Parameters:
options
- changes calculation options- Returns:
- see above
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull ChangesCalculationOptionsEx options)
Description copied from interface:BuildPromotionEx
Computes changes according to the specified options and add them to the given accumulator- Specified by:
fillDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
accumulator
- accumulator for changesoptions
- changes calculation options
-
hasComputedChanges
public boolean hasComputedChanges(@NotNull SelectPrevBuildPolicy policy, @NotNull VcsModificationProcessor callback)
- Specified by:
hasComputedChanges
in interfaceBuildPromotionEx
-
getPersonalChanges
@NotNull public List<ChangeDescriptor> getPersonalChanges(@NotNull List<ChangeDescriptor> allChanges)
Description copied from interface:BuildPromotionEx
Takes all changes and returns only those that belong to current owner of build promotion. Returns empty list of build promotion is not personal.- Specified by:
getPersonalChanges
in interfaceBuildPromotionEx
- Returns:
-
getDetectedChangesProviders
@NotNull public List<BuildDetectedChangesProvider> getDetectedChangesProviders(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChangesProviders
in interfaceBuildPromotionEx
- Parameters:
prevBuildPolicy
- previous build policyincludeDependencyChanges
- whether to include- Returns:
- list of detected changes provides. Change provider returns changes associated with build promotion. With help of this method one can retrieve changes from some providers only.
-
getCanRunOnAgentTypes
@NotNull public Collection<SAgentType> getCanRunOnAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCanRunOnAgentTypes
in interfaceBuildPromotionEx
-
getCompatibleAgentTypes
@NotNull public Collection<SAgentType> getCompatibleAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCompatibleAgentTypes
in interfaceBuildPromotionEx
-
getAgentTypeCompatibilityMap
@NotNull public Map<SAgentType,CompatibilityResult> getAgentTypeCompatibilityMap(@NotNull Collection<SAgentType> available)
Description copied from interface:BuildPromotionEx
Returns map of agent types to compatibility result. Note: can return empty map if the current build promotion is marked for deletion or its build configuration no longer exists.- Specified by:
getAgentTypeCompatibilityMap
in interfaceBuildPromotionEx
- Returns:
-
getCheckoutDirectory
public String getCheckoutDirectory()
- Specified by:
getCheckoutDirectory
in interfaceBuildPromotionEx
-
getDefaultCheckoutDirectory
@NotNull public String getDefaultCheckoutDirectory(BuildTypeDescriptor.CheckoutType checkoutType)
Description copied from interface:BuildPromotionEx
Returns name of the checkout directory that should be used for the build if explicit checkout directory is not specified. Don't acceptBuildTypeDescriptor.CheckoutType.AUTO
, throwingIllegalArgumentException
if it's passed.- Specified by:
getDefaultCheckoutDirectory
in interfaceBuildPromotionEx
-
getRealOrDummyBuild
@NotNull public SBuild getRealOrDummyBuild()
- Specified by:
getRealOrDummyBuild
in interfaceBuildPromotionEx
-
addBuildProblem
public void addBuildProblem(@NotNull BuildProblemData buildProblem)
Description copied from interface:BuildPromotionEx
Adds build problem, currently it actually causes build failure- Specified by:
addBuildProblem
in interfaceBuildPromotionEx
-
getFailureReasons
@NotNull public List<BuildProblemData> getFailureReasons()
Description copied from interface:BuildPromotionEx
Returns non-muted build problems for this promotion Note that this mathod may cause DB call, if you only require the fact if there are any failure reasons use hasFailureReasons which is guaranteed fast- Specified by:
getFailureReasons
in interfaceBuildPromotionEx
-
hasFailureReasons
public boolean hasFailureReasons()
- Specified by:
hasFailureReasons
in interfaceBuildPromotionEx
-
getBuildProblems
@NotNull public List<BuildProblem> getBuildProblems()
Description copied from interface:BuildPromotionEx
Returns all build problems for this promotion with extended information about muting. The problems are sorted in order of their appearance.- Specified by:
getBuildProblems
in interfaceBuildPromotionEx
- Returns:
- see above
-
getUnsortedBuildProblems
@NotNull public Collection<BuildProblem> getUnsortedBuildProblems()
Description copied from interface:BuildPromotionEx
Same asBuildPromotionEx.getBuildProblems()
but returns problems in any order and can work faster because of that.- Specified by:
getUnsortedBuildProblems
in interfaceBuildPromotionEx
- Returns:
- build problems in no particular order
-
getBuildChainProblems
@NotNull public List<BuildProblem> getBuildChainProblems(boolean omitInduced)
Description copied from interface:BuildPromotionEx
If omitInduced is false, simply traverses all of the dependencies of this promotion and returns collection of all build problems (including this promotion own problems). If omitInduced is true, returns only those build problems which caused failure of this build promotion (root causes). Returned list will not have build problems of snapshot dependency type (seeErrorData.isSnapshotDependencyError(String)
) as such problems are induced and never represent the root cause.- Specified by:
getBuildChainProblems
in interfaceBuildPromotionEx
- Parameters:
omitInduced
- see above- Returns:
- list of own problems as well as problems from snapshot dependencies transitively
-
hasBuildProblemsOfType
public boolean hasBuildProblemsOfType(@NotNull String type)
- Specified by:
hasBuildProblemsOfType
in interfaceBuildPromotionEx
- Returns:
- true if there are build problems with specified type
-
deleteBuildProblem
public void deleteBuildProblem(@NotNull String identity)
Description copied from interface:BuildPromotionEx
Deletes build problem Deleting build problem may change build status to SUCCESS- Specified by:
deleteBuildProblem
in interfaceBuildPromotionEx
- Parameters:
identity
- identiry of build problem to be removed
-
updateStateFromBuildData
public void updateStateFromBuildData(@NotNull AbstractBuildData runningBuildData)
Description copied from interface:BuildPromotionEx
Quickly updates some information in build promotion from DB information. Doesn't store anything back to DB- Specified by:
updateStateFromBuildData
in interfaceBuildPromotionEx
-
updateFromDB
public void updateFromDB(@NotNull BuildPromotionEx.UpdateReason reason)
Description copied from interface:BuildPromotionEx
Updates promotion data from database- Specified by:
updateFromDB
in interfaceBuildPromotionEx
-
updateSelfAndDependenciesFromDB
public void updateSelfAndDependenciesFromDB()
Description copied from interface:BuildPromotionEx
Updates the build promotion and all its dependencies from the database- Specified by:
updateSelfAndDependenciesFromDB
in interfaceBuildPromotionEx
-
initBuildProblems
public void initBuildProblems()
Description copied from interface:BuildPromotionEx
Init build problems from database- Specified by:
initBuildProblems
in interfaceBuildPromotionEx
-
muteBuildProblems
public void muteBuildProblems(boolean muteIfTrue, @Nullable SUser user, @Nullable String comment)
Description copied from interface:BuildPromotionEx
Makes all existing build problems enabled or disabled- Specified by:
muteBuildProblems
in interfaceBuildPromotionEx
- Parameters:
muteIfTrue
- pass true to make build successful, false to make existing problems visible again
-
getBuildLog
@NotNull public BuildLogEx getBuildLog()
- Specified by:
getBuildLog
in interfaceBuildPromotion
- Specified by:
getBuildLog
in interfaceBuildPromotionEx
- Returns:
- Log for operations which could occur before build start, like changes collecting or logging detailed triggering information.
-
getBuildLogIfInitialized
@Nullable public BuildLogEx getBuildLogIfInitialized()
- Specified by:
getBuildLogIfInitialized
in interfaceBuildPromotionEx
-
createOrderedBuild
@NotNull public OrderedBuild createOrderedBuild()
Description copied from interface:BuildPromotionEx
Returns an OrderedBuild with all fields filled. The OrderedBuild contains a consistent snapshot of the promotion properties, ie. no one modified promotion during OrderedBuild creation.- Specified by:
createOrderedBuild
in interfaceBuildPromotionEx
- Returns:
- see above
-
getTagDatas
@NotNull public Collection<TagData> getTagDatas()
Description copied from interface:BuildPromotion
Returns list of all tags for this build promotion, no special order is preserved- Specified by:
getTagDatas
in interfaceBuildPromotion
- Returns:
- tags
- See Also:
TagDataUtil
,for variety of tag-releated actions
-
hasLoadedTags
public boolean hasLoadedTags()
Description copied from interface:BuildPromotionEx
Returns true if promotion loaded information about tags from db- Specified by:
hasLoadedTags
in interfaceBuildPromotionEx
- Returns:
- see above
-
isEquivalentTo
@NotNull public EquivalenceCheckResult isEquivalentTo(@NotNull BuildPromotion promoToCompare, @Nullable Boolean compareBranches)
- Specified by:
isEquivalentTo
in interfaceBuildPromotionEx
- Parameters:
promoToCompare
- build promotion to compare withcompareBranches
- whether to compare branches strictly or not- Returns:
- object with reason why builds are not equivalent
-
setArtifactsDirectory
public void setArtifactsDirectory(@NotNull File artifactsDir)
Description copied from interface:BuildPromotionEx
Sets new artifacts directory to this build promotion. This method also persists new artifacts directory in database, not additional call toBuildPromotionEx.persist()
is required.- Specified by:
setArtifactsDirectory
in interfaceBuildPromotionEx
- Parameters:
artifactsDir
- new artifacts directory
-
isFinished
public boolean isFinished()
- Specified by:
isFinished
in interfaceBuildPromotionEx
- Returns:
- true if build associated with this promotion is finished. Method is not optimized for performance, and can perform one SQL query to determine whether build is finished or not.
-
getProjectPathIds
@NotNull public List<String> getProjectPathIds()
Description copied from interface:BuildPromotionEx
Returns project path of a project where this build promotion belongs. Project path is fixed on the moment when some build is associated with this promotion. List contains internal ids of the projects. The first element in the list is root project id, while the last element contains id of the build promotion project.
The list can be empty.- Specified by:
getProjectPathIds
in interfaceBuildPromotionEx
-
getOwnerNodeUrl
@Nullable public String getOwnerNodeUrl()
Description copied from interface:BuildPromotionEx
Returns url of the node which processes this build messages. Returns null if this build promotion is not assigned to any node. ReturnsBuildPromotionEx.MAIN_NODE_MARKER
if build promotion was specifically assigned to main node.- Specified by:
getOwnerNodeUrl
in interfaceBuildPromotionEx
-
getOwnerNode
@Nullable public TeamCityNode getOwnerNode()
- Specified by:
getOwnerNode
in interfaceBuildPromotionEx
- Returns:
- TeamCityNode of build messages processor type if this promotion was assigned to such a node using setOwnerNodeUrl call; returns null in all other cases.
-
setOwnerNodeUrl
public void setOwnerNodeUrl(@Nullable String url)
Description copied from interface:BuildPromotionEx
Sets url of the node which processes this build messages.- Specified by:
setOwnerNodeUrl
in interfaceBuildPromotionEx
-
getPreviousBuilds
@NotNull public Stream<OrderedBuild> getPreviousBuilds(@NotNull Filter<String> branchFilter)
Description copied from interface:BuildPromotionEx
Returns stream of previous builds matched by specified branch filter and ordered by changes- Specified by:
getPreviousBuilds
in interfaceBuildPromotionEx
- Parameters:
branchFilter
- filter of interest- Returns:
- see above
-
getPrivateTags
@NotNull public List<String> getPrivateTags(@NotNull SUser user)
Description copied from interface:BuildPromotion
Returns list of private tag labels in lexicographical order for particular user for this build promotion- Specified by:
getPrivateTags
in interfaceBuildPromotion
- Returns:
- tags
-
setPrivateTags
public void setPrivateTags(@Nullable List<String> labels, @NotNull SUser user)
Description copied from interface:BuildPromotion
Set private tags for particular user Attention! Replace all private tags related to the particular user with new set- Specified by:
setPrivateTags
in interfaceBuildPromotion
- Parameters:
labels
- new tag labelsuser
- a particular user which tags should be updated- See Also:
for variety of tag-releated actions
-
getTags
@NotNull public List<String> getTags()
Description copied from interface:BuildPromotion
Returns list of public tag labels in lexicographical order for the build promotion- Specified by:
getTags
in interfaceBuildPromotion
- Returns:
- tags
-
setTags
public void setTags(List<String> labels)
Description copied from interface:BuildPromotion
Set public tags. Attention! Replace old public tags set with new one.- Specified by:
setTags
in interfaceBuildPromotion
- Parameters:
labels
- tag labels- See Also:
for variety of tag-releated actions
-
getQueuedDate
@NotNull public Date getQueuedDate()
Description copied from interface:BuildPromotion
Returns the date when the build was added to queue.- Specified by:
getQueuedDate
in interfaceBuildPromotion
- Returns:
- queued time, null if promotion wasn't queued
-
getServerStartDate
@NotNull public Date getServerStartDate()
Description copied from interface:BuildPromotion
Returns the timestamp when the build was removed from the queue.- Specified by:
getServerStartDate
in interfaceBuildPromotion
- Returns:
- the timestamp when the build was removed from the queue, null if wasn't yet
-
setQueuedAt
public void setQueuedAt(Date queuedAt)
- Specified by:
setQueuedAt
in interfaceBuildPromotionEx
-
setRemoveFromQueueDate
public void setRemoveFromQueueDate(@NotNull Date removeFromQueueDate)
- Specified by:
setRemoveFromQueueDate
in interfaceBuildPromotionEx
-
resetBuildLog
public void resetBuildLog()
- Specified by:
resetBuildLog
in interfaceBuildPromotionEx
-
buildFinished
public void buildFinished()
Description copied from interface:BuildPromotionEx
Must be called when build history entry created for this promotion.- Specified by:
buildFinished
in interfaceBuildPromotionEx
-
buildEvictedFromCache
public void buildEvictedFromCache()
Description copied from interface:BuildPromotionEx
Called when finished build associated with this promotion is removed from the builds cache. In this case promotion can clear some of its internal objects and free some memory.- Specified by:
buildEvictedFromCache
in interfaceBuildPromotionEx
-
associatedBuildFinished
public void associatedBuildFinished()
- Specified by:
associatedBuildFinished
in interfaceBuildPromotionEx
-
isForcedPostprocessingOfFrozenSettings
public boolean isForcedPostprocessingOfFrozenSettings()
- Specified by:
isForcedPostprocessingOfFrozenSettings
in interfaceBuildPromotionEx
- Returns:
- true if settings post processing is required even if settings are already marked as frozen
-
freezeSettings
public void freezeSettings()
Description copied from interface:BuildPromotionEx
Freeze buildType settings for this promotion. After call to this method a promotion will use frozen buildType settings instead of current ones.- Specified by:
freezeSettings
in interfaceBuildPromotionEx
-
freezeSettings
public void freezeSettings(@NotNull BuildTypeEx buildType, @NotNull String settingsOrigin) throws IOException
Description copied from interface:BuildPromotionEx
Freeze buildType settings for this promotion using the given buildType. After call to this method a promotion will use frozen buildType settings instead of current ones.- Specified by:
freezeSettings
in interfaceBuildPromotionEx
- Parameters:
buildType
- buildType those settings to usesettingsOrigin
- origin of settings, predefined values: 'vcs' for settings from vcs, 'current' for current buildType settings- Throws:
IOException
- when freeze fails
-
freezeSettings
public void freezeSettings(@NotNull BuildTypeSettingsEx settings, @NotNull String settingsOrigin) throws IOException
Description copied from interface:BuildPromotionEx
Freeze settings for this promotion using the given buildSettings.- Specified by:
freezeSettings
in interfaceBuildPromotionEx
- Parameters:
settings
- the settings to store into the build promotionsettingsOrigin
- origin of settings, predefined values: 'vcs' for settings from vcs, 'current' for current buildType settings- Throws:
IOException
- when freeze fails
-
freezeSettingsWithForcedPostprocessing
public void freezeSettingsWithForcedPostprocessing(@NotNull BuildTypeSettingsEx settings, String origin)
Description copied from interface:BuildPromotionEx
Freeze settings for this promotion using the given buildSettings and mark that postprocessing is still required for this promotion.- Specified by:
freezeSettingsWithForcedPostprocessing
in interfaceBuildPromotionEx
- Parameters:
settings
- the settings to store into the build promotionorigin
- origin of settings, predefined values: 'vcs' for settings from vcs, 'current' for current buildType settings
-
freezeSettings
public void freezeSettings(@NotNull File settings, @NotNull String settingsOrigin) throws IOException
Description copied from interface:BuildPromotionEx
Freeze settings for this promotion using the given settings file.- Specified by:
freezeSettings
in interfaceBuildPromotionEx
- Parameters:
settings
- the settings file to store into the build promotionsettingsOrigin
- origin of settings, predefined values: 'vcs' for settings from vcs, 'current' for current buildType settings- Throws:
IOException
- when freeze fails
-
setFreezeSettings
public void setFreezeSettings(@Nullable Boolean freezeSettings)
Description copied from interface:BuildPromotionEx
Indicates if we should freeze settings in build- Specified by:
setFreezeSettings
in interfaceBuildPromotionEx
- Parameters:
freezeSettings
- true means freeze settings if it is enabled for buildType, false means don't attempt to freeze settings even if they are enabled, null means use buildType's defaults (it is default value)
-
getFreezeSettings
@Nullable public Boolean getFreezeSettings()
Description copied from interface:BuildPromotionEx
Returns true if we should freeze settings if it is enabled in buildType, false if settings shouldn't be frozen, null - use buildType's defaults- Specified by:
getFreezeSettings
in interfaceBuildPromotionEx
- Returns:
- see above
-
getFrozenSettingsFile
@NotNull public File getFrozenSettingsFile()
- Specified by:
getFrozenSettingsFile
in interfaceBuildPromotionEx
- Returns:
- path to file with frozen settings.
-
hasFrozenSettings
public boolean hasFrozenSettings()
- Specified by:
hasFrozenSettings
in interfaceBuildPromotionEx
- Returns:
- true if settings of this promotion were frozen.
-
hasFrozenSettingsFromVcs
public boolean hasFrozenSettingsFromVcs()
- Specified by:
hasFrozenSettingsFromVcs
in interfaceBuildPromotionEx
- Returns:
- true if this promotion has frozen settins from VCS
-
needToFreezeSettings
public boolean needToFreezeSettings()
- Specified by:
needToFreezeSettings
in interfaceBuildPromotionEx
- Returns:
- true if there was no attempt to freeze settings (successful or failed)
-
scheduleCheckingForChangesIfNeeded
public boolean scheduleCheckingForChangesIfNeeded()
- Specified by:
scheduleCheckingForChangesIfNeeded
in interfaceBuildPromotionEx
- Returns:
- true if checking for changes was scheduled and false if it was not, because build promotion has changes collected already
-
cancelCheckingForChanges
public void cancelCheckingForChanges()
- Specified by:
cancelCheckingForChanges
in interfaceBuildPromotionEx
-
containsChange
public boolean containsChange(@NotNull SVcsModification m)
Description copied from interface:BuildPromotionEx
Returns true if promotion contains specified modification among its changes. Takes only own changes into account (does not use changes from dependencies).- Specified by:
containsChange
in interfaceBuildPromotionEx
- Parameters:
m
- modification of interest- Returns:
- see above
-
isCompositeBuild
public boolean isCompositeBuild()
- Specified by:
isCompositeBuild
in interfaceBuildPromotion
- Specified by:
isCompositeBuild
in interfaceBuildPromotionInfo
- Returns:
- true if build promotion has dependencies and it was created in a build configuration marked as composite build
-
getCreatorNodeId
@NotNull public String getCreatorNodeId()
- Specified by:
getCreatorNodeId
in interfaceBuildPromotion
- Returns:
- node id which created the build promotion.
-
hasBuildFeatureOfType
public boolean hasBuildFeatureOfType(@NotNull String featureType)
Description copied from interface:BuildPromotion
Returns true if this build promotion has a build feature of the specified type- Specified by:
hasBuildFeatureOfType
in interfaceBuildPromotion
- Parameters:
featureType
- the type of the build feature- Returns:
- true if the build promotion has the build feature in its settings and false otherwise
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String featureType)
Description copied from interface:BuildPromotion
Returns settings of the enabled build features of the specified type. If the settings have parameter references, then they won't be resolved (see alsoSBuild.getBuildFeaturesOfType(String)
). This method returns the same result asgetBuildSettings().getBuildFeaturesOfType(String)
.- Specified by:
getBuildFeaturesOfType
in interfaceBuildPromotion
- Parameters:
featureType
- the type of the build feature- Returns:
- the settings of the build features of the specified type or empty list if there are no such build features
-
allDependenciesFinished
public boolean allDependenciesFinished()
- Specified by:
allDependenciesFinished
in interfaceBuildPromotionEx
- Returns:
- true if all direct dependencies of this build promotion are finished
-
getDependentCompositePromotions
@NotNull public List<BuildPromotionEx> getDependentCompositePromotions()
- Specified by:
getDependentCompositePromotions
in interfaceBuildPromotionEx
- Returns:
- list of all composite promotions depending on this build promotion either directly or transitively
-
getSettingsVcsRootInstance
@Nullable public VcsRootInstance getSettingsVcsRootInstance()
- Specified by:
getSettingsVcsRootInstance
in interfaceBuildPromotionEx
- Returns:
- settings VCS root associated with this promotion
-
decreaseExpirationCounter
public int decreaseExpirationCounter(int decreaseAmount)
- Specified by:
decreaseExpirationCounter
in interfaceBuildPromotionEx
-
setExpirationCounter
public void setExpirationCounter(int counter)
- Specified by:
setExpirationCounter
in interfaceBuildPromotionEx
-
isAssociatedBuildFinished
public boolean isAssociatedBuildFinished()
- Specified by:
isAssociatedBuildFinished
in interfaceBuildPromotionEx
-
resetBuildSettings
public void resetBuildSettings()
Description copied from interface:BuildPromotionEx
Resets cached build settings associated with promotion- Specified by:
resetBuildSettings
in interfaceBuildPromotionEx
-
hasArtifactDependencyOn
public boolean hasArtifactDependencyOn(@NotNull BuildPromotion dependencyBuild)
Description copied from interface:BuildPromotionEx
Checks if this promotion artifact-depends on the passed one. Especially useful for queued and running builds- Specified by:
hasArtifactDependencyOn
in interfaceBuildPromotionEx
-
getBuildPromotionsWithArtifactDependenciesOnMe
@NotNull public List<BuildPromotion> getBuildPromotionsWithArtifactDependenciesOnMe(@NotNull List<BuildPromotion> buildPromotions)
Description copied from interface:BuildPromotionEx
Checks artifact dependencies of the build promotions provided as an argument and returns those which have a direct artifact dependency (by build id) on this build promotion.- Specified by:
getBuildPromotionsWithArtifactDependenciesOnMe
in interfaceBuildPromotionEx
- Parameters:
buildPromotions
- build promotions to check- Returns:
- the dependent build promotions
-
isAgentLessBuild
public boolean isAgentLessBuild()
Description copied from interface:BuildPromotionEx
Does it build cannot be executed on any usual agent but only by some external proccess.- Specified by:
isAgentLessBuild
in interfaceBuildPromotionEx
- Specified by:
isAgentLessBuild
in interfaceBuildPromotionInfo
- Returns:
- true if the build cannot be executed on any usual agent; false - if the build can be executed on usual agent
-
isDetachedFromAgent
public boolean isDetachedFromAgent()
- Specified by:
isDetachedFromAgent
in interfaceBuildPromotionEx
- Returns:
- true if the corresponding build was detached from agent at some point and became agentless
-
getDetachedFromAgentDate
@Nullable public Date getDetachedFromAgentDate()
- Specified by:
getDetachedFromAgentDate
in interfaceBuildPromotionEx
- Returns:
- date when this build was fully detched from agent or null
-
getPreviousOrderedBuild
@Nullable public OrderedBuild getPreviousOrderedBuild(@NotNull SelectPrevBuildPolicy policy)
Description copied from interface:BuildPromotionEx
Returns previous OrderedBuild instance which corresponds to a build promotion which is created before this one and corresponding to the specified policy.- Specified by:
getPreviousOrderedBuild
in interfaceBuildPromotionEx
- Parameters:
policy
- policy- Returns:
- see above
-
persistVcsRootEntries
public void persistVcsRootEntries()
Description copied from interface:BuildPromotionEx
Persists information about VCS roots used by this build promotion to the database.- Specified by:
persistVcsRootEntries
in interfaceBuildPromotionEx
-
persistDependencies
public void persistDependencies()
- Specified by:
persistDependencies
in interfaceBuildPromotionEx
-
getExecutionTimeoutMin
public int getExecutionTimeoutMin()
Description copied from interface:BuildPromotionEx
Returns build execution timeout in minutes, 0 indicates that there is no limit- Specified by:
getExecutionTimeoutMin
in interfaceBuildPromotionEx
-
getPromotionCustomization
@NotNull public PromotionCustomizationInfo getPromotionCustomization()
Description copied from interface:BuildPromotionEx
Returns promotion customization details, if any Build promotion can be customized by pressing ... near "Run" button in the configuration. The customization may include revisions, dependencies, custom parameters. Personal builds are marked as customized only if other some build parameters differ from typical one.- Specified by:
getPromotionCustomization
in interfaceBuildPromotionEx
- Returns:
- see above
-
getCommitters
@NotNull public Set<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy, int maxChangesToProcess)
Description copied from interface:BuildPromotionEx
Same asBuildPromotion.getCommitters(SelectPrevBuildPolicy)
but allows to control number of changes which should be looked up when committers are computed.- Specified by:
getCommitters
in interfaceBuildPromotionEx
- Parameters:
selectPrevBuildPolicy
- policy for selecting a previous buildmaxChangesToProcess
- max number of changes in build to look up, -1 indicates no limit- Returns:
- committers from builds changes
-
createBuildPromotionAccessChecker
@NotNull public Predicate<BuildPromotion> createBuildPromotionAccessChecker()
- Specified by:
createBuildPromotionAccessChecker
in interfaceBuildPromotionEx
-
getDependenciesSupplier
@NotNull public DependenciesSupplier getDependenciesSupplier()
Description copied from interface:BuildPromotionEx
Creates a dependencies supplier from the snapshot dependencies of this build promotion.- Specified by:
getDependenciesSupplier
in interfaceBuildPromotionEx
- Returns:
- see above
-
getMaximumNumberOfBuildsPerBranch
public int getMaximumNumberOfBuildsPerBranch()
- Specified by:
getMaximumNumberOfBuildsPerBranch
in interfaceBuildPromotionEx
- Returns:
- see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
isMaximumNumberOfBuildsPerBranchLimited
public boolean isMaximumNumberOfBuildsPerBranchLimited()
- Specified by:
isMaximumNumberOfBuildsPerBranchLimited
in interfaceBuildPromotionEx
- Returns:
- true if number of builds per branch is limited, see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
-