Interface BuildResultsSummaryDao
- All Superinterfaces:
BambooObjectDao<ResultsSummary>
- All Known Implementing Classes:
BuildResultsSummaryHibernateDao
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Long
calculateQueueDuration
(@NotNull ChainResultsSummary resultsSummary) Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.@Nullable Long
calculateVcsUpdateDuration
(@NotNull ChainResultsSummary resultsSummary) Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.int
Count all result summaries records.int
countBuildResultsSummaries
(@NotNull String planKey) <T extends ResultsSummary>
LongcountByJiraCriteria
(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass) CountsResultsSummary
objects given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.long
countResultSummaries
(@NotNull ResultsSummaryCriteria criteria) Count the number ofResultsSummary
objects given aResultsSummaryCriteria
.int
countResultsWithState
(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState) Counts results with a given state in a given build number range for plan.findAllBuildResultsNumbers
(PlanKey planKey) <T extends ResultsSummary>
TfindAnyResultSummary
(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead) Searches for anyResultsSummary
object given aResultsSummaryCriteria
.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.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 anyResultsSummary
object given aResultSummarySearchCriteria
.<T extends ResultsSummary>
@NotNull List<T>findByJiraCriteria
(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull ResultSummarySearchCriteria criteria, @NotNull Class<T> resultClass, @NotNull ResultDataRead dataRead) Searches for anyResultsSummary
object given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.@NotNull List<PlanResultKey>
findChainResultsWithFormatVersionLessThan
(int formatVersion, int maxResults) Deprecated.internal use onlyfindChainResultsWithJobLabelled
(ResultsSummaryCriteria criteria, List<Label> labels) Searches through all chains to find any that have jobs which match the given labels.@Nullable Integer
findFirstBuildNumberAfter
(@NotNull String planKey, int buildNumber) Returns the build number of next existing build results.@Nullable ResultsSummary
findFirstBuildResultWithBuildStateAfter
(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState) Finds the last successfulBuildResultsSummary
after buildNumber@Nullable ResultsSummary
findFirstBuildResultWithBuildStateBetween
(@NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull BuildState buildState) Returns the first build that matchesBuildState
between 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 failedBuildResultsSummary
after buildNumberfindJobKeysFromExistingChainResults
(@NotNull PlanKey chainKey) Find keys of jobs for which results associated with given plan exist.@Nullable Integer
findLastBuildNumberBefore
(@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) findLastBuildResultWithBuildStateBefore
(@NotNull String planKey, int buildNumber, @NotNull BuildState buildState, boolean includeOnceOffBuilds) Finds the lastBuildResultsSummary
before buildNumber withBuildState
<T extends ResultsSummary>
TfindLastResultBefore
(@NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds) Finds the last successful or failedResultsSummary
before 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) 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_FILTERFind 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_FILTERint
findMinimumBuildNumberForNLatest
(@NotNull PlanKey planKey, int n) Find a build number for which exist n non-specs results with a build number greater or equal.Scans database for all theChainResultsSummary
objects in the database that do not have a matchingChain
<T extends ResultsSummary>
@NotNull List<T>findResultsSummaries
(@NotNull ResultsSummaryCriteria criteria) Searches forResultsSummary
objects given aResultsSummaryCriteria
.<T extends ResultsSummary>
@NotNull List<T>findResultSummariesForExpiry
(@NotNull ExpiryCriteria criteria) Searches forResultsSummary
objects given aExpiryCriteria
.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 theResultsSummary
in aLifeCycleState.PENDING
,LifeCycleState.QUEUED
,LifeCycleState.IN_PROGRESS
state with the givenClass
See alsoLifeCycleState.isActive(LifeCycleState)
andImmutableResultsSummary.isActive()
<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInBuildState
(@NotNull BuildState state, Class<T> aClass) Returns all theBuildResultsSummary
in requested build state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInLifeCycleState
(@NotNull LifeCycleState state, Class<T> aClass) Returns all theBuildResultsSummary
in requested lifecycle state.<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInUnknownState
(Class<T> aClass) Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state This will not return records marked for deletion.@NotNull Collection<BuildResultsSummary>
Returns all theBuildResultsSummary
in aLifeCycleState.IN_PROGRESS
state This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllInProgressResultSummaries
(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllPendingResultSummaries
(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.PENDING
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
@NotNull Collection<T>getAllQueuedResultSummaries
(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.QUEUED
state with the givenClass
This will not return records marked for deletion.<T extends ResultsSummary>
List<T>getAllResultSummariesForPlan
(@NotNull Plan plan) Get all theResultsSummary
s for the givenPlan
@NotNull List<ResultsSummary>
getBeforeSummaries
(@NotNull ImmutablePlan plan, int buildNumber, int maxCount) Returns build results strictly before given build number.@Nullable ResultsSummary
getBreakingBuild
(ResultsSummary summary) @Nullable ChainStageResult
getChainStageResultById
(long id) Returns aChainStageResult
by its id<T extends ResultsSummary>
@NotNull List<T>getFinalizedResultSummariesForPlan
(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults) Returns all theResultsSummary
in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state with the givenClass
.@Nullable BuildResultsSummary
getFirstBuildSummary
(@NotNull PlanKey planKey) Returns the first availableBuildResultsSummary
for the givenPlanKey
@Nullable ResultsSummary
getFixingBuild
(ResultsSummary summary) Returns the first successfulBuildResultsSummary
for givenBuildResultsSummary
.@NotNull List<LinkedJiraIssue>
getJiraIssuesForBuildResults
(@NotNull List<ResultsSummary> buildResults) Retrieves a list ofLinkedJiraIssue
linked to the given build result summariesgetJiraIssuesForPlanKey
(@NotNull PlanKey planKey) Retrieves a list ofLinkedJiraIssue
that are linked to the given build.<T extends ResultsSummary>
TgetLastResultSummary
(String planKey, Class<T> aClass) Returns the latest completedResultsSummary
andClass
for the plan represented by planKey<T extends ResultsSummary>
TgetLastResultSummary
(String planKey, Class<T> aClass, boolean ignoreSpecsResults) Returns the latest completedResultsSummary
andClass
for 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 numberint
Get the number of concurrently running builds for planKeylong
getNumberOfFinalizedResults
(@NotNull ImmutablePlan plan) Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
long
getNumberOfFinalizedResults
(@NotNull PlanKey planKey) Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
long
getNumberOfFinishedResults
(Plan build) Returns the number of finished results available for the givenPlan
@Nullable ChainResultsSummary
getParentResultSummary
(ResultsSummary summary) Get (@link ChainResultsSummary} containing givenResultsSummary
<T extends ResultsSummary>
TgetResultsSummary
(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass) LookupResultsSummary
byPlanResultKey
and expected type<T extends ResultsSummary>
TgetResultsSummary
(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead) LookupResultsSummary
byPlanResultKey
and expected type, all lazy initialized collections can be eagerly read@Nullable Long
getResultsSummaryId
(@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 theResultsSummary
s for the givenPlan
.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForPlanByLifeCycleState
(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults) Get theResultsSummary
s for the givenPlan
in giveLifeCycleState
that are Results are sorted by build number (descending).@Nullable ChainStageResult
getStageForResult
(ResultsSummary resultsSummary) Get (@link ChainStageResult} containing givenResultsSummary
int
markResultSummariesForDeletion
(@NotNull PlanKey planKey) Mass update of allResultsSummary
records in the database related to a Plan identified by planKey.int
moveResultSummaries
(@NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey) Reassigns plan key ResultsSummaries associated with selected plan key.int
removeResultsSummariesForPlan
(@NotNull PlanKey planKey) Remove all resultSummary objects for the given plan.void
removeResultsSummary
(@NotNull ResultsSummary buildResultsSummary) Removes the passed result summarylong
scrollResultSummaries
(@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.long
scrollVariableSubstitutionForExport
(@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 Details
-
NUMBER_OF_DAYS_TO_FILTER
static final int NUMBER_OF_DAYS_TO_FILTER- See Also:
-
-
Method Details
-
getAllBuildResultSummariesInUnknownState
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass) Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state This will not return records marked for deletion.- Returns:
- summaries
-
getAllPendingResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.PENDING
state with the givenClass
This will not return records marked for deletion.- Returns:
- summaries
-
getAllQueuedResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.QUEUED
state with the givenClass
This will not return records marked for deletion.- Returns:
- summaries
-
getAllInProgressResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass) Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state with the givenClass
This 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 theResultsSummary
in aLifeCycleState.PENDING
,LifeCycleState.QUEUED
,LifeCycleState.IN_PROGRESS
state with the givenClass
See 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 theResultsSummary
in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state 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
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 ofResultsSummary
to be found- Returns:
- id of
ResultsSummary
or null if not found
-
getResultsSummary
@Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass) LookupResultsSummary
byPlanResultKey
and 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) LookupResultsSummary
byPlanResultKey
and 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 theBuildResultsSummary
in 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 theBuildResultsSummary
in requested lifecycle state. This will not return records marked for deletion. -
getAllInProgressBuildResultSummaries
Returns all theBuildResultsSummary
in aLifeCycleState.IN_PROGRESS
state This will not return records marked for deletion.- Returns:
- summaries
-
getFirstBuildSummary
Returns the first availableBuildResultsSummary
for the givenPlanKey
- Parameters:
planKey
-- Returns:
- buildResult
-
getLastResultSummary
Returns the latest completedResultsSummary
andClass
for 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 completedResultsSummary
andClass
for the plan represented by planKey with possible skip of specs results.- Parameters:
planKey
-aClass
-ignoreSpecsResults
-- Returns:
- buildResult
-
getNumberOfFinishedResults
Returns the number of finished results available for the givenPlan
- Parameters:
build
-- Returns:
- numberOfResults
-
getNumberOfFinalizedResults
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
- Parameters:
plan
-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
- Parameters:
planKey
-- Returns:
- number of summaries
- Since:
- 6.9
-
getNeighbouringSummaries
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
maxCount
items 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
maxCount
items 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
maxCount
items in the list, exclusive of the result forbuildNumber
(if present).
-
getBreakingBuild
-
getFixingBuild
Returns the first successfulBuildResultsSummary
for 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 anyResultsSummary
object given aResultsSummaryCriteria
. Note that if criteria does not specify order then result of this method might be non-deterministic.- Parameters:
criteria
-- Returns:
List
ofBuildResultsSummary
-
findByCriteria
@NotNull <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead) Searches for anyResultsSummary
object 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 anyResultsSummary
object given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.- Since:
- 8.2
-
countByJiraCriteria
<T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass) CountsResultsSummary
objects given aByJiraIssueResultSearchCriteria
andResultSummarySearchCriteria
.- Since:
- 8.2
-
findResultsSummaries
@NotNull <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria) Searches forResultsSummary
objects 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:
List
ofBuildResultsSummary
-
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
Count the number ofResultsSummary
objects given aResultsSummaryCriteria
.- Parameters:
criteria
-- Returns:
- long representing the count of
ResultsSummary
that match the criteria.
-
findResultSummariesForExpiry
@NotNull <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria criteria) Searches forResultsSummary
objects given aExpiryCriteria
.- Type Parameters:
T
- type of result objects (determined according to given criteria)- Parameters:
criteria
- search constraints- Returns:
List
ofResultsSummary
-
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
Remove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands ofResultsSummary
objects to be deleted- Parameters:
planKey
- identifier of plan to remove results for.- Returns:
- number of deleted
ResultsSummary
objects
-
findPlanKeysFromAllOrphanedResultSummaries
Scans database for all theChainResultsSummary
objects in the database that do not have a matchingChain
- Returns:
- list of distinct
PlanKey
s they reference
-
countBuildResultsSummaries
-
countBuildResultsSummaries
int countBuildResultsSummaries()Count all result summaries records. This will not count records marked for deletion.- Returns:
-
removeResultsSummary
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 ofLinkedJiraIssue
linked to the given build result summaries- Parameters:
buildResults
-- Returns:
-
getJiraIssuesForPlanKey
Retrieves a list ofLinkedJiraIssue
that 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 failedResultsSummary
before 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 failedBuildResultsSummary
after 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 successfulBuildResultsSummary
after buildNumber- Parameters:
planKey
-buildNumber
-buildState
-- Returns:
- buildResult
-
findLastBuildResultWithBuildStateBefore
ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds) Finds the lastBuildResultsSummary
before 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 matchesBuildState
between 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
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
Returns aChainStageResult
by its id- Returns:
- chainStageResult
-
getAllResultSummariesForPlan
Get all theResultsSummary
s 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 theResultsSummary
s 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 theResultsSummary
s for the givenPlan
in giveLifeCycleState
that 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
changesetId
commit
-
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
Get (@link ChainResultsSummary} containing givenResultsSummary
- Parameters:
summary
-- Returns:
-
getStageForResult
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
ResultsSummary
with 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
ResultsSummary
with 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
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
Mass update of allResultsSummary
records in the database related to a Plan identified by planKey.- Parameters:
planKey
- key of a plan- Returns:
- number of updated records
-
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
-ChainResultsSummary
for which calculation has to be made- Returns:
- queueDuration value or null if there are no related
BuildResultsSummary
records - 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
-ChainResultsSummary
for which calculation has to be made- Returns:
- vcsUpdateDuration value or null if there are no related
BuildResultsSummary
records - Since:
- 5.4
-
findAllBuildResultsNumbers
-
findBuildResultsNumberRange
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
Finds all specs states ids that are referenced by any build result summary -
findMinimumBuildNumberForNLatest
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
-