Class SecuredRunningBuild
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.BaseBuild
-
- jetbrains.buildServer.serverSide.impl.BaseRunningBuild
-
- jetbrains.buildServer.serverSide.impl.RunningBuildImpl
-
- jetbrains.buildServer.serverSide.impl.auth.SecuredRunningBuild
-
- All Implemented Interfaces:
Build
,RunningBuild
,RunningBuildInfo
,BuildEx
,BuildPromotionOwner
,ParametersSupport
,RunningBuildEx
,SBuild
,SRunningBuild
public class SecuredRunningBuild extends RunningBuildImpl
- Author:
- Pavel.Sher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
BaseRunningBuild.ArtifactsStats
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
myLastUpdateTimestamp, myStatusText, OLD_UNEXPECTED_FINISH
-
Fields inherited from class jetbrains.buildServer.serverSide.impl.BaseBuild
myBuildId, myContext, myStatsCallCounter, REMOTE_ARTIFACTS_PREFIX
-
Fields inherited from interface jetbrains.buildServer.serverSide.RunningBuildEx
DEPENDENCIES_SKIP_ENABLED
-
-
Constructor Summary
Constructors Constructor Description SecuredRunningBuild(BuildPromotionEx buildPromotion, RunningBuildData rbd, BuildContext context)
SecuredRunningBuild(BuildPromotionEx buildPromotion, SAgentRestrictor queuedAgentRestrictor, String rawTriggeredBy, int agentId, int agentTypeId, BuildContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildProblemData
addUserBuildProblem(SUser user, String problemDescription)
Adds user provided build problem to the build.void
deleteBuildProblem(SUser user, String identity, String comment)
Deletes build problem Deleting build problem may change build status to SUCCESSvoid
finish(Date finishDate)
Finalizes all build related activities and finishes the build.BuildAgentEx
getAgent()
Get build agent this running build is running on.Collection<SBuildFeatureDescriptor>
getBuildFeaturesOfType(String featureType)
Returns collection of enabled and resolved build features of specified type from build settings (resolving is performed at the moment of the method call).DepParametersMemoryOptimizedMap
getBuildFinishParameters()
DepParametersMemoryOptimizedMap
getBuildStartParameters()
SecurityContextEx
getSecurityContext()
void
muteBuildProblems(SUser user, boolean muteIfTrue, String comment)
Makes all existing build problems enabled or disabledvoid
setBuildComment(User user, String comment)
Sets the comment for the buildvoid
setBuildNumber(String newBuildNumber)
Set new value for this build build number instead of current one.void
setCustomStatusText(String text)
Sets the custom build status text.void
setTags(List<String> tags)
Sets public tags for this buildvoid
setTags(User user, List<String> tags)
Sets public tags for this buildvoid
stop(RunningBuildState interruptedState, User user, String comment, boolean reAdd2Queue)
void
stop(User user, String comment)
Stops the build.-
Methods inherited from class jetbrains.buildServer.serverSide.impl.RunningBuildImpl
addBuildMessage, addBuildMessages, buildPatch, buildPersonalPatch, clearCachedEstimate, closeBuildLog, computeAgentlessBuildAgent, computeProbablyHanging, createAgentBuild, detachedFromAgent, doBuildFinish, finishedOnOtherNode, finishImmediately, getAgentAccessCode, getAgentId, getAgentName, getArtifactsLimit, getBuildConfiguration, getBuildCounter, getBuildLog, getBuildLogIfInitialized, getBuildNumber, getBuildOwnParameters, getBuildPromotionInfo, getCachedShortStatistics, getCompletedPercent, getCompletedPercent, getCurrentPath, getDurationEstimate, getDurationOvertime, getElapsedTime, getElapsedTime, getEstimatedDurationExceededTime, getEstimationForTimeLeft, getEstimationForTimeLeft, getFinishDate, getLastBuildActivityTimestamp, getProgressText, getProjectExternalId, getProjectId, getQueuedAgentId, getQueuedAgentRestrictor, getRawBuildNumber, getRunnersState, getStatusDescriptor, getTestMessages, getTestRunMuter, getTimeSpentSinceLastBuildActivity, getUserDataStorage, initialize, isCompositeBuild, isFinished, isFinishReceived, isProbablyHanging, isStarting, markAsFinished, markAsFinishedUnexpectedly, muteBuildProblems, occupiesAgent, prepareArtifactDependencies, publishArtifact, publishArtifact, publishArtifact, publishArtifact, publishArtifact, resetAgentCache, runUnlessFinished, serverShutdown, serverStartup, setBuildStatus, setStartTimes, start, stopNoInterrupt, toString, updateBuild, updateBuildInfo
-
Methods inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
addRemoteArtifact, createSettingsDigest, finish, getArtifactsStats, getBuildDescription, getBuildPromotion, getCanceledInfo, getCompletedStages, getDependencyGraph, getHangingDependency, getLastUpdateDelayMsecs, getRunningState, getStatisticValuesCollection, initCurrentStatisticValues, isInterrupted, loadCancelledInfoFromDB, logFinalMessages, notifyOnBuildProblemsChanged, resolveArtifactDependencies, setCanceledInfo, setInterrupted, skipBuildChainBuilds, startBuildFailureChecker, stopBuildFailureChecker, updateBuildIfLastUpdateExpired, updateBuildStatisticValues, writeFinishProperties, writeSettingsDigestFile
-
Methods inherited from class jetbrains.buildServer.serverSide.impl.BaseBuild
addBuildProblem, buildProblemsChanged, convertToAgentTime, convertToServerTime, createShortStatistics, doGetBuildFinishParameters, doGetBuildStartParameters, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getAuditLogFactory, getAuditLogProvider, getBranch, getBuildComment, getBuildContext, getBuildId, getBuildNumberParameters, getBuildNumberWithoutRefs, getBuildProblems, getBuildStatistics, getBuildStatus, getBuildType, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getCompilationErrorMessages, getContainingChanges, getCustomDataStorage, getCustomDataStorageIdsByPrefix, getDetachFromAgentReceivedTimestamp, getDownloadedArtifacts, getDuration, getDurationOnAgent, getFailureReasons, getFileContent, getFinishOnAgentDate, getFirstInternalError, getFirstInternalErrorMessage, getFullName, getFullStatistics, getId, getLabels, getLogMessages, getOwner, getParametersProvider, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRecentlyFinishedBuild, getRelatedIssues, getRemoteArtifacts, getRemoteArtifactsByType, getRevisions, getSequenceBuild, getServerStartDate, getSettingsDigestFile, getSettingsDigestFromFile, getShortStatistics, getStartDate, getStatisticValue, getStatisticValues, getStatus, getTags, getTemporaryCustomDataStorage, getTriggeredBy, getValueResolver, getValueResolver, getValueResolver, getVariablesProvider, getVcsRootEntries, getWaitReasons, hasBuildFinishParameters, hasBuildProblemOfType, hasTests, initMetrics, isAgentLessBuild, isArtifactsExists, isDetachedFromAgent, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutdated, isOutOfChangesSequence, isPersonal, isPersonalPatchAvailable, isPinned, isResponsibleNeeded, isStartedOnAgent, isTimedOut, isUsedByOtherBuilds, now, nowDate, preloadFailedTests, publishStatisticValue, resetBuildFinalParameters, setBuildStartTimes, updateExternalArtifactsInfoOnAccess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.Build
getBuildId, getBuildStatus, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getCanceledInfo, getCompilationErrorMessages, getDuration, getFullName, getLogMessages, getStartDate, isPersonal
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionOwner
getSequenceBuild
-
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider
-
Methods inherited from interface jetbrains.buildServer.serverSide.RunningBuildEx
finish, getBuildPromotion, getCompletedStages, getDetachFromAgentReceivedTimestamp, getHangingDependency, getStatisticValuesCollection, getTemporaryCustomDataStorage, skipBuildChainBuilds, startBuildFailureChecker, stopBuildFailureChecker, updateBuildIfLastUpdateExpired, updateBuildStatisticValues, updateExternalArtifactsInfoOnAccess, writeSettingsDigestFile
-
Methods inherited from interface jetbrains.buildServer.serverSide.SBuild
addBuildProblem, convertToAgentTime, convertToServerTime, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getBranch, getBuildComment, getBuildDescription, getBuildStatistics, getBuildType, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getContainingChanges, getCustomDataStorage, getDownloadedArtifacts, getFailureReasons, getFileContent, getFinishOnAgentDate, getFirstInternalError, getFirstInternalErrorMessage, getFullStatistics, getLabels, getOwner, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRecentlyFinishedBuild, getRelatedIssues, getRemoteArtifacts, getRemoteArtifactsByType, getRevisions, getServerStartDate, getShortStatistics, getStatisticValue, getStatisticValues, getTags, getTriggeredBy, getValueResolver, getVcsRootEntries, getWaitReasons, hasBuildProblemOfType, hasTests, isAgentLessBuild, isArtifactsExists, isDetachedFromAgent, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutdated, isOutOfChangesSequence, isPinned, isResponsibleNeeded, isStartedOnAgent, isUsedByOtherBuilds
-
Methods inherited from interface jetbrains.buildServer.serverSide.SRunningBuild
addRemoteArtifact, isInterrupted, setInterrupted
-
-
-
-
Constructor Detail
-
SecuredRunningBuild
public SecuredRunningBuild(@NotNull BuildPromotionEx buildPromotion, @Nullable SAgentRestrictor queuedAgentRestrictor, String rawTriggeredBy, int agentId, int agentTypeId, @NotNull BuildContext context)
-
SecuredRunningBuild
public SecuredRunningBuild(@NotNull BuildPromotionEx buildPromotion, @NotNull RunningBuildData rbd, @NotNull BuildContext context)
-
-
Method Detail
-
getAgent
@NotNull public BuildAgentEx getAgent()
Description copied from interface:SRunningBuild
Get build agent this running build is running on. May be unregistered or even dead agent, but never null.- Specified by:
getAgent
in interfaceRunningBuildInfo
- Specified by:
getAgent
in interfaceSBuild
- Specified by:
getAgent
in interfaceSRunningBuild
- Overrides:
getAgent
in classRunningBuildImpl
- Returns:
- agent where this build executed.
-
stop
public void stop(User user, String comment)
Description copied from interface:SRunningBuild
Stops the build. If this is a user action, user who performs this action must be specified. If build is stopped without user it will be considered crashed and can be re-added into the queue.- Specified by:
stop
in interfaceSRunningBuild
- Overrides:
stop
in classBaseRunningBuild
- Parameters:
user
- user who stopped build or nullcomment
- comment for the action or null
-
stop
public void stop(@NotNull RunningBuildState interruptedState, @Nullable User user, @NotNull String comment, boolean reAdd2Queue)
- Specified by:
stop
in interfaceRunningBuildEx
- Overrides:
stop
in classRunningBuildImpl
- Parameters:
interruptedState
- how to interrupt the build, should have interrupted statususer
- optional user who stops the buildcomment
- comment for build interruptionreAdd2Queue
- if true, the build will be re-added to queue with the same build promotion (to the end of the queue)
-
finish
public void finish(@NotNull Date finishDate)
Description copied from interface:SRunningBuild
Finalizes all build related activities and finishes the build. Build must be finished on agent. Takes no effect for already finished or interrupted builds.- Specified by:
finish
in interfaceSRunningBuild
- Overrides:
finish
in classRunningBuildImpl
- Parameters:
finishDate
- finish date
-
setTags
public void setTags(List<String> tags)
Description copied from interface:SBuild
Sets public tags for this build
-
setTags
public void setTags(User user, List<String> tags)
Description copied from interface:SBuild
Sets public tags for this build
-
setBuildComment
public void setBuildComment(@Nullable User user, @Nullable String comment)
Description copied from interface:SBuild
Sets the comment for the build- Specified by:
setBuildComment
in interfaceSBuild
- Overrides:
setBuildComment
in classBaseBuild
- Parameters:
user
- user who sets the commentcomment
- text of the comment
-
setBuildNumber
public void setBuildNumber(@NotNull String newBuildNumber)
Description copied from interface:SRunningBuild
Set new value for this build build number instead of current one. If newBuildNumber has pattern {build.number}, it is replaced with the current build number- Specified by:
setBuildNumber
in interfaceSRunningBuild
- Overrides:
setBuildNumber
in classRunningBuildImpl
- Parameters:
newBuildNumber
- new value for this build build number
-
setCustomStatusText
public void setCustomStatusText(@Nullable String text)
Description copied from interface:RunningBuildEx
Sets the custom build status text.- Specified by:
setCustomStatusText
in interfaceRunningBuildEx
- Overrides:
setCustomStatusText
in classBaseRunningBuild
- Parameters:
text
- new build status text. Supports "{build.status.text}" placeholder to be substituted with the default text
-
addUserBuildProblem
public BuildProblemData addUserBuildProblem(@NotNull SUser user, @NotNull String problemDescription)
Description copied from interface:SBuild
Adds user provided build problem to the build. Currently build problem causes build failure. Adding user provided problem always overrides previously added one- Specified by:
addUserBuildProblem
in interfaceSBuild
- Overrides:
addUserBuildProblem
in classBaseBuild
- Parameters:
user
- user that will be used in audit- Returns:
- added build problem
-
muteBuildProblems
public void muteBuildProblems(@NotNull SUser user, boolean muteIfTrue, @NotNull String comment)
Description copied from interface:SBuild
Makes all existing build problems enabled or disabled- Specified by:
muteBuildProblems
in interfaceSBuild
- Overrides:
muteBuildProblems
in classBaseBuild
- Parameters:
user
- user that will be used in auditmuteIfTrue
- pass true to make build successful, false to make existing problems visible againcomment
- comment for audit
-
deleteBuildProblem
public void deleteBuildProblem(@NotNull SUser user, @NotNull String identity, @Nullable String comment)
Description copied from interface:BuildEx
Deletes build problem Deleting build problem may change build status to SUCCESS- Specified by:
deleteBuildProblem
in interfaceBuildEx
- Overrides:
deleteBuildProblem
in classBaseBuild
- Parameters:
user
- user that will be used in auditidentity
- identiry of build problem to be removedcomment
- comment for audit
-
getBuildFinishParameters
public DepParametersMemoryOptimizedMap getBuildFinishParameters()
- Overrides:
getBuildFinishParameters
in classBaseBuild
-
getBuildStartParameters
public DepParametersMemoryOptimizedMap getBuildStartParameters()
- Overrides:
getBuildStartParameters
in classBaseBuild
-
getSecurityContext
@NotNull public SecurityContextEx getSecurityContext()
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String featureType)
Description copied from interface:SBuild
Returns collection of enabled and resolved build features of specified type from build settings (resolving is performed at the moment of the method call).- Specified by:
getBuildFeaturesOfType
in interfaceSBuild
- Overrides:
getBuildFeaturesOfType
in classBaseBuild
- Parameters:
featureType
- type of the build feature- Returns:
- see above
-
-