Package jetbrains.buildServer.serverSide
Interface BuildTypeEx
-
- All Superinterfaces:
BuildConfigurationInfo
,BuildType
,BuildTypeDescriptor
,BuildTypeIdentity
,BuildTypeIdentityEx
,BuildTypeOptions
,BuildTypeSettings
,CleanupSettings
,CleanupSettingsInit
,Comparable<BuildTypeDescriptor>
,CompatibleAgents
,DependencySettings
,Dependent
,InheritableUserParametersHolder
,InheritableUserParametersHolderEx
,InternalParameters
,LVcsRootInstanceHolder
,LVcsRootInstanceHolderEx
,OptionSupport
,ParametersSupport
,ReadOnlyUserParameters
,SBuildType
,SPersistentEntity
,UserParametersHolder
,VcsLabelingSettings
,VcsWorkspaceAccess
- All Known Subinterfaces:
RemoteBuildTypeEx
- All Known Implementing Classes:
BuildTypeImpl
,DummyBuildType
,EditableBuildTypeCopy
,MockBuildType
,RemoteBuildTypeImpl
,SecuredBuildType
public interface BuildTypeEx extends BuildTypeIdentityEx, SBuildType, BuildConfigurationInfo, CleanupSettingsInit, CompatibleAgents, VcsWorkspaceAccess, LVcsRootInstanceHolderEx, InheritableUserParametersHolderEx
- Author:
- Sergey.Anchipolevsky Date: 18.06.2007
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.BuildTypeDescriptor
BuildTypeDescriptor.CheckoutType
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BuildTypeOptions.BuildConfigurationType
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
VcsLabelingSettings.LabelingType
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.BuildTypeDescriptor
FULL_NAME_SEPARATOR
-
Fields inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BT_ALLOW_EXTERNAL_STATUS, BT_ALLOW_PERSONAL_BUILD_TRIGGERING, BT_ARTIFACT_PUBLISH_CONDITION, BT_ARTIFACT_RULES, BT_BRANCH_FILTER, BT_BUILD_CONFIGURATION_TYPE, BT_BUILD_DEFAULT_BRANCH, BT_BUILD_NUMBER_PATTERN, BT_CHECKOUT_DIR, BT_CHECKOUT_MODE, BT_CLEAN_BUILD, BT_EXCLUDE_DEFAULT_BRANCH_CHANGES, BT_EXECUTION_TIMEOUT, BT_FAIL_IF_TESTS_FAIL, BT_FAIL_ON_ANY_ERROR_MESSAGE, BT_FAIL_ON_EXIT_CODE, BT_FAIL_ON_OOME_OR_CRASH, BT_GENERATED_SETTINGS_CHECKSUM, BT_HANGING_BUILDS_DETECTION_ENABLED, BT_MAX_RUNNING_BUILDS, BT_MAX_RUNNING_BUILDS_PER_BRANCH, BT_SHOW_DEPS_CHANGES, BT_SUPPORT_TEST_RETRY, DEFAULT_BUILD_NUMBER_PATTERN, DEFAULT_MAX_RUNNING_BUILDS_PER_BRANCH, DEFAULT_VCS_LABELING_BRANCH_FILTER, VCS_LABELING_BRANCH_FILTER
-
Fields inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
CLEANUP_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP, DISABLE_CLEANUP_POLICIES
-
Fields inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
DEFAULT_LABEL_PATTERN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addRunParameter(Parameter parameter)
For tests only!SQueuedBuild
addToQueue(BuildPromotionEx buildPromotion, String triggeredBy)
Adds build to queue with specified build promotion.SQueuedBuild
addToQueue(SAgentRestrictor agentRestrictor, BuildPromotionEx buildPromotion, String triggeredBy)
Adds build to queue on the specified agent with manually set build parameters: these build parameters will redefined build parameters specified within this build configurationvoid
attachedToModel(ProjectDataModel projectDataModel)
void
clearPrevPromotionCache(Collection<BuildPromotion> targetPromos)
boolean
containsOwnVcsRoot(long vcsRootId)
Returns true if VCS root with specified id is attached directly and is not inherited via a templateBuildCustomizer
createBuildCustomizer(SUser user)
CreatesBuildCustomizer
that can be used to create custom promotions for this build typeBuildPromotionEx
createBuildPromotion()
Creates new build promotion which then can be used when build is added to a queue.BuildPromotionEx
createBuildPromotion(String branchName)
Creates build promotion graph and sets specified branch name to all its nodes.BuildPromotionEx
createBuildPromotion(String branchName, BuildPromotionInitializer initializer)
Same ascreateBuildPromotion(String)
but accepts initializer which is called for every new build promotion in the created build chainBuildPromotionEx
createBuildPromotion(String branchName, BuildPromotionInitializer initializer, DependenciesSupplier dependenciesSupplier)
Same ascreateBuildPromotion(String)
but accepts initializer and dependencies supplier.BuildTypeEx
createEditableCopy(boolean fillSettings)
RemoteBuildTypeEx
createPersonalBuildType(User user, long changeListId)
Creates personal build type, i.e.RemoteBuildTypeEx
createPersonalBuildType(User user, String comment)
Creates personal build type, i.e.RemoteBuildTypeEx
createPersonalBuildType(User user, String comment, Map<VcsRootInstance,VcsRootInstance> overridenRoots)
Create personal build type that starts build with overriden roots.void
dispose()
Must be called when this build configuration object is removed from the model.Collection<BuildTypeEx>
findTops()
List<BranchEx>
getActiveBranches()
List<BranchSpec>
getAdditionalBranchSpecs(VcsRootInstance root, VcsRepositoryState state)
AgentCompatibility
getAgentTypeCompatibility(SAgentType agentType)
List<File>
getArtifactDirectories()
BranchEx
getBranch(String name)
BranchEx
getBranchByDisplayName(String branchDisplayName)
Returns a branch by its display name.List<BranchEx>
getBranches(BranchCalculationOptions branchCalculationOptions)
List<BranchEx>
getBranches(BranchesPolicy policy, Boolean includeBranchesFromDependencies)
List<BranchEx>
getBranches(BranchesPolicy policy, Boolean includeBranchesFromDependencies, boolean computeTimestamps)
BranchSpec
getBranchSpec(SVcsRoot root)
Returns branch specification for specified parent rootBranchSpec
getBranchSpec(VcsRootInstance root)
BuildSettings
getBuildSettings()
Returns build settings: settings for build (where excluded disabled options and features).Collection<BuildTriggerDescriptor>
getBuildTriggerDescriptors(String triggerName, boolean enabledOnly)
BranchFilter
getBuildTypeBranchFilterUnsafe()
Same asSBuildType.getBuildTypeBranchFilter()
but throws an exception if the branch filter is incorrectBuildTypeOrderedBuilds
getBuildTypeOrderedBuilds()
List<StartableAgentType>
getCanRunAndCompatibleAgentTypes()
Returns list of cloud agent types which are both allowed to run this configuration and are compatible with it.default <T> T
getDeclaredOption(Option<T> option)
Get option value declared in this BuildTypeSettingsString
getDefaultBranchDisplayName()
Returns a display name of the default branch according to the current settings of all VCS roots attached to build configuration (their default branch vcs names and branch specs).Map<SBuildType,DependencyOptions>
getDependedOnMe()
BuildTypeDependencyGraph
getDependencyGraph()
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy)
List<ChangeDescriptor>
getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)
DummyBuild
getDummyBuild()
DummyBuildPromotion
getDummyBuildPromotion()
DummyBuildPromotion
getDummyBuildPromotion(boolean createIfNotExists)
Set<Long>
getExcludedDefaultRootInstanceIds()
Returns set of vcs root instance ids with excluded default branchAuditLogAction
getLastConfigModificationAction()
Comment
getLastPauseComment()
Differs fromSBuildType.getPauseComment()
- it returns last comment for pause action only.BranchSpec
getLastUsedBranchSpec(SVcsRoot parentRoot)
Returns branch specification used for changes collecting in given VCS root.Map<VcsRootInstance,BranchSpec>
getLastUsedBranchSpecMap()
Map<VcsRootInstance,BranchSpec>
getLastUsedBranchSpecMap(boolean includeSettingsRoot)
List<SBuild>
getLatestBuilds()
Set<String>
getLogicalBranchNames(VcsRootInstance root, String vcsBranch)
Returns set of possible logical names for the given VCS branch in the given VCS root according to current VCS root settings (i.e.String
getMaximumNumberOfBuildsPerBranch()
Collection<String>
getOwnVcsBranchNames(boolean activeOnly)
List<ChangeDescriptor>
getPendingChangesInAllBranches(Boolean includeDependencyChanges)
Returns pending changes detected in all branches of this build configuration.List<ChangeDescriptor>
getPendingChangesInAllBranches(Boolean includeDependencyChanges, VcsModificationProcessor callback)
ProjectEx
getProject()
Returns the project this build type entity belongs to.List<SQueuedBuild>
getQueuedBuilds()
Map<String,DependencyOptions>
getRawDependedOnMe()
Map from internal build type id to dependency optionsSet<Long>
getRelatedVcsRootInstanceIds()
Returns ids of VCS root instances which reported changes associated with this build configuration.Collection<BuildTriggerDescriptor>
getResolvedBuildTriggerDescriptors(boolean enabledOnly)
Collection<BuildTriggerDescriptor>
getResolvedBuildTriggerDescriptors(String triggerName, boolean enabledOnly)
String
getRunBuildActionName()
BuildTypeSettingsEx
getSettings()
SBuildType
getSourceBuildType()
If current instance is an instance of RemoteBuildType - returns base configuration for remote build type, otherwise - returns this.List<String>
getTags(SUser user)
List of all private tags set for builds of this configuration by the specified user.List<SBuildType>
getTransitiveDependedOnMe()
Returns all build configurations collected up the dependency chain.default <T> TypedValue<T>
getTypedOption(Option<T> option)
Get option extended value.List<VcsRootInstanceEntry>
getVcsRootInstanceEntries(boolean includeSettingsRoot)
Returns entries for VCS roots attached to this buildType.String
getVcsRootsHash(BuildTypeDescriptor.CheckoutType checkoutType)
Returns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory.boolean
hasBuilds()
boolean
hasOwnBranches()
BuildTypeEx
inline()
Creates a temporary copy of this buildType with all settings inherited from a project or a template inlined.boolean
isAgentLessBuildType()
boolean
isBranchSpecDefined(boolean processDependencies)
boolean
isBranchSpecDefined(boolean processDependencies, boolean processSettingsRoot)
boolean
isCompositeBuildType()
boolean
isDefaultBranchExcluded()
Returns true default branch is excluded in the build configuration branch filterboolean
isEmptyUuid()
boolean
isImplicitSettingsRoot(VcsRootInstance root)
Returns true if the specified VCS root is an implicit settings root, ie.boolean
isValidVcsBranch(String name, boolean includeBranchesFromDependencies)
RunningBuildEx
newAgentLessBuild(QueuedBuildEx queuedBuild, SBuildAgent buildAgent, Date removeFromQueueTime)
Creates new SRunningBuild instance and sets executor name as a build promotion attribute for the purposes of Executor mode builds.RunningBuildEx
newRunningBuild(QueuedBuildEx queuedBuild, SBuildAgent buildAgent, Date removeFromQueueTime)
Creates new SRunningBuild instance.void
processHistoryEntries(ItemProcessor<SFinishedBuild> itemProcessor)
Invokes the given ItemProcessor for all history records of this build type.void
reassignIntId(String internalId)
Assigns the specified internalId to this buildType.void
removeAllBuildRunners()
Removes all build runnersboolean
replaceVcsRoot(SVcsRoot oldVcsRoot, SVcsRoot newVcsRoot)
Replaces existing VCS root entry in settings with a new one, maintaining the order of the root entriesvoid
resetPendingChanges()
void
setEditable(boolean editable)
Enables or disables editing of the build type in web UI, see alsoSPersistentEntity.isReadOnly()
.void
setSettings(BuildTypeSettingsEx settings)
Complete replacement of settingsboolean
setVcsRoots(Collection<SVcsRoot> vcsRoots)
Sets VCS roots.void
traverseDependedOnMe(DependencyConsumer<BuildTypeEx> consumer)
void
traverseDependencies(DependencyConsumer<BuildTypeEx> consumer)
void
traverseSelfAndDependedOnMe(DependencyConsumer<BuildTypeEx> consumer)
void
traverseSelfAndDependencies(DependencyConsumer<BuildTypeEx> consumer)
void
unregister()
Must be called when this build configuration was removed from the project completely (calls dispose too).void
updateRevisionsForOwnBranches(Collection<String> logicalBranchNames)
Make sure that revisions for specified logical branches are calculated and saved in dummy build promotions.-
Methods inherited from interface jetbrains.buildServer.serverSide.buildDistribution.BuildConfigurationInfo
getBuildDuration, getId, getMaximumNumberOfBuilds
-
Methods inherited from interface jetbrains.buildServer.BuildType
getBuildByBuildNumber, getBuildParameter, getBuildParameters, getNumberQueued, getParameters, getResponsibilityInfo, getStatus, getStatusDescriptor, getVcsRoots, isInQueue, removeResponsible, setResponsible
-
Methods inherited from interface jetbrains.buildServer.BuildTypeDescriptor
getBuildTypeId, getCheckoutType, getDescription, getExternalId, getFullName, getName, getProjectExternalId, getProjectId, getProjectName, getRunnerTypes, isPaused, isPersonal
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildTypeIdentity
getConfigurationFile, getExternalId, getFullName, getInternalId, getName, setExternalId, setExternalId
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildTypeIdentityEx
getEntityId, sendExtIdChangedEvents, setExternalId
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildTypeSettings
addArtifactDependency, addBuildFeature, addBuildFeature, addBuildParameter, addBuildRunner, addBuildRunner, addBuildRunner, addBuildTrigger, addBuildTrigger, addConfigParameter, addRequirement, addVcsRoot, applyRunnersOrder, containsVcsRoot, findBuildFeatureById, findBuildRunnerById, findRunnerParameter, findTriggerById, getArtifactDependencies, getArtifactPaths, getBuildFeatureRequirements, getBuildFeatures, getBuildFeaturesOfType, getBuildNumberPattern, getBuildParameter, getBuildParameters, getBuildParametersCollection, getBuildRunners, getBuildTriggersCollection, getCheckoutDirectory, getCheckoutRules, getCheckoutType, getConfigParameters, getConfigParametersCollection, getImplicitRequirements, getReadOnlyReason, getRequirements, getRunnerConditions, getRunnersOrder, getRunnerTypes, getRunTypeRequirements, getTemplate, getTemplateId, getTemplateIds, getTemplates, getUndefinedParameters, getVcsRootEntries, getVcsRoots, isDeployment, isEnabled, isReadOnly, isTemplateAccessible, isTemplateBased, persist, removeArtifactDependency, removeBuildFeature, removeBuildParameter, removeBuildRunner, removeBuildTrigger, removeConfigParameter, removeRequirement, removeRequirement, removeVcsRoot, replaceInValues, replaceInValues, resetRunnersOrder, setArtifactDependencies, setArtifactPaths, setBuildNumberPattern, setCheckoutDirectory, setCheckoutRules, setCheckoutType, setEnabled, textValueMatches, updateBuildFeature, updateBuildRunner, updateBuildTrigger, updateBuildTrigger
-
Methods inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
getCleanupOptions, getCleanupPolicies, getInheritedCleanupOptions, getInheritedCleanupPolicies, getOwnCleanupOptions, getOwnCleanupPolicies
-
Methods inherited from interface jetbrains.buildServer.serverSide.CleanupSettingsInit
addCleanupPolicy, removeCleanupPolicies, setCleanupOption
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface jetbrains.buildServer.serverSide.CompatibleAgents
getAgentCompatibility, getCompatibilityMap, getCompatibleAgents
-
Methods inherited from interface jetbrains.buildServer.serverSide.dependency.DependencySettings
addDependency, getDependencies, removeDependency
-
Methods inherited from interface jetbrains.buildServer.serverSide.dependency.Dependent
getChildDependencies, intersectsWith
-
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolder
getInheritedParametersCollection, getOwnParameter, getOwnParameters, getOwnParametersCollection, getOwnParametersWithoutInheritedSpec, getParameters, getParametersCollection
-
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolderEx
getOwnAndParentsNonInheritedParameter, getOwnAndParentsNonInheritedParameters, getOwnNonInheritedParameter
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.LVcsRootInstanceHolder
getBuildTypeId, getName
-
Methods inherited from interface jetbrains.buildServer.serverSide.LVcsRootInstanceHolderEx
branchesChanged, getAdditionalBranchesForChangesCollecting, getAdditionalBranchSpecs, getBranchSpec, rememberLastUsedRootInstanceAndBranchSpec
-
Methods inherited from interface jetbrains.buildServer.util.OptionSupport
getChangedOptions, getOption, getOptionDefaultValue, getOptions, getOwnOptions, setOption
-
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider, getValueResolver
-
Methods inherited from interface jetbrains.buildServer.serverSide.ReadOnlyUserParameters
getParameter, getParameterValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.SBuildType
addTemplate, addToQueue, addToQueue, attachToTemplate, attachToTemplate, belongsTo, detachFromTemplate, findBuildRunnerByType, forceCheckingForChanges, forceCheckingForChanges, getAgentCompatibilities, getAgentCompatibility, getAgentsWhereBuildConfigurationBuilt, getArtifactsDirectory, getArtifactsReferences, getBuildNumbers, getBuildTypeBranchFilter, getCanRunAgents, getCanRunAndCompatibleAgents, getCustomDataStorage, getDependencyReferences, getExecutionTimeoutMin, getExtendedFullName, getExtendedName, getFileContent, getHistory, getHistory, getHistoryFull, getLastChangesFinished, getLastChangesStartedBuild, getLastChangesSuccessfullyFinished, getMaximumNumberOfBuilds, getModificationsSinceLastSuccessful, getNumberOfArtifactReferences, getNumberOfDependencyReferences, getOwnDependencies, getOwnTemplates, getOwnVcsRootEntries, getPauseComment, getPendingChanges, getPendingChangesCommitters, getQueuedBuilds, getResolvedSettings, getRunningBuilds, getRunningBuilds, getTags, getVcsRootInstanceEntries, getVcsRootInstanceEntries, getVcsRootInstanceEntryForParent, getVcsRootInstanceForParent, getVcsRootInstances, getVcsRootsHash, getVcsSettingsHash, getVcsSettingsHash, isAllowExternalStatus, isCleanBuild, isShouldFailBuildIfTestsFailed, isVirtual, mapVcsPath, moveToProject, moveToProject, moveToProject, persist, releaseSources, releaseSources, removeTemplates, setDescription, setName, setPaused, setPaused, setTemplates, setTemplatesOrder
-
Methods inherited from interface jetbrains.buildServer.serverSide.SPersistentEntity
createConfigAction, getConfigId, getConfigurationFile, getParent, getReadOnlyReason, getVersion, isReadOnly, markPersisted, persist, remove, schedulePersisting, schedulePersisting, scheduleRemove
-
Methods inherited from interface jetbrains.buildServer.serverSide.UserParametersHolder
addParameter, removeParameter
-
Methods inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
getLabelingRoots, getLabelingType, getLabelPattern
-
Methods inherited from interface jetbrains.buildServer.serverSide.VcsWorkspaceAccess
canListFiles, getFileContent, getFileContent, getVcsFilesBrowser, getVcsFoldersBrowser, listFiles, mapVcsPath
-
-
-
-
Method Detail
-
getSourceBuildType
@NotNull SBuildType getSourceBuildType()
If current instance is an instance of RemoteBuildType - returns base configuration for remote build type, otherwise - returns this.- Specified by:
getSourceBuildType
in interfaceLVcsRootInstanceHolderEx
- Returns:
- see below.
- Since:
- 6.0
-
getProject
@NotNull ProjectEx getProject()
Description copied from interface:BuildTypeIdentity
Returns the project this build type entity belongs to.- Specified by:
getProject
in interfaceBuildTypeIdentity
- Specified by:
getProject
in interfaceBuildTypeSettings
- Specified by:
getProject
in interfaceSBuildType
- Returns:
- the project this build type entity belongs to.
-
getBuildSettings
@NotNull BuildSettings getBuildSettings()
Returns build settings: settings for build (where excluded disabled options and features).- Returns:
- build settings.
- Since:
- 7.0
-
newRunningBuild
@NotNull RunningBuildEx newRunningBuild(@NotNull QueuedBuildEx queuedBuild, @Nullable SBuildAgent buildAgent, @NotNull Date removeFromQueueTime)
Creates new SRunningBuild instance.- Parameters:
queuedBuild
- source queued buildbuildAgent
- agent the build will be running on or null if build is agent lessremoveFromQueueTime
- time when build was removed from the queue- Returns:
- the new running build
-
newAgentLessBuild
@NotNull RunningBuildEx newAgentLessBuild(@NotNull QueuedBuildEx queuedBuild, @Nullable SBuildAgent buildAgent, @NotNull Date removeFromQueueTime)
Creates new SRunningBuild instance and sets executor name as a build promotion attribute for the purposes of Executor mode builds.- Parameters:
queuedBuild
- source queued buildbuildAgent
- agent the build will be running on or null if build is agent lessremoveFromQueueTime
- time when build was removed from the queue- Returns:
- the new running build
-
attachedToModel
void attachedToModel(@NotNull ProjectDataModel projectDataModel)
-
createBuildPromotion
@NotNull BuildPromotionEx createBuildPromotion()
Creates new build promotion which then can be used when build is added to a queue. Build promotion holds necessary information to reproduce a build. If build configuration has source dependencies on other build configurations, the whole graph is constructed and the top node of this graph (corresponding to this build configuration) is returned.- Returns:
- newly created build promotion.
-
createBuildPromotion
@NotNull BuildPromotionEx createBuildPromotion(@NotNull String branchName)
Creates build promotion graph and sets specified branch name to all its nodes.- Parameters:
branchName
- name of the branch- Returns:
- newly created build promotion.
- Since:
- 7.1
-
createBuildPromotion
@NotNull BuildPromotionEx createBuildPromotion(@Nullable String branchName, @Nullable BuildPromotionInitializer initializer)
Same ascreateBuildPromotion(String)
but accepts initializer which is called for every new build promotion in the created build chain- Parameters:
branchName
-initializer
-- Returns:
-
createBuildPromotion
BuildPromotionEx createBuildPromotion(@Nullable String branchName, @Nullable BuildPromotionInitializer initializer, @Nullable DependenciesSupplier dependenciesSupplier)
Same ascreateBuildPromotion(String)
but accepts initializer and dependencies supplier. Initializer is called for every new build promotion in the created build chain, while dependencies supplier is used to fetch dependencies of the current node while the build chain is constructed.- Parameters:
branchName
-initializer
-dependenciesSupplier
-- Returns:
-
createBuildCustomizer
@NotNull BuildCustomizer createBuildCustomizer(@Nullable SUser user)
CreatesBuildCustomizer
that can be used to create custom promotions for this build type- Since:
- 2021.1
-
createPersonalBuildType
@NotNull RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, @Nullable String comment)
Creates personal build type, i.e. build type which is used to start personal builds.- Parameters:
user
- personal build type ownercomment
- personal comment- Returns:
- new personal build type
-
createPersonalBuildType
@NotNull RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, long changeListId)
Creates personal build type, i.e. build type which is used to start personal builds.- Parameters:
user
- personal build type ownerchangeListId
- id of the personal change list (must be published separately)- Returns:
- new personal build type
-
createPersonalBuildType
@NotNull RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, @Nullable String comment, @NotNull Map<VcsRootInstance,VcsRootInstance> overridenRoots)
Create personal build type that starts build with overriden roots. If there are snapshot dependencies, personal builds will be created for those nodes where overridden roots are applicable.- Parameters:
user
- personal build type ownercomment
- personal commentoverridenRoots
- overriden roots map (original root -> substitution root)- Returns:
- new personal build type
-
addToQueue
@Nullable SQueuedBuild addToQueue(@NotNull BuildPromotionEx buildPromotion, @NotNull String triggeredBy)
Adds build to queue with specified build promotion. Build promotion contains various settings necessary to run a build, like build parameters, build revisions and so on.- Parameters:
buildPromotion
- build promotiontriggeredBy
- who added build to queue- Returns:
- new queued build instance if there is no instances of this configuration in the queue, or previously added instance otherwise.
-
addToQueue
@Nullable SQueuedBuild addToQueue(@NotNull SAgentRestrictor agentRestrictor, @NotNull BuildPromotionEx buildPromotion, @NotNull String triggeredBy)
Adds build to queue on the specified agent with manually set build parameters: these build parameters will redefined build parameters specified within this build configuration- Parameters:
agent
- specified agentbuildPromotion
- build promotiontriggeredBy
- who added build to queue- Returns:
- new queued build instance if there is no instances of this configuration in the queue, or previously added instance otherwise.
-
getSettings
@NotNull BuildTypeSettingsEx getSettings()
- Specified by:
getSettings
in interfaceBuildTypeIdentityEx
- Returns:
- Underlying build settings object
-
dispose
void dispose()
Must be called when this build configuration object is removed from the model.
-
unregister
void unregister()
Must be called when this build configuration was removed from the project completely (calls dispose too).- Specified by:
unregister
in interfaceBuildTypeIdentityEx
-
removeAllBuildRunners
void removeAllBuildRunners()
Removes all build runners- Specified by:
removeAllBuildRunners
in interfaceBuildTypeSettings
-
getLastConfigModificationAction
@Nullable AuditLogAction getLastConfigModificationAction()
-
getAgentTypeCompatibility
@NotNull AgentCompatibility getAgentTypeCompatibility(@NotNull SAgentType agentType)
-
getCanRunAndCompatibleAgentTypes
@NotNull List<StartableAgentType> getCanRunAndCompatibleAgentTypes()
Returns list of cloud agent types which are both allowed to run this configuration and are compatible with it.- Returns:
- list of cloud agent types which are both allowed to run this configuration and are compatible with it.
-
getDependencyGraph
@NotNull BuildTypeDependencyGraph getDependencyGraph()
- Returns:
- graph of snapshot dependencies assuming this build configuration is a top one.
-
findTops
@NotNull Collection<BuildTypeEx> findTops()
- Returns:
- all topmost build configurations having direct or transitive snapshot dependency on this build configuration. If there are no such build configurations returns itself.
-
processHistoryEntries
void processHistoryEntries(@NotNull ItemProcessor<SFinishedBuild> itemProcessor)
Invokes the given ItemProcessor for all history records of this build type. Entries are pushed into the processor in changes order.- Parameters:
itemProcessor
- processor for history entries
-
getDetectedChanges
@NotNull List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy)
-
getDetectedChanges
@NotNull List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
-
getRawDependedOnMe
@NotNull Map<String,DependencyOptions> getRawDependedOnMe()
Map from internal build type id to dependency options- Returns:
-
getDependedOnMe
@NotNull Map<SBuildType,DependencyOptions> getDependedOnMe()
- Returns:
- same as
getRawDependedOnMe()
but with actual build types. - Since:
- 2017.2
-
getTransitiveDependedOnMe
@NotNull List<SBuildType> getTransitiveDependedOnMe()
Returns all build configurations collected up the dependency chain. Note that returned dependencies are sorted by the distance from this build type. The returned list is filtered by current user permissions and may contain not all references.
-
traverseDependedOnMe
void traverseDependedOnMe(@NotNull DependencyConsumer<BuildTypeEx> consumer)
- Parameters:
consumer
-- Since:
- 2018.1.3
-
traverseDependencies
void traverseDependencies(@NotNull DependencyConsumer<BuildTypeEx> consumer)
- Parameters:
consumer
-- Since:
- 2018.1.3
-
traverseSelfAndDependencies
void traverseSelfAndDependencies(@NotNull DependencyConsumer<BuildTypeEx> consumer)
- Parameters:
consumer
-- Since:
- 2018.2.2
-
traverseSelfAndDependedOnMe
void traverseSelfAndDependedOnMe(@NotNull DependencyConsumer<BuildTypeEx> consumer)
- Parameters:
consumer
-- Since:
- 2018.2.2
-
getBranches
@NotNull List<BranchEx> getBranches(@NotNull BranchesPolicy policy, @Nullable Boolean includeBranchesFromDependencies)
-
getBranches
@NotNull List<BranchEx> getBranches(@NotNull BranchesPolicy policy, @Nullable Boolean includeBranchesFromDependencies, boolean computeTimestamps)
-
getBranches
@NotNull List<BranchEx> getBranches(@NotNull BranchCalculationOptions branchCalculationOptions)
-
isValidVcsBranch
boolean isValidVcsBranch(@NotNull String name, boolean includeBranchesFromDependencies)
-
getOwnVcsBranchNames
@NotNull Collection<String> getOwnVcsBranchNames(boolean activeOnly)
-
hasOwnBranches
boolean hasOwnBranches()
-
getBuildTypeOrderedBuilds
@NotNull BuildTypeOrderedBuilds getBuildTypeOrderedBuilds()
-
getBranchSpec
@NotNull BranchSpec getBranchSpec(@NotNull VcsRootInstance root)
-
getBranchSpec
@NotNull BranchSpec getBranchSpec(@NotNull SVcsRoot root)
Returns branch specification for specified parent root- Parameters:
root
- root of interest- Returns:
- see above
- Since:
- 2017.1
-
getLastUsedBranchSpec
@NotNull BranchSpec getLastUsedBranchSpec(@NotNull SVcsRoot parentRoot)
Returns branch specification used for changes collecting in given VCS root. If changes are not collected yet returns current value of branch specification.- Parameters:
parentRoot
- root of interest- Returns:
- see above
-
getLastUsedBranchSpecMap
@NotNull Map<VcsRootInstance,BranchSpec> getLastUsedBranchSpecMap()
-
getLastUsedBranchSpecMap
@NotNull Map<VcsRootInstance,BranchSpec> getLastUsedBranchSpecMap(boolean includeSettingsRoot)
-
getAdditionalBranchSpecs
@NotNull List<BranchSpec> getAdditionalBranchSpecs(@NotNull VcsRootInstance root, @NotNull VcsRepositoryState state)
-
getQueuedBuilds
@NotNull List<SQueuedBuild> getQueuedBuilds()
-
getLatestBuilds
@NotNull List<SBuild> getLatestBuilds()
- Returns:
- latest builds (currently running and last finished)
-
isBranchSpecDefined
boolean isBranchSpecDefined(boolean processDependencies)
- Parameters:
processDependencies
- whether to process snapshot dependencies or not- Returns:
- true if at least one vcs root in build configuration or its dependencies has VCS root with non empty branch spec
-
isBranchSpecDefined
boolean isBranchSpecDefined(boolean processDependencies, boolean processSettingsRoot)
-
clearPrevPromotionCache
void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)
-
getBuildTriggerDescriptors
@NotNull Collection<BuildTriggerDescriptor> getBuildTriggerDescriptors(@NotNull String triggerName, boolean enabledOnly)
- Parameters:
enabledOnly
- whether to return only enabled triggers or alltriggerName
- name of the trigger- Returns:
- build triggers of specified type
-
getResolvedBuildTriggerDescriptors
@NotNull Collection<BuildTriggerDescriptor> getResolvedBuildTriggerDescriptors(boolean enabledOnly)
- Parameters:
enabledOnly
- whether to return only enabled triggers or all- Returns:
- build triggers with resolved settings.
-
getResolvedBuildTriggerDescriptors
@NotNull Collection<BuildTriggerDescriptor> getResolvedBuildTriggerDescriptors(@NotNull String triggerName, boolean enabledOnly)
- Parameters:
enabledOnly
- whether to return only enabled triggers or alltriggerName
- name of the trigger- Returns:
- build triggers of specified type with fully resolved settings.
-
getPendingChangesInAllBranches
@NotNull List<ChangeDescriptor> getPendingChangesInAllBranches(@Nullable Boolean includeDependencyChanges)
Returns pending changes detected in all branches of this build configuration.- Returns:
- list of pending changes.
-
getPendingChangesInAllBranches
@NotNull List<ChangeDescriptor> getPendingChangesInAllBranches(@Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
-
addRunParameter
void addRunParameter(@NotNull Parameter parameter)
For tests only!- Parameters:
parameter
-
-
getLogicalBranchNames
@Nullable Set<String> getLogicalBranchNames(@NotNull VcsRootInstance root, @NotNull String vcsBranch)
Returns set of possible logical names for the given VCS branch in the given VCS root according to current VCS root settings (i.e. default branch, branch spec)- Parameters:
root
- root of interestvcsBranch
- vcs branch of interest- Returns:
- see above or null if branch spec is not specified for this vcs root instance
-
getDefaultBranchDisplayName
@NotNull String getDefaultBranchDisplayName()
Returns a display name of the default branch according to the current settings of all VCS roots attached to build configuration (their default branch vcs names and branch specs). Returned value might be different from Branch.DEFAULT_BRANCH_NAME when logical name of the default branch in all the roots is the same.- Returns:
- see above
-
getBranchByDisplayName
@NotNull BranchEx getBranchByDisplayName(@NotNull String branchDisplayName)
Returns a branch by its display name.Usually branch display equals to branch name. The only exception is default branch (see comments to
getDefaultBranchDisplayName()
. This method allows you to get a default branch by its custom display name. UsegetBranch(String)
method if you are sure you use a branch name (not a display name) or branch is not a default one, because this method is slower thangetBranch(String)
.- Parameters:
branchDisplayName
- branch display name- Returns:
- see above
-
hasBuilds
boolean hasBuilds()
- Returns:
- true if this build configuration has builds
-
getTags
@NotNull List<String> getTags(@NotNull SUser user)
List of all private tags set for builds of this configuration by the specified user.- Returns:
- union of tags for each build for the configuration.
- Since:
- 9.0
-
getDummyBuild
@NotNull DummyBuild getDummyBuild()
-
getDummyBuildPromotion
@NotNull DummyBuildPromotion getDummyBuildPromotion()
-
getDummyBuildPromotion
@Nullable DummyBuildPromotion getDummyBuildPromotion(boolean createIfNotExists)
-
resetPendingChanges
void resetPendingChanges()
-
getArtifactDirectories
@NotNull List<File> getArtifactDirectories()
- Returns:
- list of directories where artifacts of builds of this build type are stored. List always has at least one element. The first directory in the list is a directory where new builds store their artifacts.
- Since:
- 9.1
-
inline
@NotNull BuildTypeEx inline()
Creates a temporary copy of this buildType with all settings inherited from a project or a template inlined.- Since:
- 9.1
-
getVcsRootInstanceEntries
@NotNull List<VcsRootInstanceEntry> getVcsRootInstanceEntries(boolean includeSettingsRoot)
Returns entries for VCS roots attached to this buildType. If buildType has an implicit settings root (not attached to buildType) andincludeSettingsRoot
istrue
, then an entry for this settings root is included in the result.- Parameters:
includeSettingsRoot
- whether settings root should be included in result- Returns:
- see above
- Since:
- 9.1
-
isImplicitSettingsRoot
boolean isImplicitSettingsRoot(@NotNull VcsRootInstance root)
Returns true if the specified VCS root is an implicit settings root, ie. this buildType's project stores settings in this root and root is not attached to this buildType- Parameters:
root
- root of interest- Returns:
- see above
-
createEditableCopy
@NotNull BuildTypeEx createEditableCopy(boolean fillSettings)
-
getVcsRootsHash
@NotNull String getVcsRootsHash(BuildTypeDescriptor.CheckoutType checkoutType)
Returns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory. Note: be careful, when using this value for running build. Build type might already be updated It's a replacement for deprecatedSBuildType.getVcsRootsHash()
- returns hash of vcs roots as if specified checkoutType is used. Don't acceptBuildTypeDescriptor.CheckoutType.AUTO
, throwsIllegalArgumentException
if passed.- Since:
- 10.0
-
getLastPauseComment
@Nullable Comment getLastPauseComment()
Differs fromSBuildType.getPauseComment()
- it returns last comment for pause action only.- Returns:
-
getTypedOption
@NotNull default <T> TypedValue<T> getTypedOption(@NotNull Option<T> option)
Get option extended value. See
TypedValue
. When the option is not defined- Specified by:
getTypedOption
in interfaceBuildTypeSettings
- Type Parameters:
T
-- Parameters:
option
-- Returns:
- Since:
- 10.0
-
getDeclaredOption
@Nullable default <T> T getDeclaredOption(@NotNull Option<T> option)
Get option value declared in this BuildTypeSettings
- Specified by:
getDeclaredOption
in interfaceOptionSupport
- Parameters:
option
- option to retrieve value for- Returns:
- value of the option. If value wasn't set, null is returned
- Since:
- 10.0
-
replaceVcsRoot
boolean replaceVcsRoot(@NotNull SVcsRoot oldVcsRoot, @NotNull SVcsRoot newVcsRoot)
Replaces existing VCS root entry in settings with a new one, maintaining the order of the root entries- Parameters:
oldVcsRoot
- VCS root to be replacednewVcsRoot
- VCS root to insert instead- Returns:
- true if VCS root was actually replaced, false otherwise (the root to be replaced did not exist or the new root already existed)
- Since:
- 10.0
-
setVcsRoots
boolean setVcsRoots(@NotNull Collection<SVcsRoot> vcsRoots)
Sets VCS roots. All existing VCS roots that are not present in vcsRoots are deleted, all other existing VCS roots are reordered if necessary, but retain their original checkout rules.- Parameters:
vcsRoots
-- Returns:
- true if any changes occurred
- Since:
- 10.0
-
setEditable
void setEditable(boolean editable)
Enables or disables editing of the build type in web UI, see alsoSPersistentEntity.isReadOnly()
.SBuildType.persist()
method must be called afterwards.- Parameters:
editable
- true to enable editing and false to disable
-
isDefaultBranchExcluded
boolean isDefaultBranchExcluded()
Returns true default branch is excluded in the build configuration branch filter- Returns:
- see above
- Since:
- 2017.1
-
getExcludedDefaultRootInstanceIds
@NotNull Set<Long> getExcludedDefaultRootInstanceIds()
Returns set of vcs root instance ids with excluded default branch- Returns:
- see above
- Since:
- 2017.1
-
getRunBuildActionName
String getRunBuildActionName()
- Returns:
- name of the Run build action in this configuration, this could be Run, Deploy, Upload, etc. The primary usage of this name is web interface.
- Since:
- 2017.1
-
isCompositeBuildType
boolean isCompositeBuildType()
- Specified by:
isCompositeBuildType
in interfaceBuildTypeSettings
- Returns:
- true if this build type is composite
-
isAgentLessBuildType
boolean isAgentLessBuildType()
- Returns:
- true if this build type is agent less
-
isEmptyUuid
boolean isEmptyUuid()
- Returns:
- true if this buildType has an empty uuid in its config on disk
-
reassignIntId
void reassignIntId(@NotNull String internalId)
Assigns the specified internalId to this buildType. The internalId should come from an entityId present in DB and marked as removed, otherwise anIllegalArgumentException
is thrown.
-
containsOwnVcsRoot
boolean containsOwnVcsRoot(long vcsRootId)
Description copied from interface:BuildTypeSettings
Returns true if VCS root with specified id is attached directly and is not inherited via a template- Specified by:
containsOwnVcsRoot
in interfaceBuildTypeSettings
- Parameters:
vcsRootId
- vcs root id- Returns:
- true if the specified VCS root is attached to the build configuration directly and is not inherited
- Since:
- 2019.2
-
updateRevisionsForOwnBranches
void updateRevisionsForOwnBranches(@NotNull Collection<String> logicalBranchNames)
Make sure that revisions for specified logical branches are calculated and saved in dummy build promotions. These revisions are used to compute pending changes, so if some code is going to compute pending changes for a big amount of branches it makes sense to call this method first.- Parameters:
logicalBranchNames
-
-
setSettings
void setSettings(@NotNull BuildTypeSettingsEx settings)
Complete replacement of settings- Parameters:
settings
- new settings- Since:
- 2021.2
-
getMaximumNumberOfBuildsPerBranch
@NotNull String getMaximumNumberOfBuildsPerBranch()
- Returns:
- see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCH
which may include parameters references or null if no limits specified - Since:
- 2022.04
-
getBuildTypeBranchFilterUnsafe
@NotNull BranchFilter getBuildTypeBranchFilterUnsafe() throws InvalidBranchSpecException
Same asSBuildType.getBuildTypeBranchFilter()
but throws an exception if the branch filter is incorrect- Throws:
InvalidBranchSpecException
-
-