@Internal public interface BuildResultsSummaryDao extends BambooObjectDao<ResultsSummary>
Modifier and Type | Field and Description |
---|---|
static int |
NUMBER_OF_DAYS_TO_FILTER |
Modifier and Type | Method and Description |
---|---|
@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 |
countBuildResultsSummaries()
Count all result summaries records.
|
int |
countBuildResultsSummaries(@NotNull String planKey) |
<T extends ResultsSummary> |
countByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria,
@NotNull ResultSummarySearchCriteria criteria,
@NotNull Class<T> resultClass)
Counts
ResultsSummary objects given a ByJiraIssueResultSearchCriteria and ResultSummarySearchCriteria . |
long |
countResultSummaries(@NotNull ResultsSummaryCriteria criteria)
Count the number of
ResultsSummary objects given a ResultsSummaryCriteria . |
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.
|
List<Integer> |
findAllBuildResultsNumbers(PlanKey planKey) |
<T extends ResultsSummary> |
findAnyResultSummary(@NotNull ResultsSummaryCriteria criteria,
ResultDataRead dataRead)
Searches for any
ResultsSummary object given a ResultsSummaryCriteria . |
@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> |
findByAuthors(@NotNull Collection<ExtendedAuthor> authors,
@NotNull Class<T> resultClass,
int maxResults) |
<T extends ResultsSummary> |
findByCriteria(@NotNull ResultSummarySearchCriteria criteria,
@NotNull Class<T> resultClass,
@NotNull ResultDataRead dataRead)
Searches for any
ResultsSummary object given a ResultSummarySearchCriteria . |
<T extends ResultsSummary> |
findByJiraCriteria(@NotNull ByJiraIssueResultSearchCriteria jiraCriteria,
@NotNull ResultSummarySearchCriteria criteria,
@NotNull Class<T> resultClass,
@NotNull ResultDataRead dataRead)
Searches for any
ResultsSummary object given a ByJiraIssueResultSearchCriteria and ResultSummarySearchCriteria . |
@NotNull List<PlanResultKey> |
findChainResultsWithFormatVersionLessThan(int formatVersion,
int maxResults)
Deprecated.
internal use only
|
List<ChainResultsSummary> |
findChainResultsWithJobLabelled(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 successful
BuildResultsSummary after buildNumber |
@Nullable ResultsSummary |
findFirstBuildResultWithBuildStateBetween(@NotNull String planKey,
int lowerBuildNumber,
int upperBuildNumber,
@NotNull BuildState buildState)
Returns the first build that matches
BuildState between the given build number range
Note that this function is inclusive of the upper and lower bound |
<T extends ResultsSummary> |
findFirstResultAfter(@NotNull String planKey,
int buildNumber,
Class<T> aClass)
Finds the first successful or failed
BuildResultsSummary after buildNumber |
@NotNull List<PlanKey> |
findJobKeysFromExistingChainResults(@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> |
findLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey,
@NotNull Class<T> aClass,
boolean includeOnceOffBuilds) |
ResultsSummary |
findLastBuildResultWithBuildStateBefore(@NotNull String planKey,
int buildNumber,
@NotNull BuildState buildState,
boolean includeOnceOffBuilds)
Finds the last
BuildResultsSummary before buildNumber with BuildState |
<T extends ResultsSummary> |
findLastResultBefore(@NotNull String planKey,
int buildNumber,
Class<T> aClass,
boolean includeOnceOffBuilds)
Finds the last successful or failed
ResultsSummary before buildNumber |
<T extends ResultsSummary> |
findLastResultSummaryWithState(@NotNull PlanKey planKey,
@NotNull BuildState buildState,
@NotNull Class<T> aClass) |
<T extends ResultsSummary> |
findLastResultSummaryWithState(@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_FILTER
|
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
|
int |
findMinimumBuildNumberForNLatest(@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 the
ChainResultsSummary objects in the database that do not have a matching Chain |
<T extends ResultsSummary> |
findResultsSummaries(@NotNull ResultsSummaryCriteria criteria)
Searches for
ResultsSummary objects given a ResultsSummaryCriteria . |
<T extends ResultsSummary> |
findResultSummariesForExpiry(@NotNull ExpiryCriteria criteria)
Searches for
ResultsSummary objects given a ExpiryCriteria . |
@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> |
getAllActiveResultSummariesForPlan(PlanKey planKey,
Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.PENDING , LifeCycleState.QUEUED , LifeCycleState.IN_PROGRESS state with the given Class
See also LifeCycleState.isActive(LifeCycleState) and ImmutableResultsSummary.isActive() |
<T extends ResultsSummary> |
getAllBuildResultSummariesInBuildState(@NotNull BuildState state,
Class<T> aClass)
Returns all the
BuildResultsSummary in requested build state. |
<T extends ResultsSummary> |
getAllBuildResultSummariesInLifeCycleState(@NotNull LifeCycleState state,
Class<T> aClass)
Returns all the
BuildResultsSummary in requested lifecycle state. |
<T extends ResultsSummary> |
getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all the
BuildResultsSummary in a BuildState.UNKNOWN
state
This will not return records marked for deletion. |
@NotNull Collection<BuildResultsSummary> |
getAllInProgressBuildResultSummaries()
Returns all the
BuildResultsSummary in a LifeCycleState.IN_PROGRESS state
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllInProgressResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.IN_PROGRESS state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllPendingResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.PENDING state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllQueuedResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.QUEUED state with the given Class
This will not return records marked for deletion. |
<T extends ResultsSummary> |
getAllResultSummariesForPlan(@NotNull Plan plan)
Get all the
ResultsSummary s for the given Plan |
@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 a
ChainStageResult by its id |
<T extends ResultsSummary> |
getFinalizedResultSummariesForPlan(PlanKey planKey,
Class<T> aClass,
int firstResult,
int maxResults)
Returns all the
ResultsSummary in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state with the given Class . |
@Nullable BuildResultsSummary |
getFirstBuildSummary(@NotNull PlanKey planKey)
Returns the first available
BuildResultsSummary for the given PlanKey |
@Nullable ResultsSummary |
getFixingBuild(ResultsSummary summary)
Returns the first successful
BuildResultsSummary for given BuildResultsSummary . |
@NotNull List<LinkedJiraIssue> |
getJiraIssuesForBuildResults(@NotNull List<ResultsSummary> buildResults)
Retrieves a list of
LinkedJiraIssue linked to the given build result summaries |
List<LinkedJiraIssue> |
getJiraIssuesForPlanKey(@NotNull PlanKey planKey)
Retrieves a list of
LinkedJiraIssue that are linked to the given build. |
<T extends ResultsSummary> |
getLastResultSummary(String planKey,
Class<T> aClass)
Returns the latest completed
ResultsSummary and Class for the plan represented by planKey |
<T extends ResultsSummary> |
getLastResultSummary(String planKey,
Class<T> aClass,
boolean ignoreSpecsResults)
Returns the latest completed
ResultsSummary and Class 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 number
|
int |
getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Get the number of concurrently running builds for planKey
|
long |
getNumberOfFinalizedResults(@NotNull ImmutablePlan plan)
Get number of the
ResultsSummary s in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan |
long |
getNumberOfFinalizedResults(@NotNull PlanKey planKey)
Get number of the
ResultsSummary s in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan |
long |
getNumberOfFinishedResults(Plan build)
Returns the number of finished results available for the given
Plan |
@Nullable ChainResultsSummary |
getParentResultSummary(ResultsSummary summary)
Get (@link ChainResultsSummary} containing given
ResultsSummary |
@NotNull List<PlanKey> |
getPlanKeysSortedByNumberOfFinalizedResultSummaries() |
<T extends ResultsSummary> |
getResultsSummary(@NotNull PlanResultKey planResultKey,
@NotNull Class<T> aClass)
Lookup
ResultsSummary by PlanResultKey and expected type |
<T extends ResultsSummary> |
getResultsSummary(@NotNull PlanResultKey planResultKey,
@NotNull Class<T> aClass,
ResultDataRead dataRead)
Lookup
ResultsSummary by PlanResultKey and expected type, all lazy initialized collections can be eagerly read |
@Nullable Long |
getResultsSummaryId(@NotNull PlanResultKey planResultKey)
Return
ResultsSummary 's database id. |
<T extends ResultsSummary> |
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> |
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> |
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> |
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> |
getResultSummariesForPlan(@NotNull ImmutablePlan plan,
int firstResult,
int maxResults)
Get the
ResultsSummary s for the given Plan . |
<T extends ResultsSummary> |
getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan,
@NotNull LifeCycleState lifeCycleState,
int firstResult,
int maxResults)
Get the
ResultsSummary s for the given Plan in give LifeCycleState that are Results are
sorted by build number (descending). |
@Nullable ChainStageResult |
getStageForResult(ResultsSummary resultsSummary)
Get (@link ChainStageResult} containing given
ResultsSummary |
int |
markResultSummariesForDeletion(@NotNull PlanKey planKey)
Mass update of all
ResultsSummary 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 summary
|
long |
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.
|
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
static final int NUMBER_OF_DAYS_TO_FILTER
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
BuildResultsSummary
in a BuildState.UNKNOWN
state
This will not return records marked for deletion.@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.PENDING
state with the given Class
This will not return records marked for deletion.@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.QUEUED
state with the given Class
This will not return records marked for deletion.@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.IN_PROGRESS
state with the given Class
This will not return records marked for deletion.@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
ResultsSummary
in a LifeCycleState.PENDING
, LifeCycleState.QUEUED
, LifeCycleState.IN_PROGRESS
state with the given Class
See also LifeCycleState.isActive(LifeCycleState)
and ImmutableResultsSummary.isActive()
@NotNull <T extends ResultsSummary> @NotNull List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
ResultsSummary
in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state with the given Class
.
Result are sorted descending by build number.T
- planKey
- aClass
- firstResult
- - specifies the first result to be included in the list.maxResults
- - specifies the length of the result; 0 for all results;int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
planKey
- @Internal @Nullable @Nullable Long getResultsSummaryId(@NotNull @NotNull PlanResultKey planResultKey)
ResultsSummary
's database id.
This method is intended for internal use (currently in importer)planResultKey
- plan result key of ResultsSummary
to be foundResultsSummary
or null if not found@Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass)
ResultsSummary
by PlanResultKey
and expected typeT
- planResultKey
- aClass
- @Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead)
ResultsSummary
by PlanResultKey
and expected type, all lazy initialized collections can be eagerly readT
- planResultKey
- aClass
- dataRead
- @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInBuildState(@NotNull @NotNull BuildState state, Class<T> aClass)
BuildResultsSummary
in requested build state.
This will not return records marked for deletion.state
- aClass
- @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull @NotNull LifeCycleState state, Class<T> aClass)
BuildResultsSummary
in requested lifecycle state.
This will not return records marked for deletion.@NotNull @NotNull Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
BuildResultsSummary
in a LifeCycleState.IN_PROGRESS
state
This will not return records marked for deletion.@Nullable @Nullable BuildResultsSummary getFirstBuildSummary(@NotNull @NotNull PlanKey planKey)
BuildResultsSummary
for the given PlanKey
planKey
- <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
ResultsSummary
and Class
for the plan represented by planKeyplanKey
- aClass
- <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
ResultsSummary
and Class
for the plan represented by planKey
with possible skip of specs results.planKey
- aClass
- ignoreSpecsResults
- long getNumberOfFinishedResults(Plan build)
Plan
build
- long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)
ResultsSummary
s in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state for the given Plan
plan
- long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)
ResultsSummary
s in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state for the given Plan
planKey
- @NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
plan
- currentBuildNumber
- @NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
plan
- the plan to return results forbuildNumber
- the build number to search aroundmaxCount
- the maximum number of builds to returnmaxCount
items in the list, inclusive of
the result for buildNumber
(if present).@NotNull @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
plan
- the plan to return results forbuildNumber
- the build number to search beforemaxCount
- the maximum number of builds to returnmaxCount
items in the list,
exclusive of the result for buildNumber
(if present).@NotNull @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
plan
- the plan to return results forbuildNumber
- the build number to search aftermaxCount
- the maximum number of builds to returnmaxCount
items in the list, exclusive of
the result for buildNumber
(if present).@Nullable @Nullable ResultsSummary getBreakingBuild(ResultsSummary summary)
@Nullable @Nullable ResultsSummary getFixingBuild(ResultsSummary summary)
BuildResultsSummary
for given BuildResultsSummary
.
The input build is returned if it is successful.summary
- @NotNull <T extends ResultsSummary> T findAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
ResultsSummary
object given a ResultsSummaryCriteria
.
Note that if criteria does not specify order then result of this method might be non-deterministic.criteria
- List
of BuildResultsSummary
@NotNull <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
ResultsSummary
object given a ResultSummarySearchCriteria
.@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)
ResultsSummary
object given a ByJiraIssueResultSearchCriteria
and ResultSummarySearchCriteria
.<T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass)
ResultsSummary
objects given a ByJiraIssueResultSearchCriteria
and ResultSummarySearchCriteria
.@NotNull <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
ResultsSummary
objects given a ResultsSummaryCriteria
.
Note that if criteria does not specify maxResults property, a hard cap of 10000 results is applied to search operation.criteria
- List
of BuildResultsSummary
@Internal int moveResultSummaries(@NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)
oldPlanKey
- the plan key to move fromnewPlanKey
- the plan key to move tolong countResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
ResultsSummary
objects given a ResultsSummaryCriteria
.criteria
- ResultsSummary
that match the criteria.@NotNull <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria criteria)
ResultsSummary
objects given a ExpiryCriteria
.T
- type of result objects (determined according to given criteria)criteria
- search constraintsList
of ResultsSummary
@NotNull @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey)
int removeResultsSummariesForPlan(@NotNull @NotNull PlanKey planKey)
ResultsSummary
objects to be deletedplanKey
- identifier of plan to remove results for.ResultsSummary
objectsIterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
ChainResultsSummary
objects in the database that do not have a matching Chain
PlanKey
s they referenceint countBuildResultsSummaries(@NotNull @NotNull String planKey)
int countBuildResultsSummaries()
void removeResultsSummary(@NotNull @NotNull ResultsSummary buildResultsSummary)
buildResultsSummary
- -@NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
issueKeys
- @NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable @Nullable String jiraProjectKey)
jiraProjectKey
- - JIRA project key (prefix of the jira issues e.g. 'BAM')@NotNull @NotNull List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull @NotNull List<ResultsSummary> buildResults)
LinkedJiraIssue
linked to the given build result summariesbuildResults
- List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
LinkedJiraIssue
that are linked to the given build.planKey
- @NotNull @NotNull List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImageConfiguration, @Nullable @Nullable BuildState buildState, int maxResults)
planKey
- elasticImageConfiguration
- buildState
- maxResults
- @Nullable <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
T
- of resultplanResultKey
- 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@Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
ResultsSummary
before buildNumberplanKey
- buildNumber
- includeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations@Nullable <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass)
BuildResultsSummary
after buildNumberplanKey
- buildNumber
- aClass
- @Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState)
BuildResultsSummary
after buildNumberplanKey
- buildNumber
- buildState
- ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds)
BuildResultsSummary
before buildNumber with BuildState
planKey
- buildNumber
- buildState
- includeOnceOffBuilds
- @Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull @NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
BuildState
between the given build number range
Note that this function is inclusive of the upper and lower boundplanKey
- lowerBuildNumber
- upperBuildNumber
- buildState
- @Nullable @Nullable Integer findFirstBuildNumberAfter(@NotNull @NotNull String planKey, int buildNumber)
planKey
- buildNumber
- @Nullable @Nullable Integer findLastBuildNumberBefore(@NotNull @NotNull String planKey, int buildNumber)
planKey
- buildNumber
- List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
planKey
- long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull ResultDataRead resultDataRead, @NotNull @NotNull Consumer<ResultsSummary> consumer)
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@Nullable @Nullable ChainStageResult getChainStageResultById(long id)
ChainStageResult
by its id<T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull @NotNull Plan plan)
ResultsSummary
s for the given Plan
T
- plan
- @NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
ResultsSummary
s for the given Plan
. 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.T
- 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.@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull @NotNull Plan plan, @NotNull @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
ResultsSummary
s for the given Plan
in give LifeCycleState
that are Results are
sorted by build number (descending). User can skip first n result and request maximum number of results.T
- 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.<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)
.
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required<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)
.
changesetId
- of the commitdiscriminator
- class of the ResultSummary interface requiredchangesetId
commit<T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
T
- extends ResultSummaryrepositoryId
- of the repositorychangeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required<T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, @NotNull @NotNull Class<T> discriminator)
changeSetIds
- of the commitsdiscriminator
- class of the ResultSummary interface required@Nullable @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary summary)
ResultsSummary
summary
- @Nullable @Nullable ChainStageResult getStageForResult(ResultsSummary resultsSummary)
ResultsSummary
resultsSummary
- List<ResultsSummary> findLatestResultsSummaries()
List<ResultsSummary> findLatestFailedResultSummaries()
List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels)
criteria
- containing the restrictions for the chains to be returnedlabels
- that the jobs can be associated with@Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass)
T
- planKey
- buildState
- aClass
- ResultsSummary
with the provided BuildState
@Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass, boolean ignoreSpecsResults)
T
- planKey
- buildState
- aClass
- ignoreSpecsResults
- ResultsSummary
with the provided BuildState
int countResultsWithState(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
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 countedlong scrollVariableSubstitutionForExport(@NotNull @NotNull Consumer<VariableSubstitution> consumer)
consumer
- consumer to accept each of the VariableSubstitutionint markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)
ResultsSummary
records in the database related to a Plan identified by planKey.planKey
- key of a plan@NotNull @NotNull List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
@Nullable @Nullable Long calculateQueueDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
records@Nullable @Nullable Long calculateVcsUpdateDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
records@NotNull @NotNull Range<Integer> findBuildResultsNumberRange(PlanKey planKey)
planKey
- @Deprecated @NotNull @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
@NotNull @NotNull Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
int findMinimumBuildNumberForNLatest(@NotNull @NotNull PlanKey planKey, int n)
<T extends ResultsSummary> List<T> findByAuthors(@NotNull @NotNull Collection<ExtendedAuthor> authors, @NotNull @NotNull Class<T> resultClass, int maxResults)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.