Interface BuildResultsSummaryDao
-
- All Superinterfaces:
BambooObjectDao<ResultsSummary>
- All Known Implementing Classes:
BuildResultsSummaryHibernateDao
@Internal public interface BuildResultsSummaryDao extends BambooObjectDao<ResultsSummary>
-
-
Field Summary
Fields Modifier and Type Field Description static intNUMBER_OF_DAYS_TO_FILTER
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @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.intcountBuildResultsSummaries()Count all result summaries records.intcountBuildResultsSummaries(@NotNull String planKey)<T extends ResultsSummary>
LongcountByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass)CountsResultsSummaryobjects given aByJiraIssueResultSearchCriteriaandResultSummarySearchCriteria.longcountResultSummaries(@NotNull ResultsSummaryCriteria criteria)Count the number ofResultsSummaryobjects given aResultsSummaryCriteria.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.List<Integer>findAllBuildResultsNumbers(PlanKey planKey)<T extends ResultsSummary>
TfindAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)Searches for anyResultsSummaryobject given aResultsSummaryCriteria.@NotNull Range<Integer>findBuildResultsNumberRange(PlanKey planKey)Finds minimum and maximum build number for a plan.@NotNull List<ResultsSummary>findBuildResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)Get a list of results summaries associated with the list of issue keys.@NotNull List<ResultsSummary>findBuildResultsSummariesByProjectKey(@Nullable String jiraProjectKey)Retrieve a list of results summaries associated with given JIRA project key This will not return records marked for deletion.List<Pair<ArtifactLink,BuildResultsSummary>>findBuildResultsWithArtifacts(String planKey)Find all build results which have matching artifacts.@NotNull List<BuildResultsSummary>findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImageConfiguration, @Nullable BuildState buildState, int maxResults)Searcher for builds of an image<T extends ResultsSummary>
List<T>findByAuthors(@NotNull Collection<ExtendedAuthor> authors, @NotNull Class<T> resultClass, int maxResults)<T extends ResultsSummary>
@NotNull List<T>findByCriteria(@NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass, @NotNull ResultDataRead dataRead)Searches for anyResultsSummaryobject given aResultSummarySearchCriteria.<T extends ResultsSummary>
@NotNull List<T>findByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass, @NotNull ResultDataRead dataRead)Searches for anyResultsSummaryobject given aByJiraIssueResultSearchCriteriaandResultSummarySearchCriteria.@NotNull List<PlanResultKey>findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)Deprecated.internal use onlyList<ChainResultsSummary>findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels)Searches through all chains to find any that have jobs which match the given labels.@Nullable IntegerfindFirstBuildNumberAfter(@NotNull String planKey, int buildNumber)Returns the build number of next existing build results.@Nullable ResultsSummaryfindFirstBuildResultWithBuildStateAfter(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState)Finds the last successfulBuildResultsSummaryafter buildNumber@Nullable ResultsSummaryfindFirstBuildResultWithBuildStateBetween(@NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState)Returns the first build that matchesBuildStatebetween the given build number range Note that this function is inclusive of the upper and lower bound<T extends ResultsSummary>
TfindFirstResultAfter(@NotNull String planKey, int buildNumber, Class<T> aClass)Finds the first successful or failedBuildResultsSummaryafter buildNumber@NotNull List<PlanKey>findJobKeysFromExistingChainResults(@NotNull PlanKey chainKey)Find keys of jobs for which results associated with given plan exist.@Nullable IntegerfindLastBuildNumberBefore(@NotNull String planKey, int buildNumber)Returns the build number of previous existing build results.<T extends ResultsSummary>
TfindLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds)ResultsSummaryfindLastBuildResultWithBuildStateBefore(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState, boolean includeOnceOffBuilds)Finds the lastBuildResultsSummarybefore buildNumber withBuildState<T extends ResultsSummary>
TfindLastResultBefore(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)Finds the last successful or failedResultsSummarybefore buildNumber<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)List<ResultsSummary>findLatestFailedResultSummaries()Find the failed result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTERList<ResultsSummary>findLatestResultsSummaries()Find the result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTERintfindMinimumBuildNumberForNLatest(@NotNull PlanKey planKey, int n)Find a build number for which exist n non-specs results with a build number greater or equal.Iterable<PlanKey>findPlanKeysFromAllOrphanedResultSummaries()Scans database for all theChainResultsSummaryobjects in the database that do not have a matchingChain<T extends ResultsSummary>
@NotNull List<T>findResultsSummaries(@NotNull ResultsSummaryCriteria criteria)Searches forResultsSummaryobjects given aResultsSummaryCriteria.<T extends ResultsSummary>
@NotNull List<T>findResultSummariesForExpiry(@NotNull ExpiryCriteria criteria)Searches forResultsSummaryobjects given aExpiryCriteria.@NotNull Set<Long>findSpecsStatesIdsReferencedByBuildResultSummaries()Finds all specs states ids that are referenced by any build result summary@NotNull List<ResultsSummary>getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)Returns build results strictly after given build number.<T extends ResultsSummary>
@NotNull Collection<T>getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)Returns all theResultsSummaryin aLifeCycleState.PENDING,LifeCycleState.QUEUED,LifeCycleState.IN_PROGRESSstate with the givenClassSee alsoLifeCycleState.isActive(LifeCycleState)andImmutableResultsSummary.isActive()<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInBuildState(@NotNull BuildState state, Class<T> aClass)Returns all theBuildResultsSummaryin requested build state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInLifeCycleState(@NotNull LifeCycleState state, Class<T> aClass)Returns all theBuildResultsSummaryin requested lifecycle state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInUnknownState(Class<T> aClass)Returns all theBuildResultsSummaryin aBuildState.UNKNOWNstate This will not return records marked for deletion.@NotNull Collection<BuildResultsSummary>getAllInProgressBuildResultSummaries()Returns all theBuildResultsSummaryin aLifeCycleState.IN_PROGRESSstate This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllInProgressResultSummaries(Class<T> aClass)Returns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate with the givenClassThis will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllPendingResultSummaries(Class<T> aClass)Returns all theResultsSummaryin aLifeCycleState.PENDINGstate with the givenClassThis will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllQueuedResultSummaries(Class<T> aClass)Returns all theResultsSummaryin aLifeCycleState.QUEUEDstate with the givenClassThis will not return records marked for deletion.<T extends ResultsSummary>
List<T>getAllResultSummariesForPlan(@NotNull Plan plan)Get all theResultsSummarys for the givenPlan@NotNull List<ResultsSummary>getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)Returns build results strictly before given build number.@Nullable ResultsSummarygetBreakingBuild(ResultsSummary summary)@Nullable ChainStageResultgetChainStageResultById(long id)Returns aChainStageResultby its id<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 BuildResultsSummarygetFirstBuildSummary(@NotNull PlanKey planKey)Returns the first availableBuildResultsSummaryfor the givenPlanKey@Nullable ResultsSummarygetFixingBuild(ResultsSummary summary)Returns the first successfulBuildResultsSummaryfor givenBuildResultsSummary.@NotNull List<LinkedJiraIssue>getJiraIssuesForBuildResults(@NotNull List<ResultsSummary> buildResults)Retrieves a list ofLinkedJiraIssuelinked to the given build result summariesList<LinkedJiraIssue>getJiraIssuesForPlanKey(@NotNull PlanKey planKey)Retrieves a list ofLinkedJiraIssuethat are linked to the given build.<T extends ResultsSummary>
TgetLastResultSummary(String planKey, Class<T> aClass)Returns the latest completedResultsSummaryandClassfor the plan represented by planKey<T extends ResultsSummary>
TgetLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)Returns the latest completedResultsSummaryandClassfor the plan represented by planKey with possible skip of specs results.@NotNull List<ResultsSummary>getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)Returns build results "around" given build number.@NotNull List<ResultsSummary>getNeighbouringSummaries(Plan plan, int currentBuildNumber)Returns build results "around" given build numberintgetNumberOfConcurrentlyRunningBuilds(PlanKey planKey)Get the number of concurrently running builds for planKeylonggetNumberOfFinalizedResults(@NotNull ImmutablePlan plan)Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlanlonggetNumberOfFinalizedResults(@NotNull PlanKey planKey)Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlanlonggetNumberOfFinishedResults(Plan build)Returns the number of finished results available for the givenPlan@Nullable ChainResultsSummarygetParentResultSummary(ResultsSummary summary)Get (@link ChainResultsSummary} containing givenResultsSummary@NotNull List<PlanKey>getPlanKeysSortedByNumberOfFinalizedResultSummaries()<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, all lazy initialized collections can be eagerly read@Nullable LonggetResultsSummaryId(@NotNull PlanResultKey planResultKey)ReturnResultsSummary's database id.<T extends ResultsSummary>
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>
List<T>getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, @NotNull Class<T> discriminator)Get a list of all build results containing a commit with any of the given changeset IDs.<T extends ResultsSummary>
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>getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)Get theResultsSummarys for the givenPlan.<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 givenResultsSummaryintmarkResultSummariesForDeletion(@NotNull PlanKey planKey)Mass update of allResultsSummaryrecords in the database related to a Plan identified by planKey.intmoveResultSummaries(@NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey)Reassigns plan key ResultsSummaries associated with selected plan key.intremoveResultsSummariesForPlan(@NotNull PlanKey planKey)Remove all resultSummary objects for the given plan.voidremoveResultsSummary(@NotNull ResultsSummary buildResultsSummary)Removes the passed result summarylongscrollResultSummaries(@NotNull String buildKey, @NotNull ResultDataRead resultDataRead, @NotNull Consumer<ResultsSummary> consumer)Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized.longscrollVariableSubstitutionForExport(@NotNull Consumer<VariableSubstitution> consumer)Scroll through and execute function for each of VariableSubstitution Objects passed to function are not fully initialized.-
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
-
-
-
Field Detail
-
NUMBER_OF_DAYS_TO_FILTER
static final int NUMBER_OF_DAYS_TO_FILTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllBuildResultSummariesInUnknownState
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all theBuildResultsSummaryin aBuildState.UNKNOWNstate This will not return records marked for deletion.- Returns:
- summaries
-
getAllPendingResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
Returns all theResultsSummaryin aLifeCycleState.PENDINGstate with the givenClassThis will not return records marked for deletion.- Returns:
- summaries
-
getAllQueuedResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
Returns all theResultsSummaryin aLifeCycleState.QUEUEDstate with the givenClassThis will not return records marked for deletion.- Returns:
- summaries
-
getAllInProgressResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
Returns all theResultsSummaryin aLifeCycleState.IN_PROGRESSstate with the givenClassThis will not return records marked for deletion.- Returns:
- summaries
-
getAllActiveResultSummariesForPlan
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
Returns all theResultsSummaryin aLifeCycleState.PENDING,LifeCycleState.QUEUED,LifeCycleState.IN_PROGRESSstate with the givenClassSee alsoLifeCycleState.isActive(LifeCycleState)andImmutableResultsSummary.isActive()- Returns:
- summaries
-
getFinalizedResultSummariesForPlan
@NotNull <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. Result are sorted descending by build number.- 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
int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Get the number of concurrently running builds for planKey- Parameters:
planKey-- Returns:
-
getResultsSummaryId
@Internal @Nullable @Nullable Long getResultsSummaryId(@NotNull @NotNull PlanResultKey planResultKey)
ReturnResultsSummary's database id. This method is intended for internal use (currently in importer)- Parameters:
planResultKey- plan result key ofResultsSummaryto be found- Returns:
- id of
ResultsSummaryor null if not found
-
getResultsSummary
@Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass)
LookupResultsSummarybyPlanResultKeyand expected type- Type Parameters:
T-- Parameters:
planResultKey-aClass-- Returns:
- resultSummary
-
getResultsSummary
@Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead)
LookupResultsSummarybyPlanResultKeyand expected type, all lazy initialized collections can be eagerly read- Type Parameters:
T-- Parameters:
planResultKey-aClass-dataRead-- Returns:
- resultSummary
-
getAllBuildResultSummariesInBuildState
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInBuildState(@NotNull @NotNull BuildState state, Class<T> aClass)
Returns all theBuildResultsSummaryin requested build state. This will not return records marked for deletion.- Parameters:
state-aClass-- Returns:
- summaries
-
getAllBuildResultSummariesInLifeCycleState
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull @NotNull LifeCycleState state, Class<T> aClass)
Returns all theBuildResultsSummaryin requested lifecycle state. This will not return records marked for deletion.
-
getAllInProgressBuildResultSummaries
@NotNull @NotNull Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
Returns all theBuildResultsSummaryin aLifeCycleState.IN_PROGRESSstate This will not return records marked for deletion.- Returns:
- summaries
-
getFirstBuildSummary
@Nullable @Nullable BuildResultsSummary getFirstBuildSummary(@NotNull @NotNull PlanKey planKey)
Returns the first availableBuildResultsSummaryfor the givenPlanKey- Parameters:
planKey-- Returns:
- buildResult
-
getLastResultSummary
<T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
Returns the latest completedResultsSummaryandClassfor the plan represented by planKey- Parameters:
planKey-aClass-- Returns:
- buildResult
-
getLastResultSummary
<T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
Returns the latest completedResultsSummaryandClassfor the plan represented by planKey with possible skip of specs results.- Parameters:
planKey-aClass-ignoreSpecsResults-- Returns:
- buildResult
-
getNumberOfFinishedResults
long getNumberOfFinishedResults(Plan build)
Returns the number of finished results available for the givenPlan- Parameters:
build-- Returns:
- numberOfResults
-
getNumberOfFinalizedResults
long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlan- Parameters:
plan-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)Get number of theResultsSummarys in aLifeCycleState.FINISHEDorLifeCycleState.NOT_BUILTstate for the givenPlan- Parameters:
planKey-- Returns:
- number of summaries
- Since:
- 6.9
-
getNeighbouringSummaries
@NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
Returns build results "around" given build number- Parameters:
plan-currentBuildNumber-- Returns:
-
getNeighbouringSummaries
@NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results "around" given build number.- Parameters:
plan- the plan to return results forbuildNumber- the build number to search aroundmaxCount- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCountitems in the list, inclusive of the result forbuildNumber(if present).
-
getBeforeSummaries
@NotNull @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results strictly before given build number.- Parameters:
plan- the plan to return results forbuildNumber- the build number to search beforemaxCount- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCountitems in the list, exclusive of the result forbuildNumber(if present).
-
getAfterSummaries
@NotNull @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns build results strictly after given build number.- Parameters:
plan- the plan to return results forbuildNumber- the build number to search aftermaxCount- the maximum number of builds to return- Returns:
- the results in ascending order. At most there will be
maxCountitems in the list, exclusive of the result forbuildNumber(if present).
-
getBreakingBuild
@Nullable @Nullable ResultsSummary getBreakingBuild(ResultsSummary summary)
-
getFixingBuild
@Nullable @Nullable ResultsSummary getFixingBuild(ResultsSummary summary)
Returns the first successfulBuildResultsSummaryfor givenBuildResultsSummary. The input build is returned if it is successful.- Parameters:
summary-- Returns:
- null if there is no fixing build.
-
findAnyResultSummary
@Nullable <T extends ResultsSummary> T findAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
Searches for anyResultsSummaryobject given aResultsSummaryCriteria. Note that if criteria does not specify order then result of this method might be non-deterministic.- Parameters:
criteria-- Returns:
ListofBuildResultsSummary
-
findByCriteria
@NotNull <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
Searches for anyResultsSummaryobject given aResultSummarySearchCriteria.- Since:
- 8.2
-
findByJiraCriteria
@NotNull <T extends ResultsSummary> @NotNull List<T> findByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
Searches for anyResultsSummaryobject given aByJiraIssueResultSearchCriteriaandResultSummarySearchCriteria.- Since:
- 8.2
-
countByJiraCriteria
<T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass)
CountsResultsSummaryobjects given aByJiraIssueResultSearchCriteriaandResultSummarySearchCriteria.- Since:
- 8.2
-
findResultsSummaries
@NotNull <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
Searches forResultsSummaryobjects given aResultsSummaryCriteria. Note that if criteria does not specify maxResults property, a hard cap of 10000 results is applied to search operation.- Parameters:
criteria-- Returns:
ListofBuildResultsSummary
-
moveResultSummaries
@Internal int moveResultSummaries(@NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)Reassigns plan key ResultsSummaries associated with selected plan key.- Parameters:
oldPlanKey- the plan key to move fromnewPlanKey- the plan key to move to- Returns:
- the number of result summaries updated
-
countResultSummaries
long countResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)Count the number ofResultsSummaryobjects given aResultsSummaryCriteria.- Parameters:
criteria-- Returns:
- long representing the count of
ResultsSummarythat match the criteria.
-
findResultSummariesForExpiry
@NotNull <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria criteria)
Searches forResultsSummaryobjects given aExpiryCriteria.- Type Parameters:
T- type of result objects (determined according to given criteria)- Parameters:
criteria- search constraints- Returns:
ListofResultsSummary
-
findJobKeysFromExistingChainResults
@NotNull @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey)
Find keys of jobs for which results associated with given plan exist. The jobs themselves might no longer exist.- Since:
- 6.9
-
removeResultsSummariesForPlan
int removeResultsSummariesForPlan(@NotNull @NotNull PlanKey planKey)Remove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands ofResultsSummaryobjects to be deleted- Parameters:
planKey- identifier of plan to remove results for.- Returns:
- number of deleted
ResultsSummaryobjects
-
findPlanKeysFromAllOrphanedResultSummaries
Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
Scans database for all theChainResultsSummaryobjects in the database that do not have a matchingChain- Returns:
- list of distinct
PlanKeys they reference
-
countBuildResultsSummaries
int countBuildResultsSummaries(@NotNull @NotNull String planKey)
-
countBuildResultsSummaries
int countBuildResultsSummaries()
Count all result summaries records. This will not count records marked for deletion.- Returns:
-
removeResultsSummary
void removeResultsSummary(@NotNull @NotNull ResultsSummary buildResultsSummary)Removes the passed result summary- Parameters:
buildResultsSummary- -
-
findBuildResultsSummariesByJiraIssues
@NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
Get a list of results summaries associated with the list of issue keys. This will not return records marked for deletion.- Parameters:
issueKeys-- Returns:
- list of result summaries
-
findBuildResultsSummariesByProjectKey
@NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable @Nullable String jiraProjectKey)
Retrieve a list of results summaries associated with given JIRA project key This will not return records marked for deletion.- Parameters:
jiraProjectKey- - JIRA project key (prefix of the jira issues e.g. 'BAM')- Returns:
- a list of results summaries associated with given JIRA project key
-
getJiraIssuesForBuildResults
@NotNull @NotNull List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull @NotNull List<ResultsSummary> buildResults)
Retrieves a list ofLinkedJiraIssuelinked to the given build result summaries- Parameters:
buildResults-- Returns:
-
getJiraIssuesForPlanKey
List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
Retrieves a list ofLinkedJiraIssuethat are linked to the given build.- Parameters:
planKey-- Returns:
-
findBuildsForImageConfiguration
@NotNull @NotNull List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImageConfiguration, @Nullable @Nullable BuildState buildState, int maxResults)
Searcher for builds of an image- Parameters:
planKey-elasticImageConfiguration-buildState-maxResults-- Returns:
-
findLastBuildResultBeforeWithTests
@Nullable <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
- Type Parameters:
T- of result- Parameters:
planResultKey- of the resultincludeOnceOffBuilds- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculationsaClass- of- Returns:
- resultsSummary
-
findLastResultBefore
@Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
Finds the last successful or failedResultsSummarybefore buildNumber- Parameters:
planKey-buildNumber-includeOnceOffBuilds- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations- Returns:
- buildResult
-
findFirstResultAfter
@Nullable <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass)
Finds the first successful or failedBuildResultsSummaryafter buildNumber- Parameters:
planKey-buildNumber-aClass-- Returns:
- buildResult
-
findFirstBuildResultWithBuildStateAfter
@Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState)
Finds the last successfulBuildResultsSummaryafter buildNumber- Parameters:
planKey-buildNumber-buildState-- Returns:
- buildResult
-
findLastBuildResultWithBuildStateBefore
ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds)
Finds the lastBuildResultsSummarybefore buildNumber withBuildState- Parameters:
planKey-buildNumber-buildState-includeOnceOffBuilds-- Returns:
- buildResult
-
findFirstBuildResultWithBuildStateBetween
@Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull @NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
Returns the first build that matchesBuildStatebetween the given build number range Note that this function is inclusive of the upper and lower bound- Parameters:
planKey-lowerBuildNumber-upperBuildNumber-buildState-- Returns:
- buildResult
-
findFirstBuildNumberAfter
@Nullable @Nullable Integer findFirstBuildNumberAfter(@NotNull @NotNull String planKey, int buildNumber)
Returns the build number of next existing build results.- Parameters:
planKey-buildNumber-- Returns:
- null if no build result summary with higher number exists
-
findLastBuildNumberBefore
@Nullable @Nullable Integer findLastBuildNumberBefore(@NotNull @NotNull String planKey, int buildNumber)
Returns the build number of previous existing build results.- Parameters:
planKey-buildNumber-- Returns:
- null if no build result summary with lower number exists
-
findBuildResultsWithArtifacts
List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
Find all build results which have matching artifacts. Sorted by buildNumber, ascending- Parameters:
planKey-- Returns:
-
scrollResultSummaries
long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull ResultDataRead resultDataRead, @NotNull @NotNull Consumer<ResultsSummary> consumer)Scroll 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.- Parameters:
buildKey- of the plan you want to scroll the result summaries forconsumer- consumer to accept each of the BuildResultSummariesresultDataRead- if the data should be loaded lazy or eagerly- Returns:
- number of traversed rows
-
getChainStageResultById
@Nullable @Nullable ChainStageResult getChainStageResultById(long id)
Returns aChainStageResultby its id- Returns:
- chainStageResult
-
getAllResultSummariesForPlan
<T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull @NotNull Plan plan)
Get all theResultsSummarys for the givenPlan- Type Parameters:
T-- Parameters:
plan-- Returns:
- summaries
-
getResultSummariesForPlan
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
Get theResultsSummarys for the givenPlan. Results are sorted by build number (descending). User can skip first n result and request maximum number of results. Note: fetching huge amount of data in single call should be avoided.- 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
-
getResultSummariesForPlanByLifeCycleState
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull @NotNull Plan plan, @NotNull @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
Get 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.- 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
-
getResultSummariesByChangeSetId
<T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
Get 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
getResultSummariesByCheckoutChangesetId(String, Class).- 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
<T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull @NotNull String changesetId, @NotNull @NotNull Class<T> discriminator)
Get 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
getResultSummariesByChangeSetId(String, Class).- Parameters:
changesetId- of the 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
<T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @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. This will not return records marked for deletion.- 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
- Since:
- 5.7
-
getResultSummariesByChangeSetIds
<T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, @NotNull @NotNull Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs. This will not return records marked for deletion.- Parameters:
changeSetIds- of the commitsdiscriminator- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the any of the given changeSetIds
-
getParentResultSummary
@Nullable @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary summary)
Get (@link ChainResultsSummary} containing givenResultsSummary- Parameters:
summary-- Returns:
-
getStageForResult
@Nullable @Nullable ChainStageResult getStageForResult(ResultsSummary resultsSummary)
Get (@link ChainStageResult} containing givenResultsSummary- Parameters:
resultsSummary-- Returns:
-
findLatestResultsSummaries
List<ResultsSummary> findLatestResultsSummaries()
Find the result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER- Returns:
- list of latest results summaries
-
findLatestFailedResultSummaries
List<ResultsSummary> findLatestFailedResultSummaries()
Find the failed result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER- Returns:
- list of latest results summaries
-
findChainResultsWithJobLabelled
List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels)
Searches 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
- 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
-
findLastResultSummaryWithState
@Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass)
- Type Parameters:
T-- Parameters:
planKey-buildState-aClass-- Returns:
- the last
ResultsSummarywith the providedBuildState
-
findLastResultSummaryWithState
@Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass, boolean ignoreSpecsResults)
- Type Parameters:
T-- Parameters:
planKey-buildState-aClass-ignoreSpecsResults-- Returns:
- the last
ResultsSummarywith the providedBuildState
-
countResultsWithState
int countResultsWithState(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)Counts results with a given state in a given build number range for plan.- 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
-
scrollVariableSubstitutionForExport
long scrollVariableSubstitutionForExport(@NotNull @NotNull Consumer<VariableSubstitution> consumer)Scroll through and execute function for each of VariableSubstitution Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Parameters:
consumer- consumer to accept each of the VariableSubstitution- Returns:
- number of traversed rows
-
markResultSummariesForDeletion
int markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)Mass update of allResultsSummaryrecords in the database related to a Plan identified by planKey.- Parameters:
planKey- key of a plan- Returns:
- number of updated records
-
getPlanKeysSortedByNumberOfFinalizedResultSummaries
@NotNull @NotNull List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
-
calculateQueueDuration
@Nullable @Nullable Long calculateQueueDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.- Parameters:
resultsSummary-ChainResultsSummaryfor which calculation has to be made- Returns:
- queueDuration value or null if there are no related
BuildResultsSummaryrecords - Since:
- 5.4
-
calculateVcsUpdateDuration
@Nullable @Nullable Long calculateVcsUpdateDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.- Parameters:
resultsSummary-ChainResultsSummaryfor which calculation has to be made- Returns:
- vcsUpdateDuration value or null if there are no related
BuildResultsSummaryrecords - Since:
- 5.4
-
findBuildResultsNumberRange
@NotNull @NotNull Range<Integer> findBuildResultsNumberRange(PlanKey planKey)
Finds minimum and maximum build number for a plan. Works for both chains and jobs.- Parameters:
planKey-- Returns:
- (min, max) pair or (0,0) if there are no results.
-
findChainResultsWithFormatVersionLessThan
@Deprecated @NotNull @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
Deprecated.internal use only
-
findSpecsStatesIdsReferencedByBuildResultSummaries
@NotNull @NotNull Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
Finds all specs states ids that are referenced by any build result summary
-
findMinimumBuildNumberForNLatest
int findMinimumBuildNumberForNLatest(@NotNull @NotNull PlanKey planKey, int n)Find 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.- Since:
- 7.1
-
findByAuthors
<T extends ResultsSummary> List<T> findByAuthors(@NotNull @NotNull Collection<ExtendedAuthor> authors, @NotNull @NotNull Class<T> resultClass, int maxResults)
- Since:
- 8.2
-
-