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 classAbstractBuildPromotion.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 StringPROVIDED_UPPER_LIMIT_REVISION_REV_ATTR_PREFIXstatic StringPROVIDED_UPPER_LIMIT_REVISION_VCS_BRANCH_ATTR_PREFIXstatic StringVERSIONED_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 voidclearPrevPromotionCache(Collection<BuildPromotion> targetPromos)booleancontainsChange(SVcsModification m)Returns true if promotion contains specified modification among its changes.OrderedBuildcreateOrderedBuild()Returns an OrderedBuild with all fields filled.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 trueCompatibilityResultgetAgentCompatibility(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.BuildPromotionExgetAnchorBuildPromotion()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 BuildPromotionManagerExgetBuildPromotionManager()Collection<SBuildAgent>getCanRunOnAgents(Collection<SBuildAgent> available)Returns collection of agents where this build promotion can be executed.Collection<SAgentType>getCanRunOnAgentTypes(Collection<SAgentType> available)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)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 BuildPromotionContextgetContext()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.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)protected DummyBuildgetDummyBuild()LimitedChangesCollectiongetLimitedChanges(SelectPrevBuildPolicy policy, int limit)intgetMaximumNumberOfBuildsPerBranch()List<SVcsModification>getOwnChanges(ChangesCalculationOptions options)Returns changes in this promotion computed according to specified options, doesn't include changes from dependencies.ParametersProvidergetParametersProvider()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.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.PromotionCustomizationInfogetPromotionCustomization()Returns promotion customization details, if any Build promotion can be customized by pressing ...Map<Long,RepositoryVersion>getProvidedUpperLimitRevisions()SBuildgetRealOrDummyBuild()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.VcsRootInstancegetSettingsVcsRootInstance()TopBuildDependencyGraphgetTopDependencyGraph()Returns topmost dependency graphMap<VcsRootInstance,BuildRevisionEx>getUpperLimitRevisions()Returns upper limit revisions which were available when checking for changes operation was performed.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 typebooleanhasComputedChanges(SelectPrevBuildPolicy policy, VcsModificationProcessor callback)booleanisAgentLessBuild()Does it build cannot be executed on any usual agent but only by some external proccess.booleanisDetachedFromAgent()booleanisMaximumNumberOfBuildsPerBranchLimited()booleanisVirtual()protected intmaxChangesToStoreInCache(boolean returnChangesIfNoPreviousBuild)booleanoccupiesLicenseSlot()Returns true when this build promotion should occupy one of license slots, false otherwise.voidresetAgentsCompatibilityCache()Resets promotion compatibility cache for all agents and agent typesvoidresetAllCompatibilityCaches()voidresetChangesCache()Resets cache of changes in this promotionvoidresetIncompatibleAgentsCache(Predicate<CompatibilityResult> compatibilityPredicate)voidresetIncompatibleAgentTypesCache(Predicate<CompatibilityResult> compatibilityPredicate)voidresetRequirementsCache()booleansameBranch(BuildPromotionEx promotion)voidsetProvidedUpperLimitRevisions(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.voidsetVersionedSettingsRevision(VcsRootInstance vcsRoot, String revision)Remmebers versioned settings revision for the specified VCS root.static StringtoExternalName(String internalBranchName)voidupdateAgentsCompatibilityCache(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:
getChangesin interfaceBuildPromotionEx
-
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
-
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
-
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
-
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
-
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
-
hasComputedChanges
public boolean hasComputedChanges(@NotNull SelectPrevBuildPolicy policy, @NotNull VcsModificationProcessor callback)- Specified by:
hasComputedChangesin 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
-
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
-
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
-
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.
-
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
-
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
-
getPreviousBuildPromotion
@Nullable 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
-
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
-
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
-
resetChangesCache
public void resetChangesCache()
Description copied from interface:BuildPromotionExResets cache of changes in this promotion- Specified by:
resetChangesCachein interfaceBuildPromotionEx
-
clearPrevPromotionCache
public void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)- Specified by:
clearPrevPromotionCachein interfaceBuildPromotionEx
-
getLimitedChanges
@NotNull public LimitedChangesCollection getLimitedChanges(@NotNull SelectPrevBuildPolicy policy, int limit)
- Specified by:
getLimitedChangesin interfaceBuildPromotionEx
-
maxChangesToStoreInCache
protected int maxChangesToStoreInCache(boolean returnChangesIfNoPreviousBuild)
-
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
-
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:
-
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
-
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
-
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
-
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
-
resetIncompatibleAgentTypesCache
public void resetIncompatibleAgentTypesCache(@Nullable Predicate<CompatibilityResult> compatibilityPredicate)- Specified by:
resetIncompatibleAgentTypesCachein interfaceBuildPromotionEx
-
resetRequirementsCache
public void resetRequirementsCache()
- Specified by:
resetRequirementsCachein interfaceBuildPromotionEx
-
resetAllCompatibilityCaches
public void resetAllCompatibilityCaches()
- Specified by:
resetAllCompatibilityCachesin interfaceBuildPromotionEx
-
getCanRunOnAgentTypes
@NotNull public Collection<SAgentType> getCanRunOnAgentTypes(@NotNull Collection<SAgentType> available)
- Specified by:
getCanRunOnAgentTypesin interfaceBuildPromotionEx
-
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
-
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
-
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:
-
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)
-
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
-
getBuildFeaturesRequirements
@NotNull public List<Requirement> getBuildFeaturesRequirements()
Description copied from interface:BuildPromotionExReturns requirements coming by build features, resolved- Specified by:
getBuildFeaturesRequirementsin interfaceBuildPromotionEx- Returns:
- see above
-
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
-
getAllDependencies
@NotNull public List<BuildPromotionEx> 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
-
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
-
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
-
getRunnersRequirements
@NotNull public List<Requirement> getRunnersRequirements(@NotNull SBuildStepsCollection buildSteps)
Description copied from interface:BuildPromotionExReturns requirements exposed by runners.- Specified by:
getRunnersRequirementsin interfaceBuildPromotionEx- Returns:
-
getRealOrDummyBuild
@NotNull public SBuild getRealOrDummyBuild()
- Specified by:
getRealOrDummyBuildin interfaceBuildPromotionEx
-
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.
-
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
-
getDummyBuild
protected DummyBuild getDummyBuild()
-
getContext
@NotNull protected BuildPromotionContext getContext()
-
getBuildPromotionManager
@NotNull protected BuildPromotionManagerEx getBuildPromotionManager()
-
getSettingsVcsRootInstance
@Nullable public VcsRootInstance getSettingsVcsRootInstance()
- Specified by:
getSettingsVcsRootInstancein interfaceBuildPromotionEx- Returns:
- settings VCS root associated with this promotion
-
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
-
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
-
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
-
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
-
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
-
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()
-
-