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 BuildProblemDataaddUserBuildProblem(SUser user, String problemDescription)Adds user provided build problem to the build.voiddeleteBuildProblem(SUser user, String identity, String comment)Deletes build problem Deleting build problem may change build status to SUCCESSvoidfinish(Date finishDate)Finalizes all build related activities and finishes the build.BuildAgentExgetAgent()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).DepParametersMemoryOptimizedMapgetBuildFinishParameters()DepParametersMemoryOptimizedMapgetBuildStartParameters()SecurityContextExgetSecurityContext()voidmuteBuildProblems(SUser user, boolean muteIfTrue, String comment)Makes all existing build problems enabled or disabledvoidsetBuildComment(User user, String comment)Sets the comment for the buildvoidsetBuildNumber(String newBuildNumber)Set new value for this build build number instead of current one.voidsetCustomStatusText(String text)Sets the custom build status text.voidsetTags(List<String> tags)Sets public tags for this buildvoidsetTags(User user, List<String> tags)Sets public tags for this buildvoidstop(RunningBuildState interruptedState, User user, String comment, boolean reAdd2Queue)voidstop(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:SRunningBuildGet build agent this running build is running on. May be unregistered or even dead agent, but never null.- Specified by:
getAgentin interfaceRunningBuildInfo- Specified by:
getAgentin interfaceSBuild- Specified by:
getAgentin interfaceSRunningBuild- Overrides:
getAgentin classRunningBuildImpl- Returns:
- agent where this build executed.
-
stop
public void stop(User user, String comment)
Description copied from interface:SRunningBuildStops 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:
stopin interfaceSRunningBuild- Overrides:
stopin 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:
stopin interfaceRunningBuildEx- Overrides:
stopin 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:SRunningBuildFinalizes 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:
finishin interfaceSRunningBuild- Overrides:
finishin classRunningBuildImpl- Parameters:
finishDate- finish date
-
setTags
public void setTags(List<String> tags)
Description copied from interface:SBuildSets public tags for this build
-
setTags
public void setTags(User user, List<String> tags)
Description copied from interface:SBuildSets public tags for this build
-
setBuildComment
public void setBuildComment(@Nullable User user, @Nullable String comment)Description copied from interface:SBuildSets the comment for the build- Specified by:
setBuildCommentin interfaceSBuild- Overrides:
setBuildCommentin classBaseBuild- Parameters:
user- user who sets the commentcomment- text of the comment
-
setBuildNumber
public void setBuildNumber(@NotNull String newBuildNumber)Description copied from interface:SRunningBuildSet 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:
setBuildNumberin interfaceSRunningBuild- Overrides:
setBuildNumberin classRunningBuildImpl- Parameters:
newBuildNumber- new value for this build build number
-
setCustomStatusText
public void setCustomStatusText(@Nullable String text)Description copied from interface:RunningBuildExSets the custom build status text.- Specified by:
setCustomStatusTextin interfaceRunningBuildEx- Overrides:
setCustomStatusTextin 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:SBuildAdds user provided build problem to the build. Currently build problem causes build failure. Adding user provided problem always overrides previously added one- Specified by:
addUserBuildProblemin interfaceSBuild- Overrides:
addUserBuildProblemin 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:SBuildMakes all existing build problems enabled or disabled- Specified by:
muteBuildProblemsin interfaceSBuild- Overrides:
muteBuildProblemsin 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:BuildExDeletes build problem Deleting build problem may change build status to SUCCESS- Specified by:
deleteBuildProblemin interfaceBuildEx- Overrides:
deleteBuildProblemin 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:
getBuildFinishParametersin classBaseBuild
-
getBuildStartParameters
public DepParametersMemoryOptimizedMap getBuildStartParameters()
- Overrides:
getBuildStartParametersin classBaseBuild
-
getSecurityContext
@NotNull public SecurityContextEx getSecurityContext()
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String featureType)
Description copied from interface:SBuildReturns 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:
getBuildFeaturesOfTypein interfaceSBuild- Overrides:
getBuildFeaturesOfTypein classBaseBuild- Parameters:
featureType- type of the build feature- Returns:
- see above
-
-