Class AbstractBuildPromotion
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.AbstractBuildPromotion
-
- All Implemented Interfaces:
Comparable<BuildPromotion>
,BuildPromotionInfo
,BuildPromotion
,BuildPromotionEx
,InternalParameters
,ReadOnlyUserParameters
- Direct Known Subclasses:
BuildPromotionImpl
,DummyBuildPromotion
public abstract class AbstractBuildPromotion extends Object implements BuildPromotionEx
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractBuildPromotion.CandidatesCache<A extends AgentDescription>
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildPromotionEx
BuildPromotionEx.ArtifactsState, BuildPromotionEx.ArtifactsStateInfo, BuildPromotionEx.CompatibilityCacheUpdateMode, BuildPromotionEx.PromotionPersistMode, BuildPromotionEx.UpdateReason
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROVIDED_UPPER_LIMIT_REVISION_REV_ATTR_PREFIX
static String
PROVIDED_UPPER_LIMIT_REVISION_VCS_BRANCH_ATTR_PREFIX
static String
VERSIONED_SETTINGS_REVISION_PREFIX
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearPrevPromotionCache(Collection<BuildPromotion> targetPromos)
boolean
containsChange(SVcsModification m)
Returns true if promotion contains specified modification among its changes.OrderedBuild
createOrderedBuild()
Returns an OrderedBuild with all fields filled.void
fillDetectedChanges(List<ChangeDescriptor> accumulator, ChangesCalculationOptionsEx options)
Computes changes according to the specified options and add them to the given accumulatorvoid
fillDetectedChanges(List<ChangeDescriptor> accumulator, SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges, VcsModificationProcessor callback)
BuildPromotionEx
findSelfOrDependencyWithProblem(Predicate<BuildProblemData> predicate)
Traverses build problems of the current build promotion and all of its dependencies using breadth first search and returns the first one for which the supplied predicate returns trueCompatibilityResult
getAgentCompatibility(AgentDescription agentDescription)
Map<SAgentType,CompatibilityResult>
getAgentTypeCompatibilityMap(Collection<SAgentType> available)
Returns map of agent types to compatibility result.List<BuildPromotionEx>
getAllDependencies()
Returns the full list of snapshot dependencies (including transitive ones) of this build promotion filtered according to current user permissions.BuildPromotionEx
getAnchorBuildPromotion()
For the build promotion which runs in a virtual build configuration returns a build promotion which created it.Collection<SBuildFeatureDescriptor>
getBuildFeaturesOfType(String featureType)
Returns settings of the enabled build features of the specified type.List<Requirement>
getBuildFeaturesRequirements()
Returns requirements coming by build features, resolvedprotected BuildPromotionManagerEx
getBuildPromotionManager()
Collection<SBuildAgent>
getCanRunOnAgents(Collection<SBuildAgent> available)
Returns collection of agents where this build promotion can be executed.Collection<SAgentType>
getCanRunOnAgentTypes(Collection<SAgentType> available)
BuildChanges
getChanges(ChangesCalculationOptions options)
Returns build changes according to the specified optionsList<SVcsModification>
getChanges(SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
Returns changes containing in this promotion according to the specified policy.List<SVcsModification>
getChanges(SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild, VcsModificationProcessor callback)
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.protected BuildPromotionContext
getContext()
DependenciesSupplier
getDependenciesSupplier()
Creates a dependencies supplier from the snapshot dependencies of this build promotion.BuildDependencyGraph
getDependencyGraph()
Returns dependency graph as if this build promotion is the top of the graph.Date
getDetachedFromAgentDate()
List<ChangeDescriptor>
getDetectedChanges(ChangesCalculationOptionsEx options)
Returns changes according to the specified optionsList<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy)
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges, VcsModificationProcessor callback)
List<BuildDetectedChangesProvider>
getDetectedChangesProviders(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)
protected DummyBuild
getDummyBuild()
LimitedChangesCollection
getLimitedChanges(SelectPrevBuildPolicy policy, int limit)
int
getMaximumNumberOfBuildsPerBranch()
List<SVcsModification>
getOwnChanges(ChangesCalculationOptions options)
Returns changes in this promotion computed according to specified options, doesn't include changes from dependencies.ParametersProvider
getParametersProvider()
Creates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.List<SVcsModification>
getPersonalChanges()
Returns personal changes associated with this build promotion.List<ChangeDescriptor>
getPersonalChanges(List<ChangeDescriptor> allChanges)
Takes all changes and returns only those that belong to current owner of build promotion.BuildPromotion
getPreviousBuildPromotion(SelectPrevBuildPolicy policy)
Returns previous promotion created before this one and corresponding to the specified policy.Stream<OrderedBuild>
getPreviousBuilds(Filter<String> branchFilter)
Returns stream of previous builds matched by specified branch filter and ordered by changesOrderedBuild
getPreviousOrderedBuild(SelectPrevBuildPolicy policy)
Returns previous OrderedBuild instance which corresponds to a build promotion which is created before this one and corresponding to the specified policy.PromotionCustomizationInfo
getPromotionCustomization()
Returns promotion customization details, if any Build promotion can be customized by pressing ...Map<Long,RepositoryVersion>
getProvidedUpperLimitRevisions()
SBuild
getRealOrDummyBuild()
List<Requirement>
getRequirements()
Returns requirements configured for this build promotion.List<Requirement>
getRunnersRequirements(SBuildStepsCollection buildSteps)
Returns requirements exposed by runners.byte[]
getSettingsDigest(boolean compute)
Returns digest of build promotion settings.VcsRootInstance
getSettingsVcsRootInstance()
TopBuildDependencyGraph
getTopDependencyGraph()
Returns topmost dependency graphMap<VcsRootInstance,BuildRevisionEx>
getUpperLimitRevisions()
Returns upper limit revisions which were available when checking for changes operation was performed.String
getVersionedSettingsRevision(VcsRootInstance vcsRoot)
Returns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.boolean
hasArtifactDependencyOn(BuildPromotion dependencyBuild)
Checks if this promotion artifact-depends on the passed one.boolean
hasBuildFeatureOfType(String featureType)
Returns true if this build promotion has a build feature of the specified typeboolean
hasComputedChanges(SelectPrevBuildPolicy policy, VcsModificationProcessor callback)
boolean
isAgentLessBuild()
Does it build cannot be executed on any usual agent but only by some external proccess.boolean
isDetachedFromAgent()
boolean
isMaximumNumberOfBuildsPerBranchLimited()
boolean
isVirtual()
protected int
maxChangesToStoreInCache(boolean returnChangesIfNoPreviousBuild)
boolean
occupiesLicenseSlot()
Returns true when this build promotion should occupy one of license slots, false otherwise.void
resetAgentsCompatibilityCache()
Resets promotion compatibility cache for all agents and agent typesvoid
resetAllCompatibilityCaches()
void
resetChangesCache()
Resets cache of changes in this promotionvoid
resetIncompatibleAgentsCache(Predicate<CompatibilityResult> compatibilityPredicate)
void
resetIncompatibleAgentTypesCache(Predicate<CompatibilityResult> compatibilityPredicate)
void
resetRequirementsCache()
boolean
sameBranch(BuildPromotionEx promotion)
void
setProvidedUpperLimitRevisions(Map<Long,RepositoryVersion> upperLimitRevisions)
Sets custom/provided upper limit revisions which will be used during the checking for changes process instead of the current repository version.void
setVersionedSettingsRevision(VcsRootInstance vcsRoot, String revision)
Remmebers versioned settings revision for the specified VCS root.static String
toExternalName(String internalBranchName)
void
updateAgentsCompatibilityCache(Collection<SBuildAgent> agents, BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)
-
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.BuildPromotion
addToQueue, addToQueue, getArtifactDependencies, getArtifactsDirectory, getAssociatedBuild, getAssociatedBuildId, getBranch, getBuildComment, getBuildParameters, getBuildTypeExternalId, getBuildTypeId, getCreatorNodeId, getCustomParameters, getDefaultParameters, getId, getLastModificationId, getNumberOfDependedOnMe, getNumberOfDependencies, getOwner, getParameters, getParameterValue, getParentBuildTypeId, getPrivateTags, getProjectExternalId, getProjectId, getQueuedDate, getRevisions, getServerStartDate, getTagDatas, getTags, getVcsRootEntries, isCanceled, isChangesDetached, isCompositeBuild, isEquivalentTo, isFailedToCollectChanges, isLaterThan, isOutOfChangesSequence, isPartOfBuildChain, isPersonal, isUsed, setBuildComment, setDesiredBranchName, setPrivateTags, setTagDatas, setTags
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionEx
addBuildProblem, addDependedOnMe, addDependedOnMeIfCached, addDependency, allDependenciesFinished, artifactsChanged, associatedBuildFinished, buildEvictedFromCache, buildFinished, cancelCheckingForChanges, copy, createBuildPromotionAccessChecker, decreaseExpirationCounter, deleteBuildProblem, detachChanges, ensureBuildLogFlushed, findTops, freezeSettings, freezeSettings, freezeSettings, freezeSettings, freezeSettingsWithForcedPostprocessing, generateAgentAccessCode, getAllRevisionsMap, getArtifacts, getArtifactStateInfo, getAttribute, getAttributes, getAuditLog, getAuditLogActions, getAutogeneratedBranchName, getBuildChainProblems, getBuildLog, getBuildLogIfInitialized, getBuildProblems, getBuildPromotionsWithArtifactDependenciesOnMe, getBuildSettings, getBuildType, getChainModificationId, getCheckoutDirectory, getCollectChangesError, getCustomArtifactDependencies, getCustomParametersCollection, getDefaultCheckoutDirectory, getDependedOnMe, getDependedOnMeIds, getDependencies, getDependenciesIds, getDependentCompositePromotions, getEquivalentPromotions, getExecutionTimeoutMin, getFailureReasons, getFinalArtifactDependencies, getFreezeSettings, getFrozenSettingsFile, getInternalBranchName, getOverridenVcsRoots, getOwnerNode, getOwnerNodeUrl, getParentBuildType, getPersonalChangeId, getProjectPathIds, getQueuedBuild, getRevisionsMap, getSequenceBuild, getStartedEquivalentPromotions, getUnsortedBuildProblems, getVcsRootEntries, hasBuildProblemsOfType, hasComputedArtifactsState, hasCustomPatch, hasDependencyOn, hasFailureReasons, hasFrozenSettings, hasFrozenSettingsFromVcs, hasLoadedTags, hasStartedParent, hasUnpublishedPromotionPersistingEvent, initBuildProblems, isAssociatedBuildFinished, isChangeCollectingNeeded, isChangeCollectingNeeded, isChangesCollectingInProgress, isDeleted, isEquivalentTo, isFinished, isForcedPostprocessingOfFrozenSettings, isIncomplete, isPersisted, lockDependenciesOptimizing, markAsIncompleteIfHasFailedToStartProblems, markDeleted, markIncomplete, muteBuildProblems, needToFreezeSettings, persist, persist, persistDependencies, persistVcsRootEntries, removeDependedOnMe, removeDependency, replaceDependency, resetArtifactsState, resetBuildLog, resetBuildRevisions, resetBuildSettings, resetDependenciesHardRefs, resetDependentOnMeCache, resetDirectDependenciesCache, resetLogActionsCache, resetTagsCache, scheduleCheckingForChangesIfNeeded, setArtifactsDirectory, setAssociatedBuild, setAttribute, setBuildRevisions, setBuildRevisions, setCustomArtifactDependencies, setCustomParameters, setCustomParameters, setExpirationCounter, setFailedToCollectChanges, setFinalArtifactDependencies, setFreezeSettings, setOverridenVcsRoots, setOwnerNodeUrl, setQueuedAt, setRemoveFromQueueDate, traverseDependedOnMe, traverseDependencies, traverseSelfAndDependedOnMe, traverseSelfAndDependencies, unlockDependenciesOptimizing, updateDependenciesCache, updateFromDB, updateSelfAndDependenciesFromDB, updateStateFromBuildData, waitForChangesCollectingToFinish
-
Methods inherited from interface jetbrains.buildServer.serverSide.buildDistribution.BuildPromotionInfo
getBuildParameters, getDirectDependencies, getId, getParameters, isCompositeBuild
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.ReadOnlyUserParameters
getParameter, getParameters, getParametersCollection, getParameterValue
-
-
-
-
Field Detail
-
PROVIDED_UPPER_LIMIT_REVISION_VCS_BRANCH_ATTR_PREFIX
public static final String PROVIDED_UPPER_LIMIT_REVISION_VCS_BRANCH_ATTR_PREFIX
- See Also:
- Constant Field Values
-
PROVIDED_UPPER_LIMIT_REVISION_REV_ATTR_PREFIX
public static final String PROVIDED_UPPER_LIMIT_REVISION_REV_ATTR_PREFIX
- See Also:
- Constant Field Values
-
VERSIONED_SETTINGS_REVISION_PREFIX
public static final String VERSIONED_SETTINGS_REVISION_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getChanges
@NotNull public List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild, @NotNull VcsModificationProcessor callback)
- Specified by:
getChanges
in interfaceBuildPromotionEx
-
getChanges
@NotNull public BuildChanges getChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotion
Returns build changes according to the specified options- Specified by:
getChanges
in interfaceBuildPromotion
- Parameters:
options
- changes calculation options- Returns:
- see above
-
getChanges
@NotNull public List<SVcsModification> getChanges(@NotNull SelectPrevBuildPolicy policy, boolean returnChangesIfNoPreviousBuild)
Description copied from interface:BuildPromotion
Returns changes containing in this promotion according to the specified policy. Ordering: last detected modifications goes first in the list- Specified by:
getChanges
in interfaceBuildPromotion
- Parameters:
policy
- policyreturnChangesIfNoPreviousBuild
- whether to return changes if there is no previous build in the history.- Returns:
- see above
-
getOwnChanges
@NotNull public List<SVcsModification> getOwnChanges(@NotNull ChangesCalculationOptions options)
Description copied from interface:BuildPromotionEx
Returns changes in this promotion computed according to specified options, doesn't include changes from dependencies.- Specified by:
getOwnChanges
in interfaceBuildPromotionEx
- Parameters:
options
- changes calculation options- Returns:
- see above
-
getAnchorBuildPromotion
@Nullable public BuildPromotionEx getAnchorBuildPromotion()
Description copied from interface:BuildPromotionEx
For the build promotion which runs in a virtual build configuration returns a build promotion which created it. The anchor build promotion is visible to the user and collects all the results of the virtual build promotions.- Specified by:
getAnchorBuildPromotion
in interfaceBuildPromotionEx
- Returns:
- see above
-
isVirtual
public boolean isVirtual()
- Specified by:
isVirtual
in interfaceBuildPromotionEx
- Returns:
- true if the build promotion is running in a virtual build configuration
-
containsChange
public boolean containsChange(@NotNull SVcsModification m)
Description copied from interface:BuildPromotionEx
Returns true if promotion contains specified modification among its changes. Takes only own changes into account (does not use changes from dependencies).- Specified by:
containsChange
in interfaceBuildPromotionEx
- Parameters:
m
- modification of interest- Returns:
- see above
-
hasComputedChanges
public boolean hasComputedChanges(@NotNull SelectPrevBuildPolicy policy, @NotNull VcsModificationProcessor callback)
- Specified by:
hasComputedChanges
in interfaceBuildPromotionEx
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
fillDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
accumulator
- collection to add changes to, according to 'prevBuildPolicy' and 'includeDependencyChanges' options. Changes included are guaranteed to be at or _more_ than defined by the cut-off point in 'callback'callback
- allows to define changes iteration cut-off logic
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull ChangesCalculationOptionsEx options)
Description copied from interface:BuildPromotionEx
Returns changes according to the specified options- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
options
- changes calculation options- Returns:
- see above
-
fillDetectedChanges
public void fillDetectedChanges(@NotNull List<ChangeDescriptor> accumulator, @NotNull ChangesCalculationOptionsEx options)
Description copied from interface:BuildPromotionEx
Computes changes according to the specified options and add them to the given accumulator- Specified by:
fillDetectedChanges
in interfaceBuildPromotionEx
- Parameters:
accumulator
- accumulator for changesoptions
- changes calculation options
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
getDetectedChanges
in interfaceBuildPromotionEx
-
getDetectedChangesProviders
@NotNull public List<BuildDetectedChangesProvider> getDetectedChangesProviders(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChangesProviders
in interfaceBuildPromotionEx
- Parameters:
prevBuildPolicy
- previous build policyincludeDependencyChanges
- whether to include- Returns:
- list of detected changes provides. Change provider returns changes associated with build promotion. With help of this method one can retrieve changes from some providers only.
-
getUpperLimitRevisions
@NotNull public Map<VcsRootInstance,BuildRevisionEx> getUpperLimitRevisions()
Description copied from interface:BuildPromotionEx
Returns upper limit revisions which were available when checking for changes operation was performed. Upper limit revision is a revision returned byVcsRootInstance.getCurrentRevision()
method at the moment when checking for changes was performed.- Specified by:
getUpperLimitRevisions
in interfaceBuildPromotionEx
-
setProvidedUpperLimitRevisions
public void setProvidedUpperLimitRevisions(@NotNull Map<Long,RepositoryVersion> upperLimitRevisions)
Description copied from interface:BuildPromotionEx
Sets custom/provided upper limit revisions which will be used during the checking for changes process instead of the current repository version.- Specified by:
setProvidedUpperLimitRevisions
in interfaceBuildPromotionEx
- Parameters:
upperLimitRevisions
- map of VCS root instance id to revision object, vcs root instance can belong to the current build or its dependencies
-
getProvidedUpperLimitRevisions
@NotNull public Map<Long,RepositoryVersion> getProvidedUpperLimitRevisions()
- Specified by:
getProvidedUpperLimitRevisions
in interfaceBuildPromotionEx
- Returns:
- map of provided upper limit revisions for the checking for changes process
-
getVersionedSettingsRevision
@Nullable public String getVersionedSettingsRevision(@NotNull VcsRootInstance vcsRoot)
Description copied from interface:BuildPromotionEx
Returns a revision of versioned settings for the given VCS root instance or null if such a revision does not exist.- Specified by:
getVersionedSettingsRevision
in interfaceBuildPromotionEx
- Returns:
- see above
-
setVersionedSettingsRevision
public void setVersionedSettingsRevision(@NotNull VcsRootInstance vcsRoot, @NotNull String revision)
Description copied from interface:BuildPromotionEx
Remmebers versioned settings revision for the specified VCS root. Note: persist must be called explicitly for the information to be saved into the database. See alsoBuildPromotionEx.getVersionedSettingsRevision(VcsRootInstance)
.- Specified by:
setVersionedSettingsRevision
in interfaceBuildPromotionEx
-
getPreviousBuildPromotion
@Nullable public BuildPromotion getPreviousBuildPromotion(@NotNull SelectPrevBuildPolicy policy)
Description copied from interface:BuildPromotion
Returns previous promotion created before this one and corresponding to the specified policy.- Specified by:
getPreviousBuildPromotion
in interfaceBuildPromotion
- Parameters:
policy
- policy- Returns:
- see above
-
getPreviousOrderedBuild
@Nullable public OrderedBuild getPreviousOrderedBuild(@NotNull SelectPrevBuildPolicy policy)
Description copied from interface:BuildPromotionEx
Returns previous OrderedBuild instance which corresponds to a build promotion which is created before this one and corresponding to the specified policy.- Specified by:
getPreviousOrderedBuild
in interfaceBuildPromotionEx
- Parameters:
policy
- policy- Returns:
- see above
-
getPreviousBuilds
@NotNull public Stream<OrderedBuild> getPreviousBuilds(@NotNull Filter<String> branchFilter)
Description copied from interface:BuildPromotionEx
Returns stream of previous builds matched by specified branch filter and ordered by changes- Specified by:
getPreviousBuilds
in interfaceBuildPromotionEx
- Parameters:
branchFilter
- filter of interest- Returns:
- see above
-
resetChangesCache
public void resetChangesCache()
Description copied from interface:BuildPromotionEx
Resets cache of changes in this promotion- Specified by:
resetChangesCache
in interfaceBuildPromotionEx
-
clearPrevPromotionCache
public void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)
- Specified by:
clearPrevPromotionCache
in interfaceBuildPromotionEx
-
getLimitedChanges
@NotNull public LimitedChangesCollection getLimitedChanges(@NotNull SelectPrevBuildPolicy policy, int limit)
- Specified by:
getLimitedChanges
in interfaceBuildPromotionEx
-
maxChangesToStoreInCache
protected int maxChangesToStoreInCache(boolean returnChangesIfNoPreviousBuild)
-
getContainingChanges
@NotNull public List<SVcsModification> getContainingChanges()
Description copied from interface:BuildPromotion
Returns changes containing in this promotion. Result is the same as for BuildPromotionEx#getDetectedChanges((SelectPrevBuildPolicy.SINCE_LAST_BUILD, false).stream() .map(ChangeDescriptor::getRelatedVcsChange).filter(Objects::nonNull).collect(Collectors.toList()); Ordering: last detected modifications goes first in the list- Specified by:
getContainingChanges
in interfaceBuildPromotion
- Returns:
- see above
-
getPersonalChanges
@NotNull public List<SVcsModification> getPersonalChanges()
Description copied from interface:BuildPromotion
Returns personal changes associated with this build promotion. If promotion is not personal (isPersonal == false), returns empty collection.- Specified by:
getPersonalChanges
in interfaceBuildPromotion
- Returns:
- see above
-
getPersonalChanges
@NotNull public List<ChangeDescriptor> getPersonalChanges(@NotNull List<ChangeDescriptor> allChanges)
Description copied from interface:BuildPromotionEx
Takes all changes and returns only those that belong to current owner of build promotion. Returns empty list of build promotion is not personal.- Specified by:
getPersonalChanges
in interfaceBuildPromotionEx
- Returns:
-
getCommitters
public UserSet<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy)
Description copied from interface:BuildPromotion
Returns committers of this build selected according to specified policy- Specified by:
getCommitters
in interfaceBuildPromotion
- Parameters:
selectPrevBuildPolicy
- policy- Returns:
- see above
-
getCommitters
@NotNull public Set<SUser> getCommitters(@NotNull SelectPrevBuildPolicy selectPrevBuildPolicy, int maxChangesToProcess)
Description copied from interface:BuildPromotionEx
Same asBuildPromotion.getCommitters(SelectPrevBuildPolicy)
but allows to control number of changes which should be looked up when committers are computed.- Specified by:
getCommitters
in interfaceBuildPromotionEx
- Parameters:
selectPrevBuildPolicy
- policy for selecting a previous buildmaxChangesToProcess
- max number of changes in build to look up, -1 indicates no limit- Returns:
- committers from builds changes
-
getDependenciesSupplier
@NotNull public DependenciesSupplier getDependenciesSupplier()
Description copied from interface:BuildPromotionEx
Creates a dependencies supplier from the snapshot dependencies of this build promotion.- Specified by:
getDependenciesSupplier
in interfaceBuildPromotionEx
- Returns:
- see above
-
resetAgentsCompatibilityCache
public void resetAgentsCompatibilityCache()
Description copied from interface:BuildPromotionEx
Resets promotion compatibility cache for all agents and agent types- Specified by:
resetAgentsCompatibilityCache
in interfaceBuildPromotionEx
-
updateAgentsCompatibilityCache
public void updateAgentsCompatibilityCache(@NotNull Collection<SBuildAgent> agents, @NotNull BuildPromotionEx.CompatibilityCacheUpdateMode cacheUpdateMode)
- Specified by:
updateAgentsCompatibilityCache
in interfaceBuildPromotionEx
-
resetIncompatibleAgentsCache
public void resetIncompatibleAgentsCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)
- Specified by:
resetIncompatibleAgentsCache
in interfaceBuildPromotionEx
-
resetIncompatibleAgentTypesCache
public void resetIncompatibleAgentTypesCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)
- Specified by:
resetIncompatibleAgentTypesCache
in interfaceBuildPromotionEx
-
resetRequirementsCache
public void resetRequirementsCache()
- Specified by:
resetRequirementsCache
in interfaceBuildPromotionEx
-
resetAllCompatibilityCaches
public void resetAllCompatibilityCaches()
- Specified by:
resetAllCompatibilityCaches
in interfaceBuildPromotionEx
-
getCanRunOnAgentTypes
@NotNull public Collection<SAgentType> getCanRunOnAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCanRunOnAgentTypes
in interfaceBuildPromotionEx
-
getCanRunOnAgents
@NotNull public Collection<SBuildAgent> getCanRunOnAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns collection of agents where this build promotion can be executed. Returned agents are compatible with this build promotion, and build promotion build configuration is allowed to be executed on these agents.- Specified by:
getCanRunOnAgents
in interfaceBuildPromotion
- Specified by:
getCanRunOnAgents
in interfaceBuildPromotionInfo
- Returns:
- see above
-
getCompatibilityMap
@NotNull public Map<SBuildAgent,CompatibilityResult> getCompatibilityMap(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns compatibility map for given set of agents. Note: can return empty map if the current build promotion is marked for deletion or its build configuration no longer exists.- Specified by:
getCompatibilityMap
in interfaceBuildPromotion
- Returns:
- see above
-
getCompatibleAgents
@NotNull public Collection<SBuildAgent> getCompatibleAgents(@NotNull Collection<SBuildAgent> available)
Description copied from interface:BuildPromotion
Returns compatible agents only, does not check that build configuration is allowed to be executed on the agents- Specified by:
getCompatibleAgents
in interfaceBuildPromotion
- Returns:
- see above
-
hasBuildFeatureOfType
public boolean hasBuildFeatureOfType(@NotNull String featureType)
Description copied from interface:BuildPromotion
Returns true if this build promotion has a build feature of the specified type- Specified by:
hasBuildFeatureOfType
in interfaceBuildPromotion
- Parameters:
featureType
- the type of the build feature- Returns:
- true if the build promotion has the build feature in its settings and false otherwise
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String featureType)
Description copied from interface:BuildPromotion
Returns settings of the enabled build features of the specified type. If the settings have parameter references, then they won't be resolved (see alsoSBuild.getBuildFeaturesOfType(String)
). This method returns the same result asgetBuildSettings().getBuildFeaturesOfType(String)
.- Specified by:
getBuildFeaturesOfType
in interfaceBuildPromotion
- Parameters:
featureType
- the type of the build feature- Returns:
- the settings of the build features of the specified type or empty list if there are no such build features
-
getCompatibleAgentTypes
@NotNull public Collection<SAgentType> getCompatibleAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCompatibleAgentTypes
in interfaceBuildPromotionEx
-
getAgentTypeCompatibilityMap
@NotNull public Map<SAgentType,CompatibilityResult> getAgentTypeCompatibilityMap(@NotNull Collection<SAgentType> available)
Description copied from interface:BuildPromotionEx
Returns map of agent types to compatibility result. Note: can return empty map if the current build promotion is marked for deletion or its build configuration no longer exists.- Specified by:
getAgentTypeCompatibilityMap
in interfaceBuildPromotionEx
- Returns:
-
getAgentCompatibility
@NotNull public CompatibilityResult getAgentCompatibility(@NotNull AgentDescription agentDescription)
- Specified by:
getAgentCompatibility
in interfaceBuildPromotionEx
- Parameters:
agentDescription
- agent or agent type- Returns:
- compatibility of this build promotion with specified agent description (agent or agent type)
-
getRequirements
@NotNull public List<Requirement> getRequirements()
Description copied from interface:BuildPromotionEx
Returns requirements configured for this build promotion. If a requirement has a parameter reference in it's settings, this parameter reference will be resolved according to current promotion settings. Only enabled requirements are returned by this method.- Specified by:
getRequirements
in interfaceBuildPromotionEx
- Returns:
- see above
-
getBuildFeaturesRequirements
@NotNull public List<Requirement> getBuildFeaturesRequirements()
Description copied from interface:BuildPromotionEx
Returns requirements coming by build features, resolved- Specified by:
getBuildFeaturesRequirements
in interfaceBuildPromotionEx
- Returns:
- see above
-
createOrderedBuild
@NotNull public OrderedBuild createOrderedBuild()
Description copied from interface:BuildPromotionEx
Returns an OrderedBuild with all fields filled. The OrderedBuild contains a consistent snapshot of the promotion properties, ie. no one modified promotion during OrderedBuild creation.- Specified by:
createOrderedBuild
in interfaceBuildPromotionEx
- Returns:
- see above
-
getAllDependencies
@NotNull public List<BuildPromotionEx> getAllDependencies()
Description copied from interface:BuildPromotion
Returns the full list of snapshot dependencies (including transitive ones) of this build promotion filtered according to current user permissions. Dependencies are returned "bottom-up", i.e. direct dependencies go to the end of the list.- Specified by:
getAllDependencies
in interfaceBuildPromotion
- Returns:
- see above
-
getSettingsDigest
@NotNull public byte[] getSettingsDigest(boolean compute)
Description copied from interface:BuildPromotionEx
Returns digest of build promotion settings. If build promotion has build, then digest will be taken from the build artifacts. If there is no digest in artifacts, it will be computed by current settings if compute is set to true. Digest is always computed if build promotion does not have build associated. Returns empty array if digest cannot be computed or build does not have digest and compute is set to false- Specified by:
getSettingsDigest
in interfaceBuildPromotionEx
- Parameters:
compute
- if true and build promotion has build without digest, then digest will be calculated
-
getDependencyGraph
@NotNull public BuildDependencyGraph getDependencyGraph()
Description copied from interface:BuildPromotionEx
Returns dependency graph as if this build promotion is the top of the graph. See alsoBuildPromotionEx.findTops()
- Specified by:
getDependencyGraph
in interfaceBuildPromotionEx
- Returns:
- graph with this promotion at the top
-
getTopDependencyGraph
@NotNull public TopBuildDependencyGraph getTopDependencyGraph()
Description copied from interface:BuildPromotionEx
Returns topmost dependency graph- Specified by:
getTopDependencyGraph
in interfaceBuildPromotionEx
- Returns:
- see above
-
getRunnersRequirements
@NotNull public List<Requirement> getRunnersRequirements(@NotNull SBuildStepsCollection buildSteps)
Description copied from interface:BuildPromotionEx
Returns requirements exposed by runners.- Specified by:
getRunnersRequirements
in interfaceBuildPromotionEx
- Returns:
-
getRealOrDummyBuild
@NotNull public SBuild getRealOrDummyBuild()
- Specified by:
getRealOrDummyBuild
in interfaceBuildPromotionEx
-
sameBranch
public boolean sameBranch(@NotNull BuildPromotionEx promotion)
- Specified by:
sameBranch
in interfaceBuildPromotionEx
- Returns:
- true if this promotion is from the same branch as promotion specified in parameter.
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:BuildPromotionEx
Creates and returns a parameters provider, that provides with all parameters of this build and buidls this one depends on.- Specified by:
getParametersProvider
in interfaceBuildPromotionEx
-
getDummyBuild
protected DummyBuild getDummyBuild()
-
getContext
@NotNull protected BuildPromotionContext getContext()
-
getBuildPromotionManager
@NotNull protected BuildPromotionManagerEx getBuildPromotionManager()
-
getSettingsVcsRootInstance
@Nullable public VcsRootInstance getSettingsVcsRootInstance()
- Specified by:
getSettingsVcsRootInstance
in interfaceBuildPromotionEx
- Returns:
- settings VCS root associated with this promotion
-
hasArtifactDependencyOn
public boolean hasArtifactDependencyOn(@NotNull BuildPromotion dependencyBuild)
Description copied from interface:BuildPromotionEx
Checks if this promotion artifact-depends on the passed one. Especially useful for queued and running builds- Specified by:
hasArtifactDependencyOn
in interfaceBuildPromotionEx
-
isAgentLessBuild
public boolean isAgentLessBuild()
Description copied from interface:BuildPromotionEx
Does it build cannot be executed on any usual agent but only by some external proccess.- Specified by:
isAgentLessBuild
in interfaceBuildPromotionEx
- Specified by:
isAgentLessBuild
in interfaceBuildPromotionInfo
- Returns:
- true if the build cannot be executed on any usual agent; false - if the build can be executed on usual agent
-
isDetachedFromAgent
public boolean isDetachedFromAgent()
- Specified by:
isDetachedFromAgent
in interfaceBuildPromotionEx
- Returns:
- true if the corresponding build was detached from agent at some point and became agentless
-
getDetachedFromAgentDate
@Nullable public Date getDetachedFromAgentDate()
- Specified by:
getDetachedFromAgentDate
in interfaceBuildPromotionEx
- Returns:
- date when this build was fully detched from agent or null
-
getPromotionCustomization
@NotNull public PromotionCustomizationInfo getPromotionCustomization()
Description copied from interface:BuildPromotionEx
Returns promotion customization details, if any Build promotion can be customized by pressing ... near "Run" button in the configuration. The customization may include revisions, dependencies, custom parameters. Personal builds are marked as customized only if other some build parameters differ from typical one.- Specified by:
getPromotionCustomization
in interfaceBuildPromotionEx
- Returns:
- see above
-
getMaximumNumberOfBuildsPerBranch
public int getMaximumNumberOfBuildsPerBranch()
- Specified by:
getMaximumNumberOfBuildsPerBranch
in interfaceBuildPromotionEx
- Returns:
- see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
isMaximumNumberOfBuildsPerBranchLimited
public boolean isMaximumNumberOfBuildsPerBranchLimited()
- Specified by:
isMaximumNumberOfBuildsPerBranchLimited
in interfaceBuildPromotionEx
- Returns:
- true if number of builds per branch is limited, see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
-
findSelfOrDependencyWithProblem
@Nullable public BuildPromotionEx findSelfOrDependencyWithProblem(@NotNull Predicate<BuildProblemData> predicate)
Description copied from interface:BuildPromotionEx
Traverses build problems of the current build promotion and all of its dependencies using breadth first search and returns the first one for which the supplied predicate returns true- Specified by:
findSelfOrDependencyWithProblem
in interfaceBuildPromotionEx
- Parameters:
predicate
- predicate to apply- Returns:
- found dependency or null
-
occupiesLicenseSlot
public boolean occupiesLicenseSlot()
Description copied from interface:BuildPromotionEx
Returns true when this build promotion should occupy one of license slots, false otherwise. Currently, the number of license slots is equal to the max number of authorized agents.- Specified by:
occupiesLicenseSlot
in interfaceBuildPromotionEx
- Returns:
- see above
- See Also:
LicensingPolicy.getMaxNumberOfAuthorizedAgents()
-
-