Class BuildResultsSummaryManagerImpl
- All Implemented Interfaces:
BuildResultsSummaryManager,ResultsSummaryManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariableContextSnapshotToResultSummary(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext) Adds state of global and plan variables to result at the beginning of execution.voidcalculateAndSetDeltaState(ResultsSummary resultsSummary) Figures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix.@Nullable LongcalculateQueueDuration(@NotNull ChainResultsSummary resultsSummary) Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.@Nullable LongcalculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary) Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.voidcleanPendingLifeCycleState(@NotNull PlanResultKey planResultKey) Cleans state of pending result.voidclearVariablesOnRerunBuild(@NotNull ResultsSummary resultsSummary) Clear stored stage manual variables when build is fully rerun.intcountResultsWithState(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState) Counts results with a given state in a given build number range for plan.<T extends ResultsSummary>
TcreateResultsSummary(@Nullable ChainResultsSummary chainResultsSummary, @NotNull BuildContext buildContext, @NotNull Class<T> aClass) <T extends ResultsSummary>
TcreateResultsSummary(@NotNull BuildContext buildContext, @NotNull Class<T> aClass) Creates aResultsSummaryof the givenClassfindAllBuildResultsNumbers(PlanKey planKey) findBuildResultNumbersRange(@NotNull PlanKey planKey) Finds minimum and maximum build number for a plan.@NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults) findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels) Searches through all chains to find any that have jobs which match the given labels.@Nullable ResultsSummaryfindFirstBuildResultAfterWithNoSpecsScans(@NotNull String planKey, int buildNumber) Finds the firstBuildResultsSummaryafter the specified build number for the given plan key, excluding results that are marked for deletion or are specs scan builds.@Nullable ResultsSummaryfindFirstFailedBuildResultAfter(@NotNull String buildKey, int buildNumber) Finds the first failedResultsSummaryafter buildNumber@Nullable ResultsSummaryfindFirstFailedBuildResultBetween(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber) Finds the first failed build between the upper and lower build numbers inclusively@Nullable ResultsSummaryfindFirstFailedBuildResultBetween(@NotNull ImmutablePlan build, int lowerBuildNumber, int upperBuildNumber) Finds the first failed build between the upper and lower build numbers inclusively.<T extends ResultsSummary>
TfindFirstResultAfter(@NotNull PlanResultKey planResultKey, Class<T> aClass) Finds the firstResultsSummaryafter a specified build which is either FINISHED or can be FINISHED, i.e. is not in NOT_BUILT state.@Nullable ResultsSummaryfindFirstSuccessfulBuildResultAfter(@NotNull PlanResultKey planResultKey) Finds the last successfulResultsSummaryafter buildNumber@NotNull List<LinkedJiraIssue> findJiraIssuesForPlanKey(@NotNull PlanKey planKey) Retrieves a list ofLinkedJiraIssuelinked to the given plan key@NotNull List<LinkedJiraIssue> findJiraIssuesForResults(@NotNull List<ResultsSummary> buildResults) Retrieves a list ofLinkedJiraIssuelinked to the given build result summariesfindJobKeysFromExistingChainResults(@NotNull PlanKey chainKey) Find keys of jobs for which results associated with given plan exist.@Nullable ResultsSummaryfindLastBuildResultBefore(@NotNull String buildKey, int buildNumber) Finds the last successful or failingBuildResultsSummarybefore buildNumber@Nullable ResultsSummaryfindLastBuildResultBeforeWithNoSpecsScans(@NotNull String planKey, int buildNumber) Finds the lastBuildResultsSummarybefore the specified build number for the given plan key, excluding results that are marked for deletion or are specs scan builds.<T extends ResultsSummary>
TfindLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds) Finds the last successful or failingBuildResultsSummarybefore buildNumber@Nullable ResultsSummaryfindLastFailingBuildResultBefore(@NotNull PlanKey planKey, int buildNumber) Finds the last failingResultsSummarybefore buildNumber@Nullable ResultsSummaryfindLastFailingBuildResultBefore(@NotNull ImmutablePlan build, int buildNumber) Finds the last failingResultsSummarybefore buildNumber<T extends ResultsSummary>
TfindLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass) Finds the last successful or failingResultsSummarybefore planResultKey.getBuildNumber<T extends ResultsSummary>
TfindLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass, boolean includeOnceOffBuilds) Finds the lastResultsSummarybefore planResultKey.getBuildNumber<T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass) <T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass, boolean ignoreSpecsResults) @Nullable ResultsSummaryfindLastSuccessfulBuildResultBefore(@NotNull PlanResultKey planResultKey) Finds the last successfulResultsSummarybefore build@Nullable ResultsSummaryfindLastSuccessfulBuildResultBefore(@NotNull PlanResultKey planResultKey, boolean includeOnceOffBuilds) Finds the last successfulResultsSummarybefore buildintfindMinimumBuildNumberForNLatest(@NotNull PlanKey planKey, int n) Find a build number for which exist n non-specs results with a build number greater or equal.@NotNull List<? extends ResultsSummary> findResultsSummariesByJiraIssues(@Nullable List<String> issueKeys) Finds a list of results which are linked to the given issue keys@NotNull List<? extends ResultsSummary> findResultsSummariesByProjectKey(@Nullable String projectKey) Provide a list of results which are linked to any issues under the given jira project key@NotNull List<ResultsSummary> getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount) Returns all theResultsSummaryobjects that represent build results strictly after the given build number.<T extends ResultsSummary>
@NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass) Returns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate<T extends ResultsSummary>
@NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass) Returns all theBuildResultsSummaryin aBuildState.UNKNOWNstate<T extends ResultsSummary>
@NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass) Returns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate<T extends ResultsSummary>
@NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass) Returns all theResultsSummaryin aLifeCycleState.PENDINGstate<T extends ResultsSummary>
@NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass) Returns all theResultsSummaryin aLifeCycleState.QUEUEDstate<T extends ResultsSummary>
TgetAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead) Generic search to find any result summary basing on the criteria provided.longgetAveragePlanExecutionDuration(@NotNull ImmutablePlan plan, int numberOfResults) Get average duration from n last results summaries in finished state for a plan.@NotNull List<ResultsSummary> getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount) Returns all theResultsSummaryobjects that represent build results strictly before the given build number.@Nullable ResultsSummarygetBreakingBuild(ResultsSummary buildResultsSummary) Returns the first failing build after the last successful build. ie the latest build before this one with the delta state "broken"@Nullable ChainStageResultgetChainStageResultById(@NotNull Long id) Returns aChainStageResultby its id@NotNull List<UnassociatedCommit> getCommitsForUser(@NotNull String username, int max) Retrieve a list of recent Commits for the given user.<T extends ResultsSummary>
@NotNull List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults) Returns all theResultsSummaryin aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate with the givenClass.@Nullable ResultsSummarygetFixingBuild(ResultsSummary buildResultsSummary) Returns the first successfulResultsSummaryfor givenResultsSummary.@NotNull List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull PlanIdentifier planIdentifier, int numberOfResults) Returns the most recent n failed build results.@NotNull List<ResultsSummary> getLastNResultsSummaries(@NotNull PlanIdentifier planIdentifier, int numberOfResults) Provides a list of the latest N results summaries for the given plan, newest first.<T extends ResultsSummary>
TgetLastResultsSummary(@NotNull String planKey, Class<T> aClass) Get the lastResultsSummaryfor planKey andClass<T extends ResultsSummary>
TgetLastResultsSummary(@NotNull String planKey, Class<T> aClass, boolean ignoreSpecsResults) Get the lastResultsSummaryfor planKey andClasswith possible skip of specs results.getLastSuccessfulResultSummary(@NotNull PlanKey planKey) Get the last successfulResultsSummaryfor planKeyRetrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to seeRetrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see@NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount) Returns all theResultsSummaryobjects that represent build results "around" the given build number.@NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int buildNumber) Returns all theResultsSummaryobjects that matches the passed build numbersintGets the number of concurrently running buildslonggetNumberOfFinalizedResults(@NotNull PlanKey planKey) Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlanlonggetNumberOfFinalizedResults(@NotNull ImmutablePlan plan) Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlanlonggetNumberOfFinishedResults(@NotNull Plan plan) longGet number of allResultsSummarys@Nullable ChainResultsSummarygetParentResultSummary(ResultsSummary resultsSummary) Get (@link ChainResultsSummary} containing givenResultsSummarygetResultsSummary(long id) Lookup the ResultsSummary by id@Nullable ResultsSummarygetResultsSummary(@NotNull PlanResultKey planResultKey) Lookup the ResultsSummary byPlanResultKey@Nullable ResultsSummarygetResultsSummary(@NotNull PlanResultKey planResultKey, ResultDataRead dataRead) Lookup the ResultsSummary byPlanResultKey.<T extends ResultsSummary>
TgetResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass) LookupResultsSummarybyPlanResultKeyand expected type<T extends ResultsSummary>
TgetResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead) LookupResultsSummarybyPlanResultKeyand expected type.<T extends ResultsSummary>
@NotNull List<T> getResultSummaries(@NotNull ResultsSummaryCriteria resultsSummaryCriteria) Generic search to find any result summaries basing on the criteria provided.<T extends ResultsSummary>
@NotNull List<T> getResultSummariesByChangeSetId(@NotNull String changeSetId, @NotNull Class<T> discriminator) Get a list of all build results containing a commit with the given changeset ID.<T extends ResultsSummary>
List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull String changeSetId, @NotNull Class<T> discriminator) Get a list of all build results containing a commit with the given changeset ID that are in the given repository.<T extends ResultsSummary,VCS extends BambooPluginDataIdProvider>
@NotNull List<T> getResultSummariesByChangeSetIds(@NotNull Iterable<Pair<String, VCS>> changeSetIds, Class<T> discriminator) Get a list of all build results containing a commit with any of the given changeset IDs and which are in the supplied list of repository datas.<T extends ResultsSummary>
@NotNull List<T> getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, Class<T> discriminator) Get a list of all build results containing a commit with any of the given changeset IDs.<T extends ResultsSummary>
@NotNull List<T> getResultSummariesByCheckoutChangesetId(@NotNull String changeSetId, @NotNull Class<T> discriminator) Get a list of all build results containing repositories checked out with the given changeset ID.<T extends ResultsSummary>
@NotNull List<T> getResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria) Searches forresult summariesaccording to the givencriteriafor use in build expiry.<T extends ResultsSummary>
@NotNull List<T> getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults) <T extends ResultsSummary>
@NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults) Get theResultsSummarys for the givenPlanin giveLifeCycleStatethat are Results are sorted by build number (descending).@Nullable ChainStageResultgetStageForResult(ResultsSummary resultsSummary) Get (@link ChainStageResult} containing givenResultsSummaryprotected voidinit()voidinvalidateLogSize(@NotNull PlanResultKey planResultKey) Invalidates the log size of aResultsSummarywith the givenPlanResultKey.intmarkResultSummariesForDeletion(@NotNull PlanKey planKey) Mass update of allResultsSummaryrecords in the database related to a Plan identified by planKey.voidmoveResultSummaries(@NotNull Plan newParentPlan, @NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey) Reassigns plan key ResultsSummaries associated with selected plan key.voidpostBuildVariableSnapshotUpdate(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext) Saves result variables produced in a job.intRemoves all theResultsSummaryobjects in the database that do not have a matchingPlanvoidremoveArtifacts(@NotNull ImmutablePlan plan, int buildNumber) Remove any artifacts stored for this plan resultvoidremoveArtifacts(@NotNull ResultsSummary resultsSummary) Remove any artifacts stored for this plan resultvoidremoveBuildLogs(ImmutablePlan plan, int buildNumber) Remove any build logs stored for this plan resultvoidremoveBuildLogs(ImmutablePlan plan, int buildNumber, long maxIgnoredSize) Remove build logs stored for this plan result that are greater than given size (in bytes).voidremoveBuildLogs(@NotNull ResultsSummary resultsSummary) Remove any build logs stored for this plan resultvoidremoveBuildLogs(@NotNull ResultsSummary resultsSummary, long maxIgnoredSize) Remove build logs stored for this plan result that are greater than given size (in bytes).voidremoveMatchingArtifacts(@NotNull ResultsSummary resultsSummary, @NotNull Predicate<ArtifactLink> predicate) Remove artifacts from results summary that match a predicate.voidremoveMergeResultSummary(@NotNull MergeResultSummary mergeResult) Removes merge result.intremoveResultsSummariesForPlan(@NotNull Plan plan) Remove all resultSummary objects for the given plan.intremoveResultsSummariesForPlan(@NotNull Plan plan, @NotNull List<PlanKey> affectedJobKeys) Remove all resultSummary objects for the given plan.voidremoveResultSummary(@NotNull PlanResultKey planResultKey) Remove plan result summary and all associated objects.voidremoveResultSummary(@NotNull ImmutablePlan plan, int buildNumber) Remove plan result summary and all associated objects.voidremoveResultSummary(@NotNull ResultsSummary resultsSummary) Remove plan result summary and all associated objects.resetResultSummary(@NotNull BuildResultsSummary resultsSummary) Prepare result summry to be reuse for plan rerunvoidsaveResultSummary(@NotNull ResultsSummary resultsSummary) Saves theResultsSummarylongscrollResultSummaries(@NotNull String buildKey, ResultDataRead resultDataRead, @NotNull Function<ResultsSummary, Void> function) Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized.longscrollResultSummaries(@NotNull String buildKey, @NotNull Function<ResultsSummary, Void> function) Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized.voidsetArtifactLinkManager(ArtifactLinkManager artifactLinkManager) voidsetBranchIntegrationService(BranchIntegrationService branchIntegrationService) voidsetBuildExecutionManager(BuildExecutionManager buildExecutionManager) voidsetBuildResultsSummaryDao(BuildResultsSummaryDao buildResultsSummaryDao) voidsetCommentManager(CommentManager commentManager) voidsetCommitDao(CommitDao commitDao) voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) voidsetExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager) voidsetJiraIssueUtils(JiraIssueUtils jiraIssueUtils) voidsetMergeResultSummaryDao(MergeResultSummaryDao mergeResultSummaryDao) voidsetPlanManager(PlanManager planManager) voidsetRepositoryDefinitionManager(RepositoryDefinitionManager repositoryDefinitionManager) voidsetVariableContextBaselineDao(VariableContextBaselineDao variableContextBaselineDao) voidsetVcsRepositoryManager(VcsRepositoryManager vcsRepositoryManager) @NotNull BuildResultsSummaryupdateBuildSummaryFromBuildResults(BuildContext buildContext, @NotNull CurrentlyBuilding currentlyBuilding, BuildResults buildResults) Updates BuildResultsSummary after build is completed.voidupdateLifeCycleState(@NotNull ResultsSummary resultsSummary, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState) Update LifeCycleState and saves the givenResultsSummaryvoidupdateLifeCycleState(@NotNull BuildIdentifier buildIdentifier, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState) Update LifeCycleState and saves theResultsSummaryfor givenBuildContextUpdates also timing informationvoidupdateLifeCycleState(@NotNull CurrentlyBuilding currentlyBuilding, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState) Update LifeCycleState and saves theResultsSummaryfor givenBuildContextUpdates also timing information.voidupdatePlanCompletedDate(@NotNull ChainResultsSummary resultSummary, @NotNull Date completionDate) Update completed date and duration ofChainResultsSummaryvoidupdateProcessingDuration(ChainResultsSummary resultSummary) UpdatesImmutableResultsSummary.getProcessingDuration()andChainStageResult.getProcessingDuration()based on chain execution.voidupdateResultSummaryWithBuildChanges(@NotNull BuildContext buildContext) voidupdateVariablesOnContinuedBuild(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext) Add manual variables added when starting manual stage or restarting failed stage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.resultsummary.ResultsSummaryManager
getLastNResultsSummaries
-
Constructor Details
-
BuildResultsSummaryManagerImpl
public BuildResultsSummaryManagerImpl()
-
-
Method Details
-
init
@PostConstruct protected void init() -
getResultSummariesForPlanByLifeCycleState
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull @NotNull Plan plan, @NotNull @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults) Description copied from interface:ResultsSummaryManagerGet theResultsSummarys for the givenPlanin giveLifeCycleStatethat are Results are sorted by build number (descending). User can skip first n result and request maximum number of results.- Specified by:
getResultSummariesForPlanByLifeCycleStatein interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
plan-lifeCycleState-firstResult- specifies the first item to be return (0 base index). Negative values treated as 0.maxResults- specifies amount of the results to be returned. Value <= 0 returns everything.- Returns:
- summaries
-
getResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults) Description copied from interface:ResultsSummaryManagerGet theResultsSummarys for the givenPlanin anyLifeCycleState. Results are sorted by build number (descending). User can skip first n result and request maximum number of results.- Specified by:
getResultSummariesForPlanin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
plan-firstResult- specifies the first item to be return (0 base index). Negative values treated as 0.maxResults- specifies amount of the results to be returned. Value <= 0 returns everything.- Returns:
- summaries
-
getChainStageResultById
Description copied from interface:ResultsSummaryManagerReturns aChainStageResultby its id- Specified by:
getChainStageResultByIdin interfaceResultsSummaryManager- Returns:
- chainStageResult
-
getResultsSummary
@Nullable public @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:ResultsSummaryManagerLookup the ResultsSummary byPlanResultKey- Specified by:
getResultsSummaryin interfaceResultsSummaryManager- Parameters:
planResultKey-- Returns:
- resultsSummary
-
getResultsSummary
@Nullable public @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, ResultDataRead dataRead) Description copied from interface:ResultsSummaryManagerLookup the ResultsSummary byPlanResultKey. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call- Specified by:
getResultsSummaryin interfaceResultsSummaryManager- Parameters:
planResultKey-dataRead-- Returns:
- resultsSummary
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass) Description copied from interface:ResultsSummaryManagerLookupResultsSummarybyPlanResultKeyand expected type- Specified by:
getResultsSummaryin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planResultKey-aClass-- Returns:
- resultSummary
-
getResultsSummary
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead) Description copied from interface:ResultsSummaryManagerLookupResultsSummarybyPlanResultKeyand expected type. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call- Specified by:
getResultsSummaryin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planResultKey-aClass-dataRead-- Returns:
- resultSummary
-
getResultsSummary
Description copied from interface:ResultsSummaryManagerLookup the ResultsSummary by id- Specified by:
getResultsSummaryin interfaceResultsSummaryManager- Parameters:
id- - database id- Returns:
- resultsSummary
-
resetResultSummary
public ResultsSummary resetResultSummary(@NotNull @NotNull BuildResultsSummary resultsSummary) throws IOException Description copied from interface:ResultsSummaryManagerPrepare result summry to be reuse for plan rerun- Specified by:
resetResultSummaryin interfaceResultsSummaryManager- Parameters:
resultsSummary-- Returns:
- Throws:
IOException
-
addVariableContextSnapshotToResultSummary
public void addVariableContextSnapshotToResultSummary(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext) Description copied from interface:ResultsSummaryManagerAdds state of global and plan variables to result at the beginning of execution. If first argument is chain result, also adds snapshot of manual variables.- Specified by:
addVariableContextSnapshotToResultSummaryin interfaceResultsSummaryManager- Parameters:
resultsSummary-variableContext-
-
updateVariablesOnContinuedBuild
public void updateVariablesOnContinuedBuild(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext) Description copied from interface:ResultsSummaryManagerAdd manual variables added when starting manual stage or restarting failed stage. Does nothing for job results.- Specified by:
updateVariablesOnContinuedBuildin interfaceResultsSummaryManager- Parameters:
resultsSummary-variableContext-
-
clearVariablesOnRerunBuild
Description copied from interface:ResultsSummaryManagerClear stored stage manual variables when build is fully rerun. Does nothing for job results.- Specified by:
clearVariablesOnRerunBuildin interfaceResultsSummaryManager- Parameters:
resultsSummary-
-
postBuildVariableSnapshotUpdate
public void postBuildVariableSnapshotUpdate(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext) Description copied from interface:ResultsSummaryManagerSaves result variables produced in a job. Does nothing for chain results.- Specified by:
postBuildVariableSnapshotUpdatein interfaceResultsSummaryManager- Parameters:
resultsSummary-variableContext-
-
getAllPendingResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryin aLifeCycleState.PENDINGstate- Specified by:
getAllPendingResultSummariesin interfaceResultsSummaryManager- Returns:
- pendingSummaries
-
getAllQueuedResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryin aLifeCycleState.QUEUEDstate- Specified by:
getAllQueuedResultSummariesin interfaceResultsSummaryManager- Returns:
- summaries
-
getAllInProgressResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate- Specified by:
getAllInProgressResultSummariesin interfaceResultsSummaryManager- Parameters:
aClass-- Returns:
- summaries
-
getAllActiveResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate- Specified by:
getAllActiveResultSummariesForPlanin interfaceResultsSummaryManager- Parameters:
aClass-- Returns:
- summaries
-
getFinalizedResultSummariesForPlan
@NotNull public <T extends ResultsSummary> @NotNull List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryin aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate with the givenClass. Results are sorted descending by build number.- Specified by:
getFinalizedResultSummariesForPlanin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planKey-aClass-firstResult- - specifies the first result to be included in the list.maxResults- - specifies the length of the result; 0 for all results;- Returns:
-
getNumberOfConcurrentlyRunningBuilds
Description copied from interface:ResultsSummaryManagerGets the number of concurrently running builds- Specified by:
getNumberOfConcurrentlyRunningBuildsin interfaceResultsSummaryManager- Parameters:
planKey-- Returns:
-
getAllBuildResultSummariesInUnknownState
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass) Description copied from interface:ResultsSummaryManagerReturns all theBuildResultsSummaryin aBuildState.UNKNOWNstate- Specified by:
getAllBuildResultSummariesInUnknownStatein interfaceResultsSummaryManager- Returns:
- summaries
-
createResultsSummary
public <T extends ResultsSummary> T createResultsSummary(@NotNull @NotNull BuildContext buildContext, @NotNull @NotNull Class<T> aClass) throws ResultsSummaryCreationException Description copied from interface:ResultsSummaryManagerCreates aResultsSummaryof the givenClass- Specified by:
createResultsSummaryin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
buildContext-aClass-- Returns:
- resultsSummary
- Throws:
ResultsSummaryCreationException
-
createResultsSummary
public <T extends ResultsSummary> T createResultsSummary(@Nullable @Nullable ChainResultsSummary chainResultsSummary, @NotNull @NotNull BuildContext buildContext, @NotNull @NotNull Class<T> aClass) throws ResultsSummaryCreationException - Specified by:
createResultsSummaryin interfaceBuildResultsSummaryManager- Throws:
ResultsSummaryCreationException
-
updateResultSummaryWithBuildChanges
public void updateResultSummaryWithBuildChanges(@NotNull @NotNull BuildContext buildContext) throws ResultsSummaryCreationException - Specified by:
updateResultSummaryWithBuildChangesin interfaceResultsSummaryManager- Throws:
ResultsSummaryCreationException
-
updateBuildSummaryFromBuildResults
@NotNull public @NotNull BuildResultsSummary updateBuildSummaryFromBuildResults(BuildContext buildContext, @NotNull @NotNull CurrentlyBuilding currentlyBuilding, BuildResults buildResults) Description copied from interface:BuildResultsSummaryManagerUpdates BuildResultsSummary after build is completed. All fiedls are initialized at this moment.- Specified by:
updateBuildSummaryFromBuildResultsin interfaceBuildResultsSummaryManager- Parameters:
currentlyBuilding-buildResults-- Returns:
- updated build result summary
-
calculateAndSetDeltaState
Description copied from interface:ResultsSummaryManagerFigures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix. This method only updates the values on the provided results summary object, it does not save it to the database. Assumes buildState has already been set on resultsSummary.- Specified by:
calculateAndSetDeltaStatein interfaceResultsSummaryManager- Parameters:
resultsSummary- to update
-
updateLifeCycleState
public void updateLifeCycleState(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState) Description copied from interface:ResultsSummaryManagerUpdate LifeCycleState and saves the givenResultsSummary- Specified by:
updateLifeCycleStatein interfaceResultsSummaryManager- Parameters:
resultsSummary- ResultsSummary to be updated and savedlifeCycleState- LifeCycleState to be setbuildState- BuildState to be set
-
cleanPendingLifeCycleState
Description copied from interface:ResultsSummaryManagerCleans state of pending result.- Specified by:
cleanPendingLifeCycleStatein interfaceResultsSummaryManager
-
updateLifeCycleState
public void updateLifeCycleState(@NotNull @NotNull BuildIdentifier buildIdentifier, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState) Description copied from interface:ResultsSummaryManagerUpdate LifeCycleState and saves theResultsSummaryfor givenBuildContextUpdates also timing information- Specified by:
updateLifeCycleStatein interfaceResultsSummaryManager- Parameters:
buildIdentifier- BuildIdentifier used to get information on ResultsSummarylifeCycleState- LifeCycleState to be setbuildState- BuildState to be set
-
updateLifeCycleState
public void updateLifeCycleState(@NotNull @NotNull CurrentlyBuilding currentlyBuilding, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState) Description copied from interface:ResultsSummaryManagerUpdate LifeCycleState and saves theResultsSummaryfor givenBuildContextUpdates also timing information.- Specified by:
updateLifeCycleStatein interfaceResultsSummaryManager- Parameters:
currentlyBuilding- in-memory state of the buildlifeCycleState- LifeCycleState to be setbuildState- BuildState to be set
-
updatePlanCompletedDate
public void updatePlanCompletedDate(@NotNull @NotNull ChainResultsSummary resultSummary, @NotNull @NotNull Date completionDate) Description copied from interface:ResultsSummaryManagerUpdate completed date and duration ofChainResultsSummary- Specified by:
updatePlanCompletedDatein interfaceResultsSummaryManager- Parameters:
resultSummary-completionDate-
-
updateProcessingDuration
Description copied from interface:ResultsSummaryManagerUpdatesImmutableResultsSummary.getProcessingDuration()andChainStageResult.getProcessingDuration()based on chain execution.- Specified by:
updateProcessingDurationin interfaceResultsSummaryManager- Parameters:
resultSummary-
-
markResultSummariesForDeletion
Description copied from interface:ResultsSummaryManagerMass update of allResultsSummaryrecords in the database related to a Plan identified by planKey.- Specified by:
markResultSummariesForDeletionin interfaceResultsSummaryManager- Parameters:
planKey- key of a plan- Returns:
- number of updated records
-
getBreakingBuild
Description copied from interface:ResultsSummaryManagerReturns the first failing build after the last successful build. ie the latest build before this one with the delta state "broken"- Specified by:
getBreakingBuildin interfaceResultsSummaryManager- Parameters:
buildResultsSummary- of the current build- Returns:
- null if there is no breaking build.
-
getFixingBuild
Description copied from interface:ResultsSummaryManagerReturns the first successfulResultsSummaryfor givenResultsSummary. The input build is returned if it is successful.- Specified by:
getFixingBuildin interfaceResultsSummaryManager- Parameters:
buildResultsSummary-- Returns:
- null if there is no fixing build.
-
getAnyResultSummary
@Nullable public <T extends ResultsSummary> T getAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead) Description copied from interface:ResultsSummaryManagerGeneric search to find any result summary basing on the criteria provided. Note that if criteria does not specify order then result of this method might be non-deterministic.- Specified by:
getAnyResultSummaryin interfaceResultsSummaryManager- Parameters:
criteria- containing all the search constraints- Returns:
- any resultSummary matching the criteria or null.
-
getResultSummaries
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummaries(@NotNull @NotNull ResultsSummaryCriteria resultsSummaryCriteria) Description copied from interface:ResultsSummaryManagerGeneric search to find any result summaries basing on the criteria provided.- Specified by:
getResultSummariesin interfaceResultsSummaryManager- Parameters:
resultsSummaryCriteria- containing all the search constraints- Returns:
- list of resultsSummaries matching the criteria.
-
getResultSummariesForExpiry
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria expiryCriteria) Description copied from interface:ResultsSummaryManagerSearches forresult summariesaccording to the givencriteriafor use in build expiry.- Specified by:
getResultSummariesForExpiryin interfaceResultsSummaryManager- Type Parameters:
T- type of returned results (determined by the criteria)- Parameters:
expiryCriteria- search constraints- Returns:
- list of
results summariesmatching the criteria
-
getLastNResultsSummaries
@NotNull public @NotNull List<ResultsSummary> getLastNResultsSummaries(@NotNull @NotNull PlanIdentifier planIdentifier, int numberOfResults) Description copied from interface:ResultsSummaryManagerProvides a list of the latest N results summaries for the given plan, newest first.- Specified by:
getLastNResultsSummariesin interfaceResultsSummaryManager- Parameters:
planIdentifier- - to get the results fornumberOfResults- - number of summaries you would like- Returns:
- list<ResultsSummary>
-
getLastNFailedResultsSummaries
@NotNull public @NotNull List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull @NotNull PlanIdentifier planIdentifier, int numberOfResults) Description copied from interface:ResultsSummaryManagerReturns the most recent n failed build results. Sorted by newest first.- Specified by:
getLastNFailedResultsSummariesin interfaceResultsSummaryManager- Parameters:
planIdentifier-numberOfResults- must be > 0
-
findResultsSummariesByJiraIssues
@NotNull public @NotNull List<? extends ResultsSummary> findResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys) Description copied from interface:ResultsSummaryManagerFinds a list of results which are linked to the given issue keys- Specified by:
findResultsSummariesByJiraIssuesin interfaceResultsSummaryManager- Parameters:
issueKeys- to search for- Returns:
- al list of ResultsSummary associated with any of the given list of issue keys
-
findResultsSummariesByProjectKey
@NotNull public @NotNull List<? extends ResultsSummary> findResultsSummariesByProjectKey(@Nullable @Nullable String projectKey) Description copied from interface:ResultsSummaryManagerProvide a list of results which are linked to any issues under the given jira project key- Specified by:
findResultsSummariesByProjectKeyin interfaceResultsSummaryManager- Parameters:
projectKey- - jira project key- Returns:
- a list of results which are linked to any issues under the given jira project key
-
findJiraIssuesForResults
@NotNull public @NotNull List<LinkedJiraIssue> findJiraIssuesForResults(@NotNull @NotNull List<ResultsSummary> buildResults) Description copied from interface:ResultsSummaryManagerRetrieves a list ofLinkedJiraIssuelinked to the given build result summaries- Specified by:
findJiraIssuesForResultsin interfaceResultsSummaryManager- Parameters:
buildResults- to look for issues attached to- Returns:
- a list of
LinkedJiraIssuelinked to the given build result summaries
-
findJiraIssuesForPlanKey
@NotNull public @NotNull List<LinkedJiraIssue> findJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey) Description copied from interface:ResultsSummaryManagerRetrieves a list ofLinkedJiraIssuelinked to the given plan key- Specified by:
findJiraIssuesForPlanKeyin interfaceResultsSummaryManager- Parameters:
planKey- to look for issues associated with plan of this key- Returns:
- a list of
LinkedJiraIssuelinked to the givenPlan
-
removeResultSummary
Description copied from interface:ResultsSummaryManagerRemove plan result summary and all associated objects.- Specified by:
removeResultSummaryin interfaceResultsSummaryManager- Parameters:
plan-buildNumber-
-
removeResultSummary
Description copied from interface:ResultsSummaryManagerRemove plan result summary and all associated objects.- Specified by:
removeResultSummaryin interfaceResultsSummaryManager
-
removeResultSummary
Description copied from interface:ResultsSummaryManagerRemove plan result summary and all associated objects.- Specified by:
removeResultSummaryin interfaceResultsSummaryManager
-
removeBuildLogs
Description copied from interface:ResultsSummaryManagerRemove any build logs stored for this plan result- Specified by:
removeBuildLogsin interfaceResultsSummaryManager- Parameters:
plan-buildNumber-
-
removeBuildLogs
Description copied from interface:ResultsSummaryManagerRemove build logs stored for this plan result that are greater than given size (in bytes).- Specified by:
removeBuildLogsin interfaceResultsSummaryManager- Parameters:
plan-buildNumber-maxIgnoredSize-
-
removeBuildLogs
Description copied from interface:ResultsSummaryManagerRemove any build logs stored for this plan result- Specified by:
removeBuildLogsin interfaceResultsSummaryManager- Parameters:
resultsSummary-
-
removeBuildLogs
Description copied from interface:ResultsSummaryManagerRemove build logs stored for this plan result that are greater than given size (in bytes).- Specified by:
removeBuildLogsin interfaceResultsSummaryManager- Parameters:
resultsSummary-maxIgnoredSize-
-
removeMatchingArtifacts
public void removeMatchingArtifacts(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull Predicate<ArtifactLink> predicate) throws IOException Description copied from interface:ResultsSummaryManagerRemove artifacts from results summary that match a predicate.- Specified by:
removeMatchingArtifactsin interfaceResultsSummaryManager- Parameters:
resultsSummary-predicate-- Throws:
IOException
-
removeArtifacts
public void removeArtifacts(@NotNull @NotNull ImmutablePlan plan, int buildNumber) throws IOException Description copied from interface:ResultsSummaryManagerRemove any artifacts stored for this plan result- Specified by:
removeArtifactsin interfaceResultsSummaryManager- Parameters:
plan-buildNumber-- Throws:
IOException
-
removeArtifacts
Description copied from interface:ResultsSummaryManagerRemove any artifacts stored for this plan result- Specified by:
removeArtifactsin interfaceResultsSummaryManager- Parameters:
resultsSummary-- Throws:
IOException
-
findChainResultsWithJobLabelled
public List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels) Description copied from interface:ResultsSummaryManagerSearches through all chains to find any that have jobs which match the given labels. The list of chains is then filtered if required, using other criteria elements. Currently the only used criteria are:- buildKey
- toBuildDate
- toBuildNumber
- Specified by:
findChainResultsWithJobLabelledin interfaceResultsSummaryManager- Parameters:
criteria- containing the restrictions for the chains to be returnedlabels- that the jobs can be associated with- Returns:
- list of ChainResultSummary that match the criteria and have jobs with any of the given labels
-
getNeighbouringSummaries
Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryobjects that matches the passed build numbers- Specified by:
getNeighbouringSummariesin interfaceResultsSummaryManager- Parameters:
plan-buildNumber-- Returns:
ListofBuildResultsSummary
-
getNeighbouringSummaries
@NotNull public @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryobjects that represent build results "around" the given build number.- Specified by:
getNeighbouringSummariesin interfaceResultsSummaryManager- Parameters:
plan- the plan to return results forbuildNumber- the build number to search aroundmaxCount- the maximum number of builds to return- Returns:
ListofBuildResultsSummaryin ascending order. At most there will bemaxCountitems in the list, inclusive of the result forbuildNumber(if present).
-
getBeforeSummaries
@NotNull public @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryobjects that represent build results strictly before the given build number.- Specified by:
getBeforeSummariesin interfaceResultsSummaryManager- Parameters:
plan- the plan to return results forbuildNumber- the build number to search beforemaxCount- the maximum number of builds to return- Returns:
ListofBuildResultsSummaryin ascending order. At most there will bemaxCountitems in the list, exclusive of the result forbuildNumber(if present).
-
getAfterSummaries
@NotNull public @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount) Description copied from interface:ResultsSummaryManagerReturns all theResultsSummaryobjects that represent build results strictly after the given build number.- Specified by:
getAfterSummariesin interfaceResultsSummaryManager- Parameters:
plan- the plan to return results forbuildNumber- the build number to search aftermaxCount- the maximum number of builds to return- Returns:
ListofBuildResultsSummaryin ascending order. At most there will bemaxCountitems in the list, exclusive of the result forbuildNumber(if present).
-
removeResultsSummariesForPlan
public int removeResultsSummariesForPlan(@NotNull @NotNull Plan plan, @NotNull @NotNull List<PlanKey> affectedJobKeys) Description copied from interface:ResultsSummaryManagerRemove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands ofResultsSummaryobjects to be deleted.- Specified by:
removeResultsSummariesForPlanin interfaceResultsSummaryManager- Parameters:
plan- to remove results for.affectedJobKeys- identifiers of jobs related to the plan you want to remove results for.- Returns:
- number of
ResultsSummarys removed
-
removeResultsSummariesForPlan
Description copied from interface:ResultsSummaryManagerRemove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands ofResultsSummaryobjects to be deleted.- Specified by:
removeResultsSummariesForPlanin interfaceResultsSummaryManager- Parameters:
plan- to remove results for.- Returns:
- number of
ResultsSummarys removed
-
removeAllOrphanedResultSummaries
public int removeAllOrphanedResultSummaries()Description copied from interface:ResultsSummaryManagerRemoves all theResultsSummaryobjects in the database that do not have a matchingPlan- Specified by:
removeAllOrphanedResultSummariesin interfaceResultsSummaryManager- Returns:
- number of
ResultsSummarys removed
-
saveResultSummary
Description copied from interface:ResultsSummaryManagerSaves theResultsSummary- Specified by:
saveResultSummaryin interfaceResultsSummaryManager- Parameters:
resultsSummary-
-
getLastSuccessfulResultSummary
Description copied from interface:ResultsSummaryManagerGet the last successfulResultsSummaryfor planKey- Specified by:
getLastSuccessfulResultSummaryin interfaceResultsSummaryManager- Parameters:
planKey-- Returns:
-
findLastSuccessfulBuildResultBefore
@Nullable public @Nullable ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:ResultsSummaryManagerFinds the last successfulResultsSummarybefore build- Specified by:
findLastSuccessfulBuildResultBeforein interfaceResultsSummaryManager- Parameters:
planResultKey-- Returns:
- buildResult
-
findLastSuccessfulBuildResultBefore
@Nullable public @Nullable ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull @NotNull PlanResultKey planResultKey, boolean includeOnceOffBuilds) Description copied from interface:ResultsSummaryManagerFinds the last successfulResultsSummarybefore build- Specified by:
findLastSuccessfulBuildResultBeforein interfaceResultsSummaryManager
-
findFirstResultAfter
@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass) Description copied from interface:ResultsSummaryManagerFinds the firstResultsSummaryafter a specified build which is either FINISHED or can be FINISHED, i.e. is not in NOT_BUILT state.- Specified by:
findFirstResultAfterin interfaceResultsSummaryManager- Parameters:
planResultKey-aClass-- Returns:
-
findLastResultBefore
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass) Description copied from interface:ResultsSummaryManagerFinds the last successful or failingResultsSummarybefore planResultKey.getBuildNumber- Specified by:
findLastResultBeforein interfaceResultsSummaryManager- Parameters:
planResultKey-aClass-- Returns:
-
findLastResultBefore
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass, boolean includeOnceOffBuilds) Description copied from interface:ResultsSummaryManagerFinds the lastResultsSummarybefore planResultKey.getBuildNumber- Specified by:
findLastResultBeforein interfaceResultsSummaryManager- Parameters:
planResultKey-aClass-includeOnceOffBuilds- - should we skip once-off builds or include them in the search- Returns:
-
findLastResultSummaryWithState
public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass) - Specified by:
findLastResultSummaryWithStatein interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planKey-buildState-aClass-- Returns:
- the last
ResultsSummarywith the providedBuildState
-
findLastResultSummaryWithState
@Nullable public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass, boolean ignoreSpecsResults) - Specified by:
findLastResultSummaryWithStatein interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planKey-buildState-aClass-ignoreSpecsResults-- Returns:
- the last
ResultsSummarywith the providedBuildState
-
getResultSummariesByChangeSetId
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesByChangeSetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator) Description copied from interface:ResultsSummaryManagerGet a list of all build results containing a commit with the given changeset ID.
Please note that a build result summary contains list of commits which were added in a given build (compared to a previous one). It means that a list of commits may be empty if there were no repository changes. A list of commits is also empty in case of a first build in a plan or a first build of a plan's branch. A build results summary may also contain no commits if no version control system was used.
This will not return records marked for deletion.
In case you need to find build results based on commit which was checked out into a build workspace, see the
ResultsSummaryManager.getResultSummariesByCheckoutChangesetId(String, Class)- Specified by:
getResultSummariesByChangeSetIdin interfaceResultsSummaryManager- Type Parameters:
T- extends ResultSummary- Parameters:
changeSetId- of the commitdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
-
getResultSummariesByCheckoutChangesetId
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesByCheckoutChangesetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator) Description copied from interface:ResultsSummaryManagerGet a list of all build results containing repositories checked out with the given changeset ID.
A build may use one or more repositories, each checked out with a certain changeset. This method returns build results having exact changeset ID checked out (note that it does not search for intermediate commits between two changeset IDs).
This will not return records marked for deletion.
In case you need to find build results based on commits which were added in certain build (compared to a previous one), see the
ResultsSummaryManager.getResultSummariesByChangeSetId(String, Class)- Specified by:
getResultSummariesByCheckoutChangesetIdin interfaceResultsSummaryManager- Type Parameters:
T- extends ResultSummary- Parameters:
changeSetId- of the checkout commitdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a repository which
was checked out with a
changeSetIdcommit
-
getResultSummariesByChangeSetIdAndRepository
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator) Description copied from interface:ResultsSummaryManagerGet a list of all build results containing a commit with the given changeset ID that are in the given repository.- Specified by:
getResultSummariesByChangeSetIdAndRepositoryin interfaceResultsSummaryManager- Type Parameters:
T- extends ResultSummary- Parameters:
repositoryId- of the repositorychangeSetId- of the commitdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
-
getResultSummariesByChangeSetIds
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, Class<T> discriminator) Description copied from interface:ResultsSummaryManagerGet a list of all build results containing a commit with any of the given changeset IDs.- Specified by:
getResultSummariesByChangeSetIdsin interfaceResultsSummaryManager- Type Parameters:
T- extends ResultSummary- Parameters:
changeSetIds- of the commitdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with any of the given changeSetIds
-
getResultSummariesByChangeSetIds
@NotNull public <T extends ResultsSummary,VCS extends BambooPluginDataIdProvider> @NotNull List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull Iterable<Pair<String, VCS>> changeSetIds, Class<T> discriminator) Description copied from interface:ResultsSummaryManagerGet a list of all build results containing a commit with any of the given changeset IDs and which are in the supplied list of repository datas.- Specified by:
getResultSummariesByChangeSetIdsin interfaceResultsSummaryManager- Type Parameters:
T- extends ResultSummary- Parameters:
changeSetIds- of the commit anding with the repository that commit came fromdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with any of the given changeSetIds
-
getCommitsForUser
@NotNull public @NotNull List<UnassociatedCommit> getCommitsForUser(@NotNull @NotNull String username, int max) Description copied from interface:ResultsSummaryManagerRetrieve a list of recent Commits for the given user. Items in the collection are unique and sorted by date.- Specified by:
getCommitsForUserin interfaceResultsSummaryManager- Parameters:
username- to filter commits bymax- maximum number of commits to get.- Returns:
- a list of recent Commits for the given user
-
findLastBuildResultBefore
@Nullable public @Nullable ResultsSummary findLastBuildResultBefore(@NotNull @NotNull String buildKey, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the last successful or failingBuildResultsSummarybefore buildNumber- Specified by:
findLastBuildResultBeforein interfaceResultsSummaryManager- Parameters:
buildKey-buildNumber-- Returns:
-
findLastBuildResultBeforeWithTests
public <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds) Description copied from interface:ResultsSummaryManagerFinds the last successful or failingBuildResultsSummarybefore buildNumber- Specified by:
findLastBuildResultBeforeWithTestsin interfaceResultsSummaryManager- Parameters:
planResultKey-aClass-includeOnceOffBuilds- should once-off builds be considered or ignored in the search- Returns:
- resultsSummary
-
findFirstBuildResultAfterWithNoSpecsScans
@Nullable public @Nullable ResultsSummary findFirstBuildResultAfterWithNoSpecsScans(@NotNull @NotNull String planKey, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the firstBuildResultsSummaryafter the specified build number for the given plan key, excluding results that are marked for deletion or are specs scan builds. The returned result will have a build number greater than the provided value.- Specified by:
findFirstBuildResultAfterWithNoSpecsScansin interfaceResultsSummaryManager- Parameters:
planKey- the key of the plan to search results forbuildNumber- the build number to search after (exclusive)- Returns:
- the first
BuildResultsSummaryafter the given build number, ornullif none exists
-
findLastBuildResultBeforeWithNoSpecsScans
@Nullable public @Nullable ResultsSummary findLastBuildResultBeforeWithNoSpecsScans(@NotNull @NotNull String planKey, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the lastBuildResultsSummarybefore the specified build number for the given plan key, excluding results that are marked for deletion or are specs scan builds. The returned result will have a build number less than the provided value.- Specified by:
findLastBuildResultBeforeWithNoSpecsScansin interfaceResultsSummaryManager- Parameters:
planKey- the key of the plan to search results forbuildNumber- the build number to search before (exclusive)- Returns:
- the last
BuildResultsSummarybefore the given build number, ornullif none exists
-
findFirstFailedBuildResultAfter
@Nullable public @Nullable ResultsSummary findFirstFailedBuildResultAfter(@NotNull @NotNull String buildKey, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the first failedResultsSummaryafter buildNumber- Specified by:
findFirstFailedBuildResultAfterin interfaceResultsSummaryManager- Parameters:
buildKey-buildNumber-- Returns:
- buildResult
-
findFirstSuccessfulBuildResultAfter
@Nullable public @Nullable ResultsSummary findFirstSuccessfulBuildResultAfter(@NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:ResultsSummaryManagerFinds the last successfulResultsSummaryafter buildNumber- Specified by:
findFirstSuccessfulBuildResultAfterin interfaceResultsSummaryManager- Parameters:
planResultKey-- Returns:
- buildResult
-
findLastFailingBuildResultBefore
@Nullable public @Nullable ResultsSummary findLastFailingBuildResultBefore(@NotNull @NotNull ImmutablePlan build, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the last failingResultsSummarybefore buildNumber- Specified by:
findLastFailingBuildResultBeforein interfaceResultsSummaryManager- Parameters:
build-buildNumber-- Returns:
- buildResult
-
findLastFailingBuildResultBefore
@Nullable public @Nullable ResultsSummary findLastFailingBuildResultBefore(@NotNull @NotNull PlanKey planKey, int buildNumber) Description copied from interface:ResultsSummaryManagerFinds the last failingResultsSummarybefore buildNumber- Specified by:
findLastFailingBuildResultBeforein interfaceResultsSummaryManager- Returns:
- buildResult
-
findFirstFailedBuildResultBetween
@Nullable public @Nullable ResultsSummary findFirstFailedBuildResultBetween(@NotNull @NotNull ImmutablePlan build, int lowerBuildNumber, int upperBuildNumber) Description copied from interface:ResultsSummaryManagerFinds the first failed build between the upper and lower build numbers inclusively.- Specified by:
findFirstFailedBuildResultBetweenin interfaceResultsSummaryManager- Parameters:
build-lowerBuildNumber-upperBuildNumber-- Returns:
- buildResults
-
findFirstFailedBuildResultBetween
@Nullable public @Nullable ResultsSummary findFirstFailedBuildResultBetween(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber) Description copied from interface:ResultsSummaryManagerFinds the first failed build between the upper and lower build numbers inclusively.*- Specified by:
findFirstFailedBuildResultBetweenin interfaceResultsSummaryManager
-
getParentResultSummary
@Nullable public @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary resultsSummary) Description copied from interface:ResultsSummaryManagerGet (@link ChainResultsSummary} containing givenResultsSummary- Specified by:
getParentResultSummaryin interfaceResultsSummaryManager- Parameters:
resultsSummary-- Returns:
-
getStageForResult
Description copied from interface:ResultsSummaryManagerGet (@link ChainStageResult} containing givenResultsSummary- Specified by:
getStageForResultin interfaceResultsSummaryManager- Parameters:
resultsSummary-- Returns:
-
getNumberOfResults
public long getNumberOfResults()Description copied from interface:ResultsSummaryManagerGet number of allResultsSummarys- Specified by:
getNumberOfResultsin interfaceResultsSummaryManager- Returns:
- number of summaries
-
getNumberOfFinishedResults
Description copied from interface:ResultsSummaryManager- Specified by:
getNumberOfFinishedResultsin interfaceResultsSummaryManager- Parameters:
plan-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
Description copied from interface:ResultsSummaryManagerGet number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlan- Specified by:
getNumberOfFinalizedResultsin interfaceResultsSummaryManager- Parameters:
plan-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
Description copied from interface:ResultsSummaryManagerGet number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlan- Specified by:
getNumberOfFinalizedResultsin interfaceResultsSummaryManager- Parameters:
planKey-- Returns:
- number of summaries
-
getLatestResultSummaries
Description copied from interface:ResultsSummaryManagerRetrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see- Specified by:
getLatestResultSummariesin interfaceResultsSummaryManager- Returns:
ListofResultsSummary
-
getLatestFailedResultSummaries
Description copied from interface:ResultsSummaryManagerRetrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see- Specified by:
getLatestFailedResultSummariesin interfaceResultsSummaryManager- Returns:
ListofResultsSummary
-
getAveragePlanExecutionDuration
public long getAveragePlanExecutionDuration(@NotNull @NotNull ImmutablePlan plan, int numberOfResults) Description copied from interface:ResultsSummaryManagerGet average duration from n last results summaries in finished state for a plan. Results in SUCCESSFUL state are preferred; only if there are none those in FAILED state are selected.- Specified by:
getAveragePlanExecutionDurationin interfaceResultsSummaryManager- Parameters:
plan-numberOfResults- amount of results to be taken into account for average calculation- Returns:
- average duration in milliseconds or 0 if there is no results
-
countResultsWithState
public int countResultsWithState(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState) Description copied from interface:ResultsSummaryManagerCounts results with a given state in a given build number range for plan.- Specified by:
countResultsWithStatein interfaceResultsSummaryManager- Parameters:
planKey- the key of plan to analyselowerBuildNumber- the build number to start the count withupperBuildNumber- the build number to end the count withbuildState- the state that will be counted- Returns:
- the count
-
getLastResultsSummary
@Nullable public <T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull String planKey, Class<T> aClass) Description copied from interface:ResultsSummaryManagerGet the lastResultsSummaryfor planKey andClass- Specified by:
getLastResultsSummaryin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planKey-aClass-- Returns:
-
getLastResultsSummary
public <T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull String planKey, Class<T> aClass, boolean ignoreSpecsResults) Description copied from interface:ResultsSummaryManagerGet the lastResultsSummaryfor planKey andClasswith possible skip of specs results.- Specified by:
getLastResultsSummaryin interfaceResultsSummaryManager- Type Parameters:
T-- Parameters:
planKey-aClass-ignoreSpecsResults-- Returns:
-
moveResultSummaries
public void moveResultSummaries(@NotNull @NotNull Plan newParentPlan, @NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey) Description copied from interface:ResultsSummaryManagerReassigns plan key ResultsSummaries associated with selected plan key.- Specified by:
moveResultSummariesin interfaceResultsSummaryManager- Parameters:
newParentPlan- the new parent plan of result summaries. This should be a plan, not a job.
-
scrollResultSummaries
public long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull Function<ResultsSummary, Void> function) Description copied from interface:ResultsSummaryManagerScroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Specified by:
scrollResultSummariesin interfaceResultsSummaryManager- Parameters:
buildKey- of the plan you want to scroll the result summaries forfunction- function to be executed on each of the BuildResultSummary- Returns:
- number of traversed rows
-
scrollResultSummaries
public long scrollResultSummaries(@NotNull @NotNull String buildKey, ResultDataRead resultDataRead, @NotNull @NotNull Function<ResultsSummary, Void> function) Description copied from interface:ResultsSummaryManagerScroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Specified by:
scrollResultSummariesin interfaceResultsSummaryManager- Parameters:
buildKey- of the plan you want to scroll the result summaries forresultDataRead- if the data should be loaded lazy or eagerlyfunction- function to be executed on each of the BuildResultSummary- Returns:
- number of traversed rows
-
removeMergeResultSummary
Description copied from interface:ResultsSummaryManagerRemoves merge result. Use with care.- Specified by:
removeMergeResultSummaryin interfaceResultsSummaryManager
-
getPlanKeysSortedByNumberOfFinalizedResultSummaries
- Specified by:
getPlanKeysSortedByNumberOfFinalizedResultSummariesin interfaceResultsSummaryManager
-
calculateQueueDuration
@Nullable public @Nullable Long calculateQueueDuration(@NotNull @NotNull ChainResultsSummary resultsSummary) Description copied from interface:ResultsSummaryManagerCalculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.- Specified by:
calculateQueueDurationin interfaceResultsSummaryManager- Parameters:
resultsSummary-ChainResultsSummaryfor which calculation has to be made- Returns:
- queueDuration value or null if there are no related
BuildResultsSummaryrecords
-
calculateVcsUpdateDuration
@Nullable public @Nullable Long calculateVcsUpdateDuration(@NotNull @NotNull ChainResultsSummary resultsSummary) Description copied from interface:ResultsSummaryManagerCalculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.- Specified by:
calculateVcsUpdateDurationin interfaceResultsSummaryManager- Parameters:
resultsSummary-ChainResultsSummaryfor which calculation has to be made- Returns:
- vcsUpdateDuration value or null if there are no related
BuildResultsSummaryrecords
-
findAllBuildResultsNumbers
- Specified by:
findAllBuildResultsNumbersin interfaceResultsSummaryManager
-
invalidateLogSize
Description copied from interface:ResultsSummaryManagerInvalidates the log size of aResultsSummarywith the givenPlanResultKey. For aBuildResultsSummarytheChainResultsSummary's max log size will also be invalidated.- Specified by:
invalidateLogSizein interfaceResultsSummaryManager- Parameters:
planResultKey- result key
-
findChainResultsWithFormatVersionLessThan
@NotNull public @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults) - Specified by:
findChainResultsWithFormatVersionLessThanin interfaceResultsSummaryManager
-
findBuildResultNumbersRange
@NotNull public @NotNull Range<Integer> findBuildResultNumbersRange(@NotNull @NotNull PlanKey planKey) Description copied from interface:ResultsSummaryManagerFinds minimum and maximum build number for a plan. Works for both chains and jobs.- Specified by:
findBuildResultNumbersRangein interfaceResultsSummaryManager- Parameters:
planKey-- Returns:
- (min, max) pair or (0,0) if there are no results.
-
findJobKeysFromExistingChainResults
@NotNull public @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey) Description copied from interface:ResultsSummaryManagerFind keys of jobs for which results associated with given plan exist. The jobs themselves might no longer exist. Internal use only- Specified by:
findJobKeysFromExistingChainResultsin interfaceResultsSummaryManager
-
findMinimumBuildNumberForNLatest
Description copied from interface:ResultsSummaryManagerFind a build number for which exist n non-specs results with a build number greater or equal. If the build has less that n such results, the lowest build number is returned.- Specified by:
findMinimumBuildNumberForNLatestin interfaceResultsSummaryManager
-
setBuildResultsSummaryDao
-
setExtendedAuthorManager
-
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
setJiraIssueUtils
-
setArtifactLinkManager
-
setCommitDao
-
setBuildExecutionManager
-
setRepositoryDefinitionManager
-
setCommentManager
-
setBranchIntegrationService
-
setMergeResultSummaryDao
-
setVariableContextBaselineDao
-
setVcsRepositoryManager
-
setPlanManager
-