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 voidaddBuildProblem(BuildProblemData buildProblem)Adds build problem, currently it actually causes build failurevoidaddDependedOnMe(BuildPromotionEx promoEx, DependencyOptions options)Adds link to parent promotionvoidaddDependedOnMeIfCached(BuildPromotionEx promotion, DependencyOptions options)Adds link to parent promotion only if depended on me list is already loaded from DB for this promotionvoidaddDependency(BuildPromotionEx promo, DependencyOptions options)Adds a build dependencySQueuedBuildaddToQueue(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.SQueuedBuildaddToQueue(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.booleanallDependenciesFinished()voidartifactsChanged(boolean scheduleUpdate)Should be called when artifacts are changed on disk.voidassociatedBuildFinished()voidbuildEvictedFromCache()Called when finished build associated with this promotion is removed from the builds cache.voidbuildFinished()Must be called when build history entry created for this promotion.voidcancelCheckingForChanges()voidclearPrevPromotionCache(Collection<BuildPromotion> targetPromos)intcompareTo(BuildPromotion o)booleancontainsChange(SVcsModification m)Returns true if promotion contains specified modification among its changes.BuildPromotionExcopy(boolean copyRevisions)Creates copy of this build promotion (a copy will have different id).Predicate<BuildPromotion>createBuildPromotionAccessChecker()OrderedBuildcreateOrderedBuild()Returns an OrderedBuild with all fields filled.intdecreaseExpirationCounter(int decreaseAmount)voiddeleteBuildProblem(String identity)Deletes build problem Deleting build problem may change build status to SUCCESSvoiddetachChanges()Marks build as build with detached changes, i.e.voidensureBuildLogFlushed()Makes sure that messages in the build log buffer are flushed on disk.voidfillDetectedChanges(List<ChangeDescriptor> accumulator, ChangesCalculationOptionsEx options)Computes changes according to the specified options and add them to the given accumulatorvoidfillDetectedChanges(List<ChangeDescriptor> accumulator, SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges, VcsModificationProcessor callback)BuildPromotionExfindSelfOrDependencyWithProblem(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.voidfreezeSettings()Freeze buildType settings for this promotion.voidfreezeSettings(File settings, String settingsOrigin)Freeze settings for this promotion using the given settings file.voidfreezeSettings(BuildTypeEx buildType, String settingsOrigin)Freeze buildType settings for this promotion using the given buildType.voidfreezeSettings(BuildTypeSettingsEx settings, String settingsOrigin)Freeze settings for this promotion using the given buildSettings.voidfreezeSettingsWithForcedPostprocessing(BuildTypeSettingsEx settings, String origin)Freeze settings for this promotion using the given buildSettings and mark that postprocessing is still required for this promotion.StringgenerateAgentAccessCode()Generates agent access code for communication with TeamCity during buildCompatibilityResultgetAgentCompatibility(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.BuildPromotionExgetAnchorBuildPromotion()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.BuildArtifactsgetArtifacts(BuildArtifactsViewMode mode)Returns artifacts of this build promotion.FilegetArtifactsDirectory()BuildPromotionEx.ArtifactsStateInfogetArtifactStateInfo()SBuildgetAssociatedBuild()Returns running or finished build associated with this promotion or null if there is no such build.LonggetAssociatedBuildId()Returns id of the build associated with this promotion, or null if there is no such build.ObjectgetAttribute(String attributeName)Map<String,Object>getAttributes()AuditLoggetAuditLog()List<AuditLogAction>getAuditLogActions(AuditLogFilter filter)StringgetAutogeneratedBranchName()Returns auto-generated branch name for the case if build promotion VCS roots differ from VCS roots in build configuration.BranchgetBranch()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).CommentgetBuildComment()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, resolvedBuildLogExgetBuildLog()BuildLogExgetBuildLogIfInitialized()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.BuildSettingsgetBuildSettings()Returns settings specified toBuildPromotionEx.freezeSettings(BuildTypeEx, String)method or settings of this buildType this promotion belongs to ifBuildPromotionEx.freezeSettings(BuildTypeEx, String)wasn't calledBuildTypeExgetBuildType()Returns build configuration to which this promotion corresponds.StringgetBuildTypeExternalId()Returns the external id of the associated build type.StringgetBuildTypeId()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)LonggetChainModificationId()Returns max modification id (max result of #getLastModificationId()) among this promotion all all its dependencies transitively.BuildChangesgetChanges(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)StringgetCheckoutDirectory()StringgetCollectChangesError()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.StringgetCreatorNodeId()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.StringgetDefaultCheckoutDirectory(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()DependenciesSuppliergetDependenciesSupplier()Creates a dependencies supplier from the snapshot dependencies of this build promotion.BuildDependencyGraphgetDependencyGraph()Returns dependency graph as if this build promotion is the top of the graph.List<BuildPromotionEx>getDependentCompositePromotions()DategetDetachedFromAgentDate()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)intgetExecutionTimeoutMin()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()BooleangetFreezeSettings()Returns true if we should freeze settings if it is enabled in buildType, false if settings shouldn't be frozen, null - use buildType's defaultsFilegetFrozenSettingsFile()longgetId()Returns id of this promotion, promotion id is unique among all other build promotions and is not changed during promotion life cycle.StringgetInternalBranchName()LonggetLastModificationId()Returns id of the last change associated with this promotion or null if changes collecting is not performed yet.LimitedChangesCollectiongetLimitedChanges(SelectPrevBuildPolicy policy, int limit)intgetMaximumNumberOfBuildsPerBranch()intgetNumberOfDependedOnMe()Returns total number of parent snapshot dependencies (without permissions filtering).intgetNumberOfDependencies()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.SUsergetOwner()For personal builds returns owner of the build.TeamCityNodegetOwnerNode()StringgetOwnerNodeUrl()Returns url of the node which processes this build messages.ParametergetParameter(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.ParametersProvidergetParametersProvider()Creates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.StringgetParameterValue(String paramName)BuildTypeExgetParentBuildType()Returns base build configuration to which this promotion corresponds, i.e.StringgetParentBuildTypeId()For non personal builds returns same asBuildPromotion.getBuildTypeId().LonggetPersonalChangeId()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.BuildPromotiongetPreviousBuildPromotion(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 changesOrderedBuildgetPreviousOrderedBuild(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 promotionStringgetProjectExternalId()Returns the project external idStringgetProjectId()Returns the project internal id.List<String>getProjectPathIds()Returns project path of a project where this build promotion belongs.PromotionCustomizationInfogetPromotionCustomization()Returns promotion customization details, if any Build promotion can be customized by pressing ...Map<Long,RepositoryVersion>getProvidedUpperLimitRevisions()QueuedBuildExgetQueuedBuild()Returns queued build associated with this promotion or null if there is no such build in the queueDategetQueuedDate()Returns the date when the build was added to queue.SBuildgetRealOrDummyBuild()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.SBuildgetSequenceBuild()DategetServerStartDate()Returns the timestamp when the build was removed from the queue.byte[]getSettingsDigest(boolean compute)Returns digest of build promotion settings.VcsRootInstancegetSettingsVcsRootInstance()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 promotionTopBuildDependencyGraphgetTopDependencyGraph()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.StringgetVersionedSettingsRevision(VcsRootInstance vcsRoot)Returns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.booleanhasArtifactDependencyOn(BuildPromotion dependencyBuild)Checks if this promotion artifact-depends on the passed one.booleanhasBuildFeatureOfType(String featureType)Returns true if this build promotion has a build feature of the specified typebooleanhasBuildProblemsOfType(String type)booleanhasComputedArtifactsState()booleanhasComputedChanges(SelectPrevBuildPolicy policy, VcsModificationProcessor callback)booleanhasCustomPatch()booleanhasDependencyOn(long id)booleanhasFailureReasons()booleanhasFrozenSettings()booleanhasFrozenSettingsFromVcs()booleanhasLoadedTags()Returns true if promotion loaded information about tags from dbbooleanhasStartedParent()Returns true if there exists started build which has reference to this promotionbooleanhasUnpublishedPromotionPersistingEvent()voidinitBuildProblems()Init build problems from databasebooleanisAgentLessBuild()Does it build cannot be executed on any usual agent but only by some external proccess.booleanisAssociatedBuildFinished()booleanisCanceled()Return true if associated build is canceledbooleanisChangeCollectingNeeded()Return true if change collection is required for this build promotion (otherwise, changes are collected already).booleanisChangeCollectingNeeded(boolean checkDependencies)booleanisChangesCollectingInProgress()booleanisChangesDetached()booleanisCompositeBuild()booleanisDeleted()booleanisDetachedFromAgent()booleanisEquivalentTo(BuildPromotion promotion)Returns true if this build promotion is equivalent to specified promotion, i.e.EquivalenceCheckResultisEquivalentTo(BuildPromotion promoToCompare, Boolean compareBranches)booleanisFailedToCollectChanges()booleanisFinished()booleanisForcedPostprocessingOfFrozenSettings()booleanisIncomplete()Returns whether the build promotion is incomplete (canceled).booleanisLaterThan(BuildPromotion promotion)Returns true if this promotion contains more recent changes comparing to the specified promotion.booleanisMaximumNumberOfBuildsPerBranchLimited()booleanisOutOfChangesSequence()Returns true if there is a build started before this build promotion associated build which contains more recent changes.booleanisPartOfBuildChain()booleanisPersisted()booleanisPersonal()Return true if this build promotion relates to personal buildbooleanisUsed()Returns true if there is a reference to this build promotion from queued, running or history build.booleanisVirtual()voidlockDependenciesOptimizing()voidmarkAsIncompleteIfHasFailedToStartProblems()Marks build promotion as incomplete if it has failed to start build problemsvoidmarkDeleted()Mark this promotion as deleted in the database.voidmarkIncomplete()Mark build promotion as incomplete (canceled)voidmuteBuildProblems(boolean muteIfTrue, SUser user, String comment)Makes all existing build problems enabled or disabledbooleanneedToFreezeSettings()booleanoccupiesLicenseSlot()Returns true when this build promotion should occupy one of license slots, false otherwise.voidpersist()Persists state of the build promotionvoidpersist(BuildPromotionEx.PromotionPersistMode persistMode)voidpersistDependencies()voidpersistVcsRootEntries()Persists information about VCS roots used by this build promotion to the database.voidremoveDependedOnMe(BuildPromotion promoEx)Removes link to parent promotionvoidremoveDependency(BuildPromotionEx promo)Removes dependency on specified promotionvoidreplaceDependency(BuildPromotionEx origDependency, BuildPromotionEx newDependency, DependencyOptions newOptions)Replaces dependency on one promotion with dependency to another promotionvoidresetAgentsCompatibilityCache()Resets promotion compatibility cache for all agents and agent typesvoidresetAllCompatibilityCaches()voidresetArtifactsState(boolean scheduleUpdate)Resets current artifacts state in the build promotionvoidresetBuildLog()voidresetBuildRevisions()voidresetBuildSettings()Resets cached build settings associated with promotionvoidresetChangesCache()Resets cache of changes in this promotionvoidresetDependenciesHardRefs()Each newly created build promotion keeps a reference to its direct dependencies (BuildPromotion instances).voidresetDependentOnMeCache()reset only dependent on this cache of the promotion.voidresetDirectDependenciesCache()reset only direct dependencies cache of the promotion.voidresetIncompatibleAgentsCache(Predicate<CompatibilityResult> compatibilityPredicate)voidresetIncompatibleAgentTypesCache(Predicate<CompatibilityResult> compatibilityPredicate)voidresetLogActionsCache()Reset cached audit logvoidresetRequirementsCache()voidresetTagsCache()Reset cached tagsbooleansameBranch(BuildPromotionEx promotion)booleanscheduleCheckingForChangesIfNeeded()voidsetArtifactsDirectory(File artifactsDir)Sets new artifacts directory to this build promotion.voidsetAssociatedBuild(SBuild build)Associates new build to this build promotionvoidsetAttribute(String name, Object value)Sets some attribute to the build promotionvoidsetBuildComment(User user, String comment)Assigns the build comment for this promotionvoidsetBuildRevisions(Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId)Same asBuildPromotionEx.setBuildRevisions(Collection, long, long, boolean)with validateBranch parameter set to true.voidsetBuildRevisions(Collection<BuildRevisionEx> revisions, long maxModificationId, long chainModificationId, boolean validateBranch)Sets revisions and modificationId into this build promotion.voidsetCustomArtifactDependencies(List<SArtifactDependency> dependencies)Sets custom artifact dependencies, those which override default (specified in build configuration).voidsetCustomParameters(Collection<Parameter> parameters)Same as#setCustomParameters(List)but acceptingParameterinstancesvoidsetCustomParameters(Map<String,String> buildParameters)Sets custom parameters in build promotion.voidsetDesiredBranchName(String branchName)voidsetExpirationCounter(int counter)voidsetFailedToCollectChanges(Throwable t)voidsetFinalArtifactDependencies(List<SArtifactDependency> dependencies)Sets the final artifact dependencies, i.e.voidsetFreezeSettings(Boolean freezeSettings)Indicates if we should freeze settings in buildvoidsetOverridenVcsRoots(Map<VcsRootInstance,VcsRootInstance> overridenVcsRootIds)Override default vcs roots for this promotion.voidsetOwnerNodeUrl(String url)Sets url of the node which processes this build messages.voidsetPrivateTags(List<String> labels, SUser user)Set private tags for particular user Attention! Replace all private tags related to the particular user with new setvoidsetProvidedUpperLimitRevisions(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.voidsetQueuedAt(Date queuedAt)voidsetRemoveFromQueueDate(Date removeFromQueueDate)voidsetTagDatas(Collection<TagData> tags)Changes tag set for this build promotion.voidsetTags(List<String> labels)Set public tags.voidsetVersionedSettingsRevision(VcsRootInstance vcsRoot, String revision)Remmebers versioned settings revision for the specified VCS root.voidtraverseDependedOnMe(DependencyConsumer<BuildPromotionEx> processor)Traverses all build promotions depending on this one transitively.voidtraverseDependencies(DependencyConsumer<BuildPromotionEx> processor)Traverses all build promotion dependencies (breadth first).voidtraverseSelfAndDependedOnMe(DependencyConsumer<BuildPromotionEx> consumer)voidtraverseSelfAndDependencies(DependencyConsumer<BuildPromotionEx> consumer)voidunlockDependenciesOptimizing()voidupdateAgentsCompatibilityCache(Collection<SBuildAgent> agents, BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)voidupdateDependenciesCache(Supplier<Map<Long,Integer>> newDependenciesSupplier)Updates dependencies cache of the promotion and resets "dependent on me" cache of the supplied dependencies.voidupdateFromDB(BuildPromotionEx.UpdateReason reason)Updates promotion data from databasevoidupdateSelfAndDependenciesFromDB()Updates the build promotion and all its dependencies from the databasevoidupdateStateFromBuildData(AbstractBuildData runningBuildData)Quickly updates some information in build promotion from DB information.voidwaitForChangesCollectingToFinish(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:
compareToin interfaceComparable<BuildPromotion>
-
getId
public long getId()
Description copied from interface:BuildPromotionReturns id of this promotion, promotion id is unique among all other build promotions and is not changed during promotion life cycle.- Specified by:
getIdin interfaceBuildPromotion- Specified by:
getIdin interfaceBuildPromotionInfo- Returns:
- id of this build promotion
-
getDirectDependencies
public Collection<BuildPromotionInfo> getDirectDependencies()
Description copied from interface:BuildPromotionInfoReturns direct snapshot dependencies of this build promotion- Specified by:
getDirectDependenciesin interfaceBuildPromotionInfo- Returns:
- see above
-
getParentBuildType
public BuildTypeEx getParentBuildType()
Description copied from interface:BuildPromotionReturns base build configuration to which this promotion corresponds, i.e. for personal builds returns parent build configuration, not the personal build type- Specified by:
getParentBuildTypein interfaceBuildPromotion- Specified by:
getParentBuildTypein interfaceBuildPromotionEx- Returns:
- see above
-
getBuildType
public BuildTypeEx getBuildType()
Description copied from interface:BuildPromotionReturns 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:
getBuildTypein interfaceBuildPromotion- Specified by:
getBuildTypein 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:BuildPromotionExOverride default vcs roots for this promotion.- Specified by:
setOverridenVcsRootsin interfaceBuildPromotionEx- Parameters:
overridenVcsRootIds- map from original vcs root id to substitution root id
-
getOverridenVcsRoots
@NotNull public Map<VcsRootInstance,VcsRootInstance> getOverridenVcsRoots()
Description copied from interface:BuildPromotionExGet overriden vcs root map in this promotion.- Specified by:
getOverridenVcsRootsin 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:BuildPromotionExSets some attribute to the build promotion- Specified by:
setAttributein interfaceBuildPromotionEx- Parameters:
name- attribute namevalue- attribute value
-
getAttributes
@NotNull public Map<String,Object> getAttributes()
- Specified by:
getAttributesin interfaceBuildPromotionEx- Returns:
- map of arbitrary options associated with this promotion.
-
getAttribute
@Nullable public Object getAttribute(@NotNull String attributeName)
- Specified by:
getAttributein interfaceBuildPromotionEx
-
detachChanges
public void detachChanges()
Description copied from interface:BuildPromotionExMarks build as build with detached changes, i.e. changes of this build will be shown in the next build too.- Specified by:
detachChangesin interfaceBuildPromotionEx
-
resetAgentsCompatibilityCache
public void resetAgentsCompatibilityCache()
Description copied from interface:BuildPromotionExResets promotion compatibility cache for all agents and agent types- Specified by:
resetAgentsCompatibilityCachein interfaceBuildPromotionEx
-
updateAgentsCompatibilityCache
public void updateAgentsCompatibilityCache(@NotNull Collection<SBuildAgent> agents, @NotNull BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)- Specified by:
updateAgentsCompatibilityCachein interfaceBuildPromotionEx
-
resetIncompatibleAgentsCache
public void resetIncompatibleAgentsCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)- Specified by:
resetIncompatibleAgentsCachein interfaceBuildPromotionEx
-
resetRequirementsCache
public void resetRequirementsCache()
- Specified by:
resetRequirementsCachein interfaceBuildPromotionEx
-
resetAllCompatibilityCaches
public void resetAllCompatibilityCaches()
- Specified by:
resetAllCompatibilityCachesin interfaceBuildPromotionEx
-
resetIncompatibleAgentTypesCache
public void resetIncompatibleAgentTypesCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)- Specified by:
resetIncompatibleAgentTypesCachein interfaceBuildPromotionEx
-
isChangesDetached
public boolean isChangesDetached()
- Specified by:
isChangesDetachedin 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:BuildPromotionReturns the project internal id.- Specified by:
getProjectIdin interfaceBuildPromotion- Returns:
- project internal id
-
getProjectExternalId
public String getProjectExternalId()
Description copied from interface:BuildPromotionReturns the project external id- Specified by:
getProjectExternalIdin interfaceBuildPromotion- Returns:
- project external id
-
getOwner
public SUser getOwner()
Description copied from interface:BuildPromotionFor personal builds returns owner of the build. For non personal builds returns null.- Specified by:
getOwnerin interfaceBuildPromotion- Returns:
- see above
-
getBuildTypeId
@NotNull public String getBuildTypeId()
Description copied from interface:BuildPromotionReturns internal id of build configuration to which this promotion corresponds, same asBuildPromotion.getBuildType().getBuildTypeId()- Specified by:
getBuildTypeIdin interfaceBuildPromotion- Returns:
- id of build configuration
-
getBuildTypeExternalId
@NotNull public String getBuildTypeExternalId()
Description copied from interface:BuildPromotionReturns 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_IDvalue is returned.- Specified by:
getBuildTypeExternalIdin interfaceBuildPromotion- Returns:
- the external identifier of the associated build type.
-
getParentBuildTypeId
@NotNull public String getParentBuildTypeId()
Description copied from interface:BuildPromotionFor non personal builds returns same asBuildPromotion.getBuildTypeId(). For personal builds returns id of parent build configuration: getParentBuildType().getBuildTypeId()- Specified by:
getParentBuildTypeIdin interfaceBuildPromotion- Returns:
- see above
-
getRevisions
@NotNull public List<BuildRevision> getRevisions()
Description copied from interface:BuildPromotionReturns VCS root revisions associated with this promotion.- Specified by:
getRevisionsin interfaceBuildPromotion- Returns:
- VCS root revisions
-
getRevisionsMap
@NotNull public Map<VcsRootInstance,BuildRevision> getRevisionsMap()
- Specified by:
getRevisionsMapin interfaceBuildPromotionEx
-
getAllRevisionsMap
@NotNull public Map<VcsRootInstance,BuildRevisionEx> getAllRevisionsMap()
Description copied from interface:BuildPromotionExReturns all vcs root revisions assciated with build, not only regular vcs roots attached to the build configurations.- Specified by:
getAllRevisionsMapin interfaceBuildPromotionEx- Returns:
- see above
-
getUpperLimitRevisions
@NotNull public Map<VcsRootInstance,BuildRevisionEx> getUpperLimitRevisions()
Description copied from interface:BuildPromotionExReturns 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:
getUpperLimitRevisionsin interfaceBuildPromotionEx
-
getInternalBranchName
@NotNull public String getInternalBranchName()
- Specified by:
getInternalBranchNamein 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:BuildPromotionExReturns 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:
getAutogeneratedBranchNamein interfaceBuildPromotionEx- Returns:
- auto-generated name or null if settings do not differ
-
sameBranch
public boolean sameBranch(@NotNull BuildPromotionEx promotion)- Specified by:
sameBranchin interfaceBuildPromotionEx- Returns:
- true if this promotion is from the same branch as promotion specified in parameter.
-
resetChangesCache
public void resetChangesCache()
Description copied from interface:BuildPromotionExResets cache of changes in this promotion- Specified by:
resetChangesCachein interfaceBuildPromotionEx
-
getAuditLogActions
@NotNull public List<AuditLogAction> getAuditLogActions(@Nullable AuditLogFilter filter)
- Specified by:
getAuditLogActionsin 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:
getAuditLogin interfaceBuildPromotionEx- Returns:
- audit log which can be used to log user actions for this build promotion
-
resetLogActionsCache
public void resetLogActionsCache()
Description copied from interface:BuildPromotionExReset cached audit log- Specified by:
resetLogActionsCachein interfaceBuildPromotionEx
-
resetTagsCache
public void resetTagsCache()
Description copied from interface:BuildPromotionExReset cached tags- Specified by:
resetTagsCachein interfaceBuildPromotionEx
-
getAgentCompatibility
@NotNull public CompatibilityResult getAgentCompatibility(@NotNull AgentDescription agentDescription)
- Specified by:
getAgentCompatibilityin 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:BuildPromotionExReturns 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:
getBuildSettingsin interfaceBuildPromotion- Specified by:
getBuildSettingsin interfaceBuildPromotionEx
-
updateDependenciesCache
public void updateDependenciesCache(@NotNull Supplier<Map<Long,Integer>> newDependenciesSupplier)Description copied from interface:BuildPromotionExUpdates dependencies cache of the promotion and resets "dependent on me" cache of the supplied dependencies.- Specified by:
updateDependenciesCachein interfaceBuildPromotionEx
-
getVcsRootEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootEntries()
Description copied from interface:BuildPromotionReturns VCS root entries associated with this promotion.- Specified by:
getVcsRootEntriesin interfaceBuildPromotion- Returns:
- VCS root entries
-
getVcsRootEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootEntries(boolean includeSettingsRoot)
Description copied from interface:BuildPromotionExReturns entries for VCS roots associated with this promotion. If promotion has an implicit settings root (not attached to buildType) andincludeSettingsRootistrue, then an entry for this settings root is included in the result.- Specified by:
getVcsRootEntriesin 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:BuildPromotionExReturns 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:
getRequirementsin interfaceBuildPromotionEx- Returns:
- see above
-
getRunnersRequirements
@NotNull public List<Requirement> getRunnersRequirements(@NotNull SBuildStepsCollection steps)
Description copied from interface:BuildPromotionExReturns requirements exposed by runners.- Specified by:
getRunnersRequirementsin interfaceBuildPromotionEx- Returns:
-
getBuildFeaturesRequirements
@NotNull public List<Requirement> getBuildFeaturesRequirements()
Description copied from interface:BuildPromotionExReturns requirements coming by build features, resolved- Specified by:
getBuildFeaturesRequirementsin interfaceBuildPromotionEx- Returns:
- see above
-
getContainingChanges
@NotNull public List<SVcsModification> getContainingChanges()
Description copied from interface:BuildPromotionReturns 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:
getContainingChangesin interfaceBuildPromotion- Returns:
- see above
-
getPersonalChanges
@NotNull public List<SVcsModification> getPersonalChanges()
Description copied from interface:BuildPromotionReturns personal changes associated with this build promotion. If promotion is not personal (isPersonal == false), returns empty collection.- Specified by:
getPersonalChangesin interfaceBuildPromotion- Returns:
- see above
-
getChanges
@NotNull public List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
Description copied from interface:BuildPromotionReturns changes containing in this promotion according to the specified policy. Ordering: last detected modifications goes first in the list- Specified by:
getChangesin 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:
getChangesin interfaceBuildPromotionEx
-
getLimitedChanges
@NotNull public LimitedChangesCollection getLimitedChanges(@NotNull SelectPrevBuildPolicy policy, int limit)
- Specified by:
getLimitedChangesin interfaceBuildPromotionEx
-
resetDirectDependenciesCache
public void resetDirectDependenciesCache()
Description copied from interface:BuildPromotionExreset only direct dependencies cache of the promotion.- Specified by:
resetDirectDependenciesCachein interfaceBuildPromotionEx
-
resetDependentOnMeCache
public void resetDependentOnMeCache()
Description copied from interface:BuildPromotionExreset only dependent on this cache of the promotion.- Specified by:
resetDependentOnMeCachein interfaceBuildPromotionEx
-
ensureBuildLogFlushed
public void ensureBuildLogFlushed()
Description copied from interface:BuildPromotionExMakes sure that messages in the build log buffer are flushed on disk.- Specified by:
ensureBuildLogFlushedin interfaceBuildPromotionEx
-
generateAgentAccessCode
public String generateAgentAccessCode()
Description copied from interface:BuildPromotionExGenerates agent access code for communication with TeamCity during build- Specified by:
generateAgentAccessCodein interfaceBuildPromotionEx
-
setProvidedUpperLimitRevisions
public void setProvidedUpperLimitRevisions(@NotNull Map<Long,RepositoryVersion> upperLimitRevisions)Description copied from interface:BuildPromotionExSets custom/provided upper limit revisions which will be used during the checking for changes process instead of the current repository version.- Specified by:
setProvidedUpperLimitRevisionsin 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:
getProvidedUpperLimitRevisionsin 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:BuildPromotionExReturns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.- Specified by:
getVersionedSettingsRevisionin interfaceBuildPromotionEx- Returns:
- see above
-
setVersionedSettingsRevision
public void setVersionedSettingsRevision(@NotNull VcsRootInstance vcsRoot, @NotNull String revision)Description copied from interface:BuildPromotionExRemmebers 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:
setVersionedSettingsRevisionin interfaceBuildPromotionEx
-
getAnchorBuildPromotion
@Nullable public BuildPromotionEx getAnchorBuildPromotion()
Description copied from interface:BuildPromotionExFor 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:
getAnchorBuildPromotionin interfaceBuildPromotionEx- Returns:
- see above
-
isVirtual
public boolean isVirtual()
- Specified by:
isVirtualin interfaceBuildPromotionEx- Returns:
- true if the build promotion is running in a virtual build configuration
-
occupiesLicenseSlot
public boolean occupiesLicenseSlot()
Description copied from interface:BuildPromotionExReturns 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:
occupiesLicenseSlotin interfaceBuildPromotionEx- Returns:
- see above
- See Also:
LicensingPolicy.getMaxNumberOfAuthorizedAgents()
-
resetDependenciesHardRefs
public void resetDependenciesHardRefs()
Description copied from interface:BuildPromotionExEach 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:
resetDependenciesHardRefsin interfaceBuildPromotionEx
-
getSettingsDigest
@NotNull public byte[] getSettingsDigest(boolean compute)
Description copied from interface:BuildPromotionExReturns 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:
getSettingsDigestin 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:
getArtifactStateInfoin interfaceBuildPromotionEx- Returns:
- state of the artifacts directory of this build promotion.
-
hasComputedArtifactsState
public boolean hasComputedArtifactsState()
- Specified by:
hasComputedArtifactsStatein interfaceBuildPromotionEx
-
getArtifacts
@NotNull public BuildArtifacts getArtifacts(@NotNull BuildArtifactsViewMode mode)
Description copied from interface:BuildPromotionExReturns artifacts of this build promotion.- Specified by:
getArtifactsin interfaceBuildPromotionEx- Parameters:
mode- artifacts view mode- Returns:
- object describing artifacts of this build promotion.
-
artifactsChanged
public void artifactsChanged(boolean scheduleUpdate)
Description copied from interface:BuildPromotionExShould be called when artifacts are changed on disk.- Specified by:
artifactsChangedin interfaceBuildPromotionEx- Parameters:
scheduleUpdate- if true, a task should be scheduled to update artifacts state
-
hasUnpublishedPromotionPersistingEvent
public boolean hasUnpublishedPromotionPersistingEvent()
- Specified by:
hasUnpublishedPromotionPersistingEventin 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:BuildPromotionExResets current artifacts state in the build promotion- Specified by:
resetArtifactsStatein 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:BuildPromotionReturns committers of this build selected according to specified policy- Specified by:
getCommittersin interfaceBuildPromotion- Parameters:
selectPrevBuildPolicy- policy- Returns:
- see above
-
getLastModificationId
public Long getLastModificationId()
Description copied from interface:BuildPromotionReturns 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:
getLastModificationIdin interfaceBuildPromotion- Returns:
- see above
-
getChainModificationId
@Nullable public Long getChainModificationId()
Description copied from interface:BuildPromotionExReturns 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:
getChainModificationIdin interfaceBuildPromotionEx- Returns:
- see above
-
isPersonal
public boolean isPersonal()
Description copied from interface:BuildPromotionReturn true if this build promotion relates to personal build- Specified by:
isPersonalin interfaceBuildPromotion- Returns:
- see above
-
getPersonalChangeId
public Long getPersonalChangeId()
Description copied from interface:BuildPromotionExReturns personal change id associated with this build promotion. If promotion is not personal (isPersonal == false), returns null.- Specified by:
getPersonalChangeIdin interfaceBuildPromotionEx- Returns:
- see above
-
hasCustomPatch
public boolean hasCustomPatch()
- Specified by:
hasCustomPatchin 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:BuildPromotionExReturns a collection of user-defined build and configuration parameters associated with this build promotion.- Specified by:
getCustomParametersCollectionin interfaceBuildPromotionEx- Returns:
- see above
-
getAssociatedBuild
public SBuild getAssociatedBuild()
Description copied from interface:BuildPromotionReturns running or finished build associated with this promotion or null if there is no such build.- Specified by:
getAssociatedBuildin interfaceBuildPromotion- Returns:
- see above
-
getArtifactsDirectory
@NotNull public File getArtifactsDirectory()
- Specified by:
getArtifactsDirectoryin 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:BuildPromotionChanges 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:
setTagDatasin interfaceBuildPromotion- Parameters:
tags- tags- See Also:
TagDataUtil,for variety of tag-releated actions
-
getAssociatedBuildId
public Long getAssociatedBuildId()
Description copied from interface:BuildPromotionReturns id of the build associated with this promotion, or null if there is no such build.- Specified by:
getAssociatedBuildIdin interfaceBuildPromotion- Returns:
- see above
-
getQueuedBuild
public QueuedBuildEx getQueuedBuild()
Description copied from interface:BuildPromotionReturns queued build associated with this promotion or null if there is no such build in the queue- Specified by:
getQueuedBuildin interfaceBuildPromotion- Specified by:
getQueuedBuildin interfaceBuildPromotionEx- Returns:
- see above
-
getCollectChangesError
public String getCollectChangesError()
- Specified by:
getCollectChangesErrorin interfaceBuildPromotionEx
-
isFailedToCollectChanges
public boolean isFailedToCollectChanges()
- Specified by:
isFailedToCollectChangesin interfaceBuildPromotion- Returns:
- true if process of changes collecting failed for this build
-
getBuildComment
public Comment getBuildComment()
Description copied from interface:BuildPromotionReturns build comment assigned for this promotion- Specified by:
getBuildCommentin interfaceBuildPromotion- Returns:
- build comment
-
setBuildComment
public void setBuildComment(@NotNull User user, @Nullable String comment)Description copied from interface:BuildPromotionAssigns the build comment for this promotion- Specified by:
setBuildCommentin interfaceBuildPromotion- Parameters:
user- user who sets the commentcomment- text of the comment
-
setFailedToCollectChanges
public void setFailedToCollectChanges(@Nullable Throwable t)- Specified by:
setFailedToCollectChangesin interfaceBuildPromotionEx
-
setFinalArtifactDependencies
public void setFinalArtifactDependencies(@NotNull List<SArtifactDependency> dependencies)Description copied from interface:BuildPromotionExSets the final artifact dependencies, i.e. those which must be sent to an agent.- Specified by:
setFinalArtifactDependenciesin interfaceBuildPromotionEx- Parameters:
dependencies- the artifact dependencies
-
setCustomArtifactDependencies
public void setCustomArtifactDependencies(@NotNull List<SArtifactDependency> dependencies) throws IllegalArgumentExceptionDescription copied from interface:BuildPromotionExSets 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:
setCustomArtifactDependenciesin interfaceBuildPromotionEx- Parameters:
dependencies- custom dependencies- Throws:
IllegalArgumentException
-
getCustomArtifactDependencies
@NotNull public List<SArtifactDependency> getCustomArtifactDependencies()
- Specified by:
getCustomArtifactDependenciesin interfaceBuildPromotionEx
-
getFinalArtifactDependencies
@NotNull public List<SArtifactDependency> getFinalArtifactDependencies()
- Specified by:
getFinalArtifactDependenciesin interfaceBuildPromotionEx
-
isIncomplete
public boolean isIncomplete()
Description copied from interface:BuildPromotionExReturns whether the build promotion is incomplete (canceled). Method is efficient enough, can be called often.- Specified by:
isIncompletein interfaceBuildPromotionEx- Returns:
- true iff is incomplete
-
isLaterThan
public boolean isLaterThan(@NotNull BuildPromotion promotion)Description copied from interface:BuildPromotionReturns true if this promotion contains more recent changes comparing to the specified promotion.- Specified by:
isLaterThanin interfaceBuildPromotion- Parameters:
promotion- promotion- Returns:
- see above
-
getCustomParameters
@NotNull public Map<String,String> getCustomParameters()
Description copied from interface:BuildPromotionReturns map of user-defined build and configuration parameters associated with this build promotion.- Specified by:
getCustomParametersin interfaceBuildPromotion- Returns:
- see above
-
getDefaultParameters
@NotNull public Map<String,String> getDefaultParameters()
Description copied from interface:BuildPromotionReturns 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:
getDefaultParametersin interfaceBuildPromotion- Returns:
- see above
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:BuildPromotionReturns 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, seeParametersPreprocessorfor more details.- Specified by:
getParametersin interfaceBuildPromotion- Specified by:
getParametersin interfaceBuildPromotionInfo- Specified by:
getParametersin interfaceReadOnlyUserParameters- Returns:
- see above
-
getParameterValue
@Nullable public String getParameterValue(@NotNull String paramName)
- Specified by:
getParameterValuein interfaceBuildPromotion- Specified by:
getParameterValuein 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:ReadOnlyUserParametersReturns build and configuration parameters in single collection.- Specified by:
getParametersCollectionin interfaceReadOnlyUserParameters- Returns:
- see above
-
getParameter
@Nullable public Parameter getParameter(@NotNull String paramName)
- Specified by:
getParameterin interfaceReadOnlyUserParameters
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:BuildPromotionExCreates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.- Specified by:
getParametersProviderin interfaceBuildPromotionEx
-
getBuildParameters
@NotNull public Map<String,String> getBuildParameters()
Description copied from interface:BuildPromotionReturns 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, seeParametersPreprocessorfor more details.- Specified by:
getBuildParametersin interfaceBuildPromotion- Specified by:
getBuildParametersin interfaceBuildPromotionInfo- Returns:
- see above
-
getCanRunOnAgents
@NotNull public Collection<SBuildAgent> getCanRunOnAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotionReturns 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:
getCanRunOnAgentsin interfaceBuildPromotion- Specified by:
getCanRunOnAgentsin interfaceBuildPromotionInfo- Returns:
- see above
-
getCompatibilityMap
@NotNull public Map<SBuildAgent,CompatibilityResult> getCompatibilityMap(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotionReturns 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:
getCompatibilityMapin interfaceBuildPromotion- Returns:
- see above
-
getCompatibleAgents
@NotNull public Collection<SBuildAgent> getCompatibleAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotionReturns compatible agents only, does not check that build configuration is allowed to be executed on the agents- Specified by:
getCompatibleAgentsin interfaceBuildPromotion- Returns:
- see above
-
getBranch
@Nullable public Branch getBranch()
- Specified by:
getBranchin 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:BuildPromotionReturns 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:
isEquivalentToin interfaceBuildPromotion- Parameters:
promotion- build promotion- Returns:
- see above
-
getDependencies
@NotNull public Collection<BuildDependencyEx> getDependencies()
Description copied from interface:BuildPromotionReturns the direct snapshot dependencies of this build promotion filtered according to current user permissions.- Specified by:
getDependenciesin interfaceBuildPromotion- Specified by:
getDependenciesin interfaceBuildPromotionEx- Returns:
- see above
-
getDependedOnMeIds
@NotNull public Collection<Long> getDependedOnMeIds()
- Specified by:
getDependedOnMeIdsin interfaceBuildPromotionEx
-
getDependenciesIds
@NotNull public Collection<Long> getDependenciesIds()
- Specified by:
getDependenciesIdsin interfaceBuildPromotionEx
-
hasDependencyOn
public boolean hasDependencyOn(long id)
- Specified by:
hasDependencyOnin interfaceBuildPromotionEx
-
getAllDependencies
@NotNull public List<? extends BuildPromotion> getAllDependencies()
Description copied from interface:BuildPromotionReturns 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:
getAllDependenciesin interfaceBuildPromotion- Returns:
- see above
-
getNumberOfDependencies
public int getNumberOfDependencies()
Description copied from interface:BuildPromotionReturns total number of snapshot dependencies (without permissions filtering).- Specified by:
getNumberOfDependenciesin interfaceBuildPromotion- Returns:
- see above
-
getDependedOnMe
@NotNull public Collection<BuildDependencyEx> getDependedOnMe()
Description copied from interface:BuildPromotionReturns snapshot dependencies of parent build promotions depending on this promotion. Parent build promotions are filtered according to current user permissions.- Specified by:
getDependedOnMein interfaceBuildPromotion- Specified by:
getDependedOnMein interfaceBuildPromotionEx- Returns:
- see above
-
getDependencyGraph
@NotNull public BuildDependencyGraph getDependencyGraph()
Description copied from interface:BuildPromotionExReturns dependency graph as if this build promotion is the top of the graph. See alsoBuildPromotionEx.findTops()- Specified by:
getDependencyGraphin interfaceBuildPromotionEx- Returns:
- graph with this promotion at the top
-
getTopDependencyGraph
@NotNull public TopBuildDependencyGraph getTopDependencyGraph()
Description copied from interface:BuildPromotionExReturns topmost dependency graph- Specified by:
getTopDependencyGraphin interfaceBuildPromotionEx- Returns:
- see above
-
isChangeCollectingNeeded
public boolean isChangeCollectingNeeded()
Description copied from interface:BuildPromotionExReturn true if change collection is required for this build promotion (otherwise, changes are collected already).- Specified by:
isChangeCollectingNeededin interfaceBuildPromotionEx- Returns:
- see above
-
isChangeCollectingNeeded
public boolean isChangeCollectingNeeded(boolean checkDependencies)
- Specified by:
isChangeCollectingNeededin interfaceBuildPromotionEx- Returns:
- same as
BuildPromotionEx.isChangeCollectingNeeded()but can also check dependencies
-
markIncomplete
public void markIncomplete()
Description copied from interface:BuildPromotionExMark build promotion as incomplete (canceled)- Specified by:
markIncompletein interfaceBuildPromotionEx
-
markAsIncompleteIfHasFailedToStartProblems
public void markAsIncompleteIfHasFailedToStartProblems()
Description copied from interface:BuildPromotionExMarks build promotion as incomplete if it has failed to start build problems- Specified by:
markAsIncompleteIfHasFailedToStartProblemsin interfaceBuildPromotionEx
-
markDeleted
public void markDeleted() throws IllegalStateExceptionDescription copied from interface:BuildPromotionExMark 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:
markDeletedin interfaceBuildPromotionEx- Throws:
IllegalStateException- if this promotion is associated with a build
-
isDeleted
public boolean isDeleted()
- Specified by:
isDeletedin interfaceBuildPromotionEx- Returns:
- true if promotion is marked as deleted
-
isPersisted
public boolean isPersisted()
- Specified by:
isPersistedin 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:BuildPromotionExReturns true if there exists started build which has reference to this promotion- Specified by:
hasStartedParentin interfaceBuildPromotionEx- Returns:
- see above
-
persist
public void persist()
Description copied from interface:BuildPromotionExPersists state of the build promotion- Specified by:
persistin interfaceBuildPromotionEx
-
persist
public void persist(BuildPromotionEx.PromotionPersistMode persistMode)
- Specified by:
persistin interfaceBuildPromotionEx
-
clearPrevPromotionCache
public void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)- Specified by:
clearPrevPromotionCachein interfaceBuildPromotionEx
-
getNumberOfDependedOnMe
public int getNumberOfDependedOnMe()
Description copied from interface:BuildPromotionReturns total number of parent snapshot dependencies (without permissions filtering).- Specified by:
getNumberOfDependedOnMein interfaceBuildPromotion- Returns:
- see above
-
findTops
public BuildPromotionEx[] findTops()
Description copied from interface:BuildPromotionReturn 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:
findTopsin interfaceBuildPromotion- Specified by:
findTopsin interfaceBuildPromotionEx- Returns:
- see above
-
traverseDependedOnMe
public void traverseDependedOnMe(@NotNull DependencyConsumer<BuildPromotionEx> processor)Description copied from interface:BuildPromotionExTraverses all build promotions depending on this one transitively. If processor returns false, traversing stops.- Specified by:
traverseDependedOnMein interfaceBuildPromotionEx
-
traverseSelfAndDependedOnMe
public void traverseSelfAndDependedOnMe(@NotNull DependencyConsumer<BuildPromotionEx> consumer)- Specified by:
traverseSelfAndDependedOnMein interfaceBuildPromotionEx
-
traverseDependencies
public void traverseDependencies(@NotNull DependencyConsumer<BuildPromotionEx> processor)Description copied from interface:BuildPromotionExTraverses all build promotion dependencies (breadth first). If processor returns false, traversing stops.- Specified by:
traverseDependenciesin interfaceBuildPromotionEx
-
traverseSelfAndDependencies
public void traverseSelfAndDependencies(@NotNull DependencyConsumer<BuildPromotionEx> consumer)- Specified by:
traverseSelfAndDependenciesin interfaceBuildPromotionEx
-
findSelfOrDependencyWithProblem
@Nullable public BuildPromotionEx findSelfOrDependencyWithProblem(@NotNull Predicate<BuildProblemData> predicate)
Description copied from interface:BuildPromotionExTraverses 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:
findSelfOrDependencyWithProblemin 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:BuildPromotionExSame asBuildPromotionEx.setBuildRevisions(Collection, long, long, boolean)with validateBranch parameter set to true.- Specified by:
setBuildRevisionsin 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:BuildPromotionExSets revisions and modificationId into this build promotion. If revisions list is empty, that means that changes were not collected for this build- Specified by:
setBuildRevisionsin 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:
resetBuildRevisionsin interfaceBuildPromotionEx
-
setCustomParameters
public void setCustomParameters(@NotNull Map<String,String> buildParameters)Description copied from interface:BuildPromotionExSets 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:
setCustomParametersin interfaceBuildPromotionEx- Parameters:
buildParameters- custom parameters
-
setCustomParameters
public void setCustomParameters(@NotNull Collection<Parameter> parameters)Description copied from interface:BuildPromotionExSame as#setCustomParameters(List)but acceptingParameterinstances- Specified by:
setCustomParametersin interfaceBuildPromotionEx
-
setAssociatedBuild
public void setAssociatedBuild(@Nullable SBuild build)Description copied from interface:BuildPromotionExAssociates new build to this build promotion- Specified by:
setAssociatedBuildin interfaceBuildPromotionEx
-
addDependency
public void addDependency(@NotNull BuildPromotionEx promo, @NotNull DependencyOptions options) throws IllegalArgumentExceptionDescription copied from interface:BuildPromotionExAdds a build dependency- Specified by:
addDependencyin 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:BuildPromotionExRemoves dependency on specified promotion- Specified by:
removeDependencyin interfaceBuildPromotionEx
-
replaceDependency
public void replaceDependency(@NotNull BuildPromotionEx origDependency, @NotNull BuildPromotionEx newDependency, @NotNull DependencyOptions newOptions)Description copied from interface:BuildPromotionExReplaces dependency on one promotion with dependency to another promotion- Specified by:
replaceDependencyin interfaceBuildPromotionEx- Parameters:
origDependency- original promotionnewDependency- replacement
-
addToQueue
public SQueuedBuild addToQueue(@NotNull String triggeredBy)
Description copied from interface:BuildPromotionCreates 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:
addToQueuein 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:BuildPromotionCreates 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:
addToQueuein 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:BuildPromotionReturns previous promotion created before this one and corresponding to the specified policy.- Specified by:
getPreviousBuildPromotionin interfaceBuildPromotion- Parameters:
policy- policy- Returns:
- see above
-
isUsed
public boolean isUsed()
Description copied from interface:BuildPromotionReturns true if there is a reference to this build promotion from queued, running or history build.- Specified by:
isUsedin interfaceBuildPromotion- Returns:
- see above
-
copy
public BuildPromotionEx copy(boolean copyRevisions)
Description copied from interface:BuildPromotionCreates 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:
copyin interfaceBuildPromotion- Specified by:
copyin 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:
getSequenceBuildin interfaceBuildPromotionEx- See Also:
BuildPromotionOwner.getSequenceBuild()
-
getStartedEquivalentPromotions
@NotNull public List<BuildPromotionEx> getStartedEquivalentPromotions(int maxNumToProcess)
Description copied from interface:BuildPromotionExReturns build promotions with associated builds and equivalent to this build promotion (same settings, changes and revisions)- Specified by:
getStartedEquivalentPromotionsin 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:BuildPromotionExReturns build promotions from the build queue equivalent to this build promotion (same settings, changes and revisions)- Specified by:
getEquivalentPromotionsin interfaceBuildPromotionEx- Returns:
- see above
-
isChangesCollectingInProgress
public boolean isChangesCollectingInProgress()
- Specified by:
isChangesCollectingInProgressin interfaceBuildPromotionEx
-
waitForChangesCollectingToFinish
public void waitForChangesCollectingToFinish(long timeoutMillis) throws InterruptedException, ExecutionException, TimeoutException, CancellationExceptionDescription copied from interface:BuildPromotionExIf checking for changes is in progress, blocks for the specified timeout- Specified by:
waitForChangesCollectingToFinishin interfaceBuildPromotionEx- Parameters:
timeoutMillis- timeout in milliseconds- Throws:
TimeoutException- if operation did not finish within specified timeoutInterruptedExceptionExecutionExceptionCancellationException
-
lockDependenciesOptimizing
public void lockDependenciesOptimizing()
- Specified by:
lockDependenciesOptimizingin interfaceBuildPromotionEx
-
unlockDependenciesOptimizing
public void unlockDependenciesOptimizing()
- Specified by:
unlockDependenciesOptimizingin interfaceBuildPromotionEx
-
addDependedOnMe
public void addDependedOnMe(@NotNull BuildPromotionEx promoEx, @NotNull DependencyOptions options)Description copied from interface:BuildPromotionExAdds link to parent promotion- Specified by:
addDependedOnMein interfaceBuildPromotionEx
-
addDependedOnMeIfCached
public void addDependedOnMeIfCached(@NotNull BuildPromotionEx promotion, @NotNull DependencyOptions options)Description copied from interface:BuildPromotionExAdds link to parent promotion only if depended on me list is already loaded from DB for this promotion- Specified by:
addDependedOnMeIfCachedin interfaceBuildPromotionEx
-
removeDependedOnMe
public void removeDependedOnMe(@NotNull BuildPromotion promoEx)Description copied from interface:BuildPromotionExRemoves link to parent promotion- Specified by:
removeDependedOnMein interfaceBuildPromotionEx
-
isOutOfChangesSequence
public boolean isOutOfChangesSequence()
Description copied from interface:BuildPromotionReturns true if there is a build started before this build promotion associated build which contains more recent changes.- Specified by:
isOutOfChangesSequencein interfaceBuildPromotion- Returns:
- see above
-
isPartOfBuildChain
public boolean isPartOfBuildChain()
- Specified by:
isPartOfBuildChainin 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:BuildPromotionReturn true if associated build is canceled- Specified by:
isCanceledin interfaceBuildPromotion- Returns:
- see above
-
getArtifactDependencies
@NotNull public List<SArtifactDependency> getArtifactDependencies()
Description copied from interface:BuildPromotionReturns 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:
getArtifactDependenciesin interfaceBuildPromotion- Returns:
- see above
-
setDesiredBranchName
public void setDesiredBranchName(@NotNull String branchName)- Specified by:
setDesiredBranchNamein interfaceBuildPromotion
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy)
- Specified by:
getDetectedChangesin interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChangesin interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
getDetectedChangesin interfaceBuildPromotionEx
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)- Specified by:
fillDetectedChangesin 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:BuildPromotionExReturns changes according to the specified options- Specified by:
getDetectedChangesin interfaceBuildPromotionEx- Parameters:
options- changes calculation options- Returns:
- see above
-
getOwnChanges
@NotNull public List<SVcsModification> getOwnChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotionExReturns changes in this promotion computed according to specified options, doesn't include changes from dependencies.- Specified by:
getOwnChangesin interfaceBuildPromotionEx- Parameters:
options- changes calculation options- Returns:
- see above
-
getChanges
@NotNull public BuildChanges getChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotionReturns build changes according to the specified options- Specified by:
getChangesin interfaceBuildPromotion- Parameters:
options- changes calculation options- Returns:
- see above
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull ChangesCalculationOptionsEx options)Description copied from interface:BuildPromotionExComputes changes according to the specified options and add them to the given accumulator- Specified by:
fillDetectedChangesin interfaceBuildPromotionEx- Parameters:
accumulator- accumulator for changesoptions- changes calculation options
-
hasComputedChanges
public boolean hasComputedChanges(@NotNull SelectPrevBuildPolicy policy, @NotNull VcsModificationProcessor callback)- Specified by:
hasComputedChangesin interfaceBuildPromotionEx
-
getPersonalChanges
@NotNull public List<ChangeDescriptor> getPersonalChanges(@NotNull List<ChangeDescriptor> allChanges)
Description copied from interface:BuildPromotionExTakes 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:
getPersonalChangesin interfaceBuildPromotionEx- Returns:
-
getDetectedChangesProviders
@NotNull public List<BuildDetectedChangesProvider> getDetectedChangesProviders(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChangesProvidersin 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:
getCanRunOnAgentTypesin interfaceBuildPromotionEx
-
getCompatibleAgentTypes
@NotNull public Collection<SAgentType> getCompatibleAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCompatibleAgentTypesin interfaceBuildPromotionEx
-
getAgentTypeCompatibilityMap
@NotNull public Map<SAgentType,CompatibilityResult> getAgentTypeCompatibilityMap(@NotNull Collection<SAgentType> available)
Description copied from interface:BuildPromotionExReturns 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:
getAgentTypeCompatibilityMapin interfaceBuildPromotionEx- Returns:
-
getCheckoutDirectory
public String getCheckoutDirectory()
- Specified by:
getCheckoutDirectoryin interfaceBuildPromotionEx
-
getDefaultCheckoutDirectory
@NotNull public String getDefaultCheckoutDirectory(BuildTypeDescriptor.CheckoutType checkoutType)
Description copied from interface:BuildPromotionExReturns name of the checkout directory that should be used for the build if explicit checkout directory is not specified. Don't acceptBuildTypeDescriptor.CheckoutType.AUTO, throwingIllegalArgumentExceptionif it's passed.- Specified by:
getDefaultCheckoutDirectoryin interfaceBuildPromotionEx
-
getRealOrDummyBuild
@NotNull public SBuild getRealOrDummyBuild()
- Specified by:
getRealOrDummyBuildin interfaceBuildPromotionEx
-
addBuildProblem
public void addBuildProblem(@NotNull BuildProblemData buildProblem)Description copied from interface:BuildPromotionExAdds build problem, currently it actually causes build failure- Specified by:
addBuildProblemin interfaceBuildPromotionEx
-
getFailureReasons
@NotNull public List<BuildProblemData> getFailureReasons()
Description copied from interface:BuildPromotionExReturns 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:
getFailureReasonsin interfaceBuildPromotionEx
-
hasFailureReasons
public boolean hasFailureReasons()
- Specified by:
hasFailureReasonsin interfaceBuildPromotionEx
-
getBuildProblems
@NotNull public List<BuildProblem> getBuildProblems()
Description copied from interface:BuildPromotionExReturns all build problems for this promotion with extended information about muting. The problems are sorted in order of their appearance.- Specified by:
getBuildProblemsin interfaceBuildPromotionEx- Returns:
- see above
-
getUnsortedBuildProblems
@NotNull public Collection<BuildProblem> getUnsortedBuildProblems()
Description copied from interface:BuildPromotionExSame asBuildPromotionEx.getBuildProblems()but returns problems in any order and can work faster because of that.- Specified by:
getUnsortedBuildProblemsin interfaceBuildPromotionEx- Returns:
- build problems in no particular order
-
getBuildChainProblems
@NotNull public List<BuildProblem> getBuildChainProblems(boolean omitInduced)
Description copied from interface:BuildPromotionExIf 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:
getBuildChainProblemsin 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:
hasBuildProblemsOfTypein interfaceBuildPromotionEx- Returns:
- true if there are build problems with specified type
-
deleteBuildProblem
public void deleteBuildProblem(@NotNull String identity)Description copied from interface:BuildPromotionExDeletes build problem Deleting build problem may change build status to SUCCESS- Specified by:
deleteBuildProblemin interfaceBuildPromotionEx- Parameters:
identity- identiry of build problem to be removed
-
updateStateFromBuildData
public void updateStateFromBuildData(@NotNull AbstractBuildData runningBuildData)Description copied from interface:BuildPromotionExQuickly updates some information in build promotion from DB information. Doesn't store anything back to DB- Specified by:
updateStateFromBuildDatain interfaceBuildPromotionEx
-
updateFromDB
public void updateFromDB(@NotNull BuildPromotionEx.UpdateReason reason)Description copied from interface:BuildPromotionExUpdates promotion data from database- Specified by:
updateFromDBin interfaceBuildPromotionEx
-
updateSelfAndDependenciesFromDB
public void updateSelfAndDependenciesFromDB()
Description copied from interface:BuildPromotionExUpdates the build promotion and all its dependencies from the database- Specified by:
updateSelfAndDependenciesFromDBin interfaceBuildPromotionEx
-
initBuildProblems
public void initBuildProblems()
Description copied from interface:BuildPromotionExInit build problems from database- Specified by:
initBuildProblemsin interfaceBuildPromotionEx
-
muteBuildProblems
public void muteBuildProblems(boolean muteIfTrue, @Nullable SUser user, @Nullable String comment)Description copied from interface:BuildPromotionExMakes all existing build problems enabled or disabled- Specified by:
muteBuildProblemsin interfaceBuildPromotionEx- Parameters:
muteIfTrue- pass true to make build successful, false to make existing problems visible again
-
getBuildLog
@NotNull public BuildLogEx getBuildLog()
- Specified by:
getBuildLogin interfaceBuildPromotion- Specified by:
getBuildLogin 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:
getBuildLogIfInitializedin interfaceBuildPromotionEx
-
createOrderedBuild
@NotNull public OrderedBuild createOrderedBuild()
Description copied from interface:BuildPromotionExReturns 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:
createOrderedBuildin interfaceBuildPromotionEx- Returns:
- see above
-
getTagDatas
@NotNull public Collection<TagData> getTagDatas()
Description copied from interface:BuildPromotionReturns list of all tags for this build promotion, no special order is preserved- Specified by:
getTagDatasin interfaceBuildPromotion- Returns:
- tags
- See Also:
TagDataUtil,for variety of tag-releated actions
-
hasLoadedTags
public boolean hasLoadedTags()
Description copied from interface:BuildPromotionExReturns true if promotion loaded information about tags from db- Specified by:
hasLoadedTagsin interfaceBuildPromotionEx- Returns:
- see above
-
isEquivalentTo
@NotNull public EquivalenceCheckResult isEquivalentTo(@NotNull BuildPromotion promoToCompare, @Nullable Boolean compareBranches)
- Specified by:
isEquivalentToin 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:BuildPromotionExSets 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:
setArtifactsDirectoryin interfaceBuildPromotionEx- Parameters:
artifactsDir- new artifacts directory
-
isFinished
public boolean isFinished()
- Specified by:
isFinishedin 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:BuildPromotionExReturns 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:
getProjectPathIdsin interfaceBuildPromotionEx
-
getOwnerNodeUrl
@Nullable public String getOwnerNodeUrl()
Description copied from interface:BuildPromotionExReturns url of the node which processes this build messages. Returns null if this build promotion is not assigned to any node. ReturnsBuildPromotionEx.MAIN_NODE_MARKERif build promotion was specifically assigned to main node.- Specified by:
getOwnerNodeUrlin interfaceBuildPromotionEx
-
getOwnerNode
@Nullable public TeamCityNode getOwnerNode()
- Specified by:
getOwnerNodein 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:BuildPromotionExSets url of the node which processes this build messages.- Specified by:
setOwnerNodeUrlin interfaceBuildPromotionEx
-
getPreviousBuilds
@NotNull public Stream<OrderedBuild> getPreviousBuilds(@NotNull Filter<String> branchFilter)
Description copied from interface:BuildPromotionExReturns stream of previous builds matched by specified branch filter and ordered by changes- Specified by:
getPreviousBuildsin interfaceBuildPromotionEx- Parameters:
branchFilter- filter of interest- Returns:
- see above
-
getPrivateTags
@NotNull public List<String> getPrivateTags(@NotNull SUser user)
Description copied from interface:BuildPromotionReturns list of private tag labels in lexicographical order for particular user for this build promotion- Specified by:
getPrivateTagsin interfaceBuildPromotion- Returns:
- tags
-
setPrivateTags
public void setPrivateTags(@Nullable List<String> labels, @NotNull SUser user)Description copied from interface:BuildPromotionSet private tags for particular user Attention! Replace all private tags related to the particular user with new set- Specified by:
setPrivateTagsin 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:BuildPromotionReturns list of public tag labels in lexicographical order for the build promotion- Specified by:
getTagsin interfaceBuildPromotion- Returns:
- tags
-
setTags
public void setTags(List<String> labels)
Description copied from interface:BuildPromotionSet public tags. Attention! Replace old public tags set with new one.- Specified by:
setTagsin interfaceBuildPromotion- Parameters:
labels- tag labels- See Also:
for variety of tag-releated actions
-
getQueuedDate
@NotNull public Date getQueuedDate()
Description copied from interface:BuildPromotionReturns the date when the build was added to queue.- Specified by:
getQueuedDatein interfaceBuildPromotion- Returns:
- queued time, null if promotion wasn't queued
-
getServerStartDate
@NotNull public Date getServerStartDate()
Description copied from interface:BuildPromotionReturns the timestamp when the build was removed from the queue.- Specified by:
getServerStartDatein 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:
setQueuedAtin interfaceBuildPromotionEx
-
setRemoveFromQueueDate
public void setRemoveFromQueueDate(@NotNull Date removeFromQueueDate)- Specified by:
setRemoveFromQueueDatein interfaceBuildPromotionEx
-
resetBuildLog
public void resetBuildLog()
- Specified by:
resetBuildLogin interfaceBuildPromotionEx
-
buildFinished
public void buildFinished()
Description copied from interface:BuildPromotionExMust be called when build history entry created for this promotion.- Specified by:
buildFinishedin interfaceBuildPromotionEx
-
buildEvictedFromCache
public void buildEvictedFromCache()
Description copied from interface:BuildPromotionExCalled 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:
buildEvictedFromCachein interfaceBuildPromotionEx
-
associatedBuildFinished
public void associatedBuildFinished()
- Specified by:
associatedBuildFinishedin interfaceBuildPromotionEx
-
isForcedPostprocessingOfFrozenSettings
public boolean isForcedPostprocessingOfFrozenSettings()
- Specified by:
isForcedPostprocessingOfFrozenSettingsin 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:BuildPromotionExFreeze buildType settings for this promotion. After call to this method a promotion will use frozen buildType settings instead of current ones.- Specified by:
freezeSettingsin interfaceBuildPromotionEx
-
freezeSettings
public void freezeSettings(@NotNull BuildTypeEx buildType, @NotNull String settingsOrigin) throws IOExceptionDescription copied from interface:BuildPromotionExFreeze 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:
freezeSettingsin 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 IOExceptionDescription copied from interface:BuildPromotionExFreeze settings for this promotion using the given buildSettings.- Specified by:
freezeSettingsin 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:BuildPromotionExFreeze settings for this promotion using the given buildSettings and mark that postprocessing is still required for this promotion.- Specified by:
freezeSettingsWithForcedPostprocessingin 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 IOExceptionDescription copied from interface:BuildPromotionExFreeze settings for this promotion using the given settings file.- Specified by:
freezeSettingsin 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:BuildPromotionExIndicates if we should freeze settings in build- Specified by:
setFreezeSettingsin 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:BuildPromotionExReturns 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:
getFreezeSettingsin interfaceBuildPromotionEx- Returns:
- see above
-
getFrozenSettingsFile
@NotNull public File getFrozenSettingsFile()
- Specified by:
getFrozenSettingsFilein interfaceBuildPromotionEx- Returns:
- path to file with frozen settings.
-
hasFrozenSettings
public boolean hasFrozenSettings()
- Specified by:
hasFrozenSettingsin interfaceBuildPromotionEx- Returns:
- true if settings of this promotion were frozen.
-
hasFrozenSettingsFromVcs
public boolean hasFrozenSettingsFromVcs()
- Specified by:
hasFrozenSettingsFromVcsin interfaceBuildPromotionEx- Returns:
- true if this promotion has frozen settins from VCS
-
needToFreezeSettings
public boolean needToFreezeSettings()
- Specified by:
needToFreezeSettingsin interfaceBuildPromotionEx- Returns:
- true if there was no attempt to freeze settings (successful or failed)
-
scheduleCheckingForChangesIfNeeded
public boolean scheduleCheckingForChangesIfNeeded()
- Specified by:
scheduleCheckingForChangesIfNeededin 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:
cancelCheckingForChangesin interfaceBuildPromotionEx
-
containsChange
public boolean containsChange(@NotNull SVcsModification m)Description copied from interface:BuildPromotionExReturns true if promotion contains specified modification among its changes. Takes only own changes into account (does not use changes from dependencies).- Specified by:
containsChangein interfaceBuildPromotionEx- Parameters:
m- modification of interest- Returns:
- see above
-
isCompositeBuild
public boolean isCompositeBuild()
- Specified by:
isCompositeBuildin interfaceBuildPromotion- Specified by:
isCompositeBuildin 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:
getCreatorNodeIdin interfaceBuildPromotion- Returns:
- node id which created the build promotion.
-
hasBuildFeatureOfType
public boolean hasBuildFeatureOfType(@NotNull String featureType)Description copied from interface:BuildPromotionReturns true if this build promotion has a build feature of the specified type- Specified by:
hasBuildFeatureOfTypein 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:BuildPromotionReturns 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:
getBuildFeaturesOfTypein 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:
allDependenciesFinishedin interfaceBuildPromotionEx- Returns:
- true if all direct dependencies of this build promotion are finished
-
getDependentCompositePromotions
@NotNull public List<BuildPromotionEx> getDependentCompositePromotions()
- Specified by:
getDependentCompositePromotionsin interfaceBuildPromotionEx- Returns:
- list of all composite promotions depending on this build promotion either directly or transitively
-
getSettingsVcsRootInstance
@Nullable public VcsRootInstance getSettingsVcsRootInstance()
- Specified by:
getSettingsVcsRootInstancein interfaceBuildPromotionEx- Returns:
- settings VCS root associated with this promotion
-
decreaseExpirationCounter
public int decreaseExpirationCounter(int decreaseAmount)
- Specified by:
decreaseExpirationCounterin interfaceBuildPromotionEx
-
setExpirationCounter
public void setExpirationCounter(int counter)
- Specified by:
setExpirationCounterin interfaceBuildPromotionEx
-
isAssociatedBuildFinished
public boolean isAssociatedBuildFinished()
- Specified by:
isAssociatedBuildFinishedin interfaceBuildPromotionEx
-
resetBuildSettings
public void resetBuildSettings()
Description copied from interface:BuildPromotionExResets cached build settings associated with promotion- Specified by:
resetBuildSettingsin interfaceBuildPromotionEx
-
hasArtifactDependencyOn
public boolean hasArtifactDependencyOn(@NotNull BuildPromotion dependencyBuild)Description copied from interface:BuildPromotionExChecks if this promotion artifact-depends on the passed one. Especially useful for queued and running builds- Specified by:
hasArtifactDependencyOnin interfaceBuildPromotionEx
-
getBuildPromotionsWithArtifactDependenciesOnMe
@NotNull public List<BuildPromotion> getBuildPromotionsWithArtifactDependenciesOnMe(@NotNull List<BuildPromotion> buildPromotions)
Description copied from interface:BuildPromotionExChecks 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:
getBuildPromotionsWithArtifactDependenciesOnMein interfaceBuildPromotionEx- Parameters:
buildPromotions- build promotions to check- Returns:
- the dependent build promotions
-
isAgentLessBuild
public boolean isAgentLessBuild()
Description copied from interface:BuildPromotionExDoes it build cannot be executed on any usual agent but only by some external proccess.- Specified by:
isAgentLessBuildin interfaceBuildPromotionEx- Specified by:
isAgentLessBuildin 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:
isDetachedFromAgentin interfaceBuildPromotionEx- Returns:
- true if the corresponding build was detached from agent at some point and became agentless
-
getDetachedFromAgentDate
@Nullable public Date getDetachedFromAgentDate()
- Specified by:
getDetachedFromAgentDatein 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:BuildPromotionExReturns previous OrderedBuild instance which corresponds to a build promotion which is created before this one and corresponding to the specified policy.- Specified by:
getPreviousOrderedBuildin interfaceBuildPromotionEx- Parameters:
policy- policy- Returns:
- see above
-
persistVcsRootEntries
public void persistVcsRootEntries()
Description copied from interface:BuildPromotionExPersists information about VCS roots used by this build promotion to the database.- Specified by:
persistVcsRootEntriesin interfaceBuildPromotionEx
-
persistDependencies
public void persistDependencies()
- Specified by:
persistDependenciesin interfaceBuildPromotionEx
-
getExecutionTimeoutMin
public int getExecutionTimeoutMin()
Description copied from interface:BuildPromotionExReturns build execution timeout in minutes, 0 indicates that there is no limit- Specified by:
getExecutionTimeoutMinin interfaceBuildPromotionEx
-
getPromotionCustomization
@NotNull public PromotionCustomizationInfo getPromotionCustomization()
Description copied from interface:BuildPromotionExReturns 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:
getPromotionCustomizationin interfaceBuildPromotionEx- Returns:
- see above
-
getCommitters
@NotNull public Set<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy, int maxChangesToProcess)
Description copied from interface:BuildPromotionExSame asBuildPromotion.getCommitters(SelectPrevBuildPolicy)but allows to control number of changes which should be looked up when committers are computed.- Specified by:
getCommittersin 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:
createBuildPromotionAccessCheckerin interfaceBuildPromotionEx
-
getDependenciesSupplier
@NotNull public DependenciesSupplier getDependenciesSupplier()
Description copied from interface:BuildPromotionExCreates a dependencies supplier from the snapshot dependencies of this build promotion.- Specified by:
getDependenciesSupplierin interfaceBuildPromotionEx- Returns:
- see above
-
getMaximumNumberOfBuildsPerBranch
public int getMaximumNumberOfBuildsPerBranch()
- Specified by:
getMaximumNumberOfBuildsPerBranchin interfaceBuildPromotionEx- Returns:
- see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
isMaximumNumberOfBuildsPerBranchLimited
public boolean isMaximumNumberOfBuildsPerBranchLimited()
- Specified by:
isMaximumNumberOfBuildsPerBranchLimitedin interfaceBuildPromotionEx- Returns:
- true if number of builds per branch is limited, see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
-