Package com.atlassian.bamboo.chains
Interface ChainResultManager
- All Known Implementing Classes:
ChainResultManagerImpl
@Internal
public interface ChainResultManager
Chain specific result manager
Not for use by plugin developers
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Information that has to be preserved when rerunning plans. -
Method Summary
Modifier and TypeMethodDescriptioncleanForRerunBuild
(@NotNull BuildContext chainBuildContext) Removes all job and stage results.@NotNull ChainStateResult
create
(@NotNull BuildContext chainBuildContext, @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, @NotNull Collection<? extends ImmutableChainStage> stageToExecute) void
createRepositorySpecFailedResult
(@NotNull ImmutableChain plan, @NotNull VcsRepositoryData repositoryData, @NotNull BuildChanges buildChanges, int buildNumber, @NotNull VcsLocationBambooSpecsState specsState) Create and save chain result for plan which was not updated when Repository stored specs execution was failedvoid
createRepositorySpecSuccessResult
(@NotNull ImmutableChain plan, @NotNull VcsRepositoryData repositoryData, @NotNull BuildChanges buildChanges, int buildNumber) Create and save chain result for plan which was updated when Repository stored specs executed@NotNull ChainStateResult
createStateForRerunBuild
(@NotNull BuildContext chainBuildContext, @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig, @NotNull Map<PlanResultKey, ChainResultManager.JobResultInfoForRerun> jobRestartInfo) Creates aChainState
as well stage and job results for build already executed and being rerun.long
getAverageProgressDurationForStages
(@NotNull PlanIdentifier chain, @NotNull Collection<ChainStageResult> stageStates, int numberOfResults) Calculates average duration of provided stages execution@NotNull ChainStateResult
updateForContinuedBuild
(@NotNull BuildContext chainBuildContext, @NotNull Collection<BuildContext> jobBuildContexts, @NotNull PlanExecutionConfig planExecutionConfig) Creates aChainState
for build already executed and stopped on manual stage of failed@NotNull ChainStateResult
updateForRerunBuild
(@NotNull BuildContext chainBuildContext, @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig) Deprecated.void
updateStateToInProgress
(@NotNull PlanResultKey chainResultKey, @NotNull Date startDate)
-
Method Details
-
create
@NotNull @NotNull ChainStateResult create(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, @NotNull @NotNull Collection<? extends ImmutableChainStage> stageToExecute) - Parameters:
chainBuildContext
-jobBuildContexts
-stageToExecute
-- Returns:
- chainResultState
-
updateStateToInProgress
void updateStateToInProgress(@NotNull @NotNull PlanResultKey chainResultKey, @NotNull @NotNull Date startDate) - Parameters:
chainResultKey
-startDate
-
-
updateForContinuedBuild
@NotNull @NotNull ChainStateResult updateForContinuedBuild(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Collection<BuildContext> jobBuildContexts, @NotNull @NotNull PlanExecutionConfig planExecutionConfig) throws IOException Creates aChainState
for build already executed and stopped on manual stage of failed- Parameters:
chainBuildContext
-jobBuildContexts
-planExecutionConfig
- - controls the continue/restart execution- Returns:
- Throws:
IOException
-
updateForRerunBuild
@Deprecated @NotNull @NotNull ChainStateResult updateForRerunBuild(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Map<ImmutableChainStage, Map<ImmutableJob, throws IOExceptionBuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig) Deprecated.since 9.0 usecleanForRerunBuild(BuildContext)
followed by#createStateForRerunBuild(BuildContext, Map, PlanExecutionConfig)
Creates aChainState
for build already executed and being rerun. This means all succeeding manual stages that won't be executed should have their results wiped out.- Parameters:
chainBuildContext
-jobBuildContexts
-planExecutionConfig
- - controls the continue/restart execution- Throws:
IOException
-
cleanForRerunBuild
@NotNull @NotNull Map<PlanResultKey,ChainResultManager.JobResultInfoForRerun> cleanForRerunBuild(@NotNull @NotNull BuildContext chainBuildContext) Removes all job and stage results.- Returns:
- re
-
createStateForRerunBuild
@NotNull @NotNull ChainStateResult createStateForRerunBuild(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Map<ImmutableChainStage, Map<ImmutableJob, throws IOExceptionBuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig, @NotNull @NotNull Map<PlanResultKey, ChainResultManager.JobResultInfoForRerun> jobRestartInfo) Creates aChainState
as well stage and job results for build already executed and being rerun. Must be called aftercleanForRerunBuild(BuildContext)
- Throws:
IOException
-
getAverageProgressDurationForStages
long getAverageProgressDurationForStages(@NotNull @NotNull PlanIdentifier chain, @NotNull @NotNull Collection<ChainStageResult> stageStates, int numberOfResults) Calculates average duration of provided stages execution- Parameters:
chain
-stageStates
- stages for current execution of plan included in calculationnumberOfResults
- number of previous executions included in calculations- Returns:
-
createRepositorySpecFailedResult
void createRepositorySpecFailedResult(@NotNull @NotNull ImmutableChain plan, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull BuildChanges buildChanges, int buildNumber, @NotNull @NotNull VcsLocationBambooSpecsState specsState) Create and save chain result for plan which was not updated when Repository stored specs execution was failed -
createRepositorySpecSuccessResult
void createRepositorySpecSuccessResult(@NotNull @NotNull ImmutableChain plan, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull BuildChanges buildChanges, int buildNumber) Create and save chain result for plan which was updated when Repository stored specs executed
-
cleanForRerunBuild(BuildContext)
followed by#createStateForRerunBuild(BuildContext, Map, PlanExecutionConfig)