Interface ResultsSummaryManager
-
- All Known Subinterfaces:
BuildResultsSummaryManager
- All Known Implementing Classes:
BuildResultsSummaryManagerImpl
@PublicApi public interface ResultsSummaryManager
Manager for allResultsSummary
derivatives that supersedesBuildResultsSummaryManager
- Since:
- 2.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addVariableContextSnapshotToResultSummary(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
Adds state of global and plan variables to result at the beginning of execution.void
calculateAndSetDeltaState(ResultsSummary resultsSummary)
Figures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix.@Nullable 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.void
cleanPendingLifeCycleState(@NotNull PlanResultKey planResultKey)
Cleans state of pending result.void
clearVariablesOnRerunBuild(@NotNull ResultsSummary resultSummary)
Clear stored stage manual variables when build is fully rerun.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.<T extends ResultsSummary>
TcreateResultsSummary(@NotNull BuildContext buildContext, @NotNull Class<T> aClass)
Creates aResultsSummary
of the givenClass
@NotNull List<Integer>
findAllBuildResultsNumbers(PlanKey planKey)
@NotNull Range<Integer>
findBuildResultNumbersRange(@NotNull PlanKey planKey)
Finds minimum and maximum build number for a plan.@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 ResultsSummary
findFirstFailedBuildResultAfter(@NotNull String buildKey, int buildNumber)
Finds the first failedResultsSummary
after buildNumber@Nullable ResultsSummary
findFirstFailedBuildResultBetween(@NotNull ImmutablePlan build, int lowerBuildNumber, int upperBuildNumber)
Finds the first failed build between the upper and lower build numbers inclusively.@Nullable ResultsSummary
findFirstFailedBuildResultBetween(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber)
Finds the first failed build between the upper and lower build numbers inclusively.*<T extends ResultsSummary>
TfindFirstResultAfter(@NotNull PlanResultKey planResultKey, Class<T> aClass)
Finds the firstResultsSummary
after a specified build which is either FINISHED or can be FINISHED, i.e.@Nullable ResultsSummary
findFirstSuccessfulBuildResultAfter(@NotNull PlanResultKey planResultKey)
Finds the last successfulResultsSummary
after buildNumber@NotNull List<LinkedJiraIssue>
findJiraIssuesForPlanKey(@NotNull PlanKey planKey)
Retrieves a list ofLinkedJiraIssue
linked to the given plan key@NotNull List<LinkedJiraIssue>
findJiraIssuesForResults(@NotNull List<ResultsSummary> buildResults)
Retrieves a list ofLinkedJiraIssue
linked to the given build result summaries@NotNull List<PlanKey>
findJobKeysFromExistingChainResults(@NotNull PlanKey chainKey)
Find keys of jobs for which results associated with given plan exist.@Nullable ResultsSummary
findLastBuildResultBefore(@NotNull String buildKey, int buildNumber)
Finds the last successful or failingBuildResultsSummary
before buildNumber<T extends ResultsSummary>
TfindLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
Finds the last successful or failingBuildResultsSummary
before buildNumber@Nullable ResultsSummary
findLastFailingBuildResultBefore(@NotNull ImmutablePlan build, int buildNumber)
Finds the last failingResultsSummary
before buildNumber@Nullable ResultsSummary
findLastFailingBuildResultBefore(@NotNull PlanKey planKey, int buildNumber)
Finds the last failingResultsSummary
before buildNumber<T extends ResultsSummary>
TfindLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass)
Finds the last successful or failingResultsSummary
before planResultKey.getBuildNumber<T extends ResultsSummary>
TfindLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass, boolean includeOnceOffBuilds)
Finds the lastResultsSummary
before planResultKey.getBuildNumber<T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass)
<T extends ResultsSummary>
TfindLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass, boolean ignoreSpecsResults)
@Nullable ResultsSummary
findLastSuccessfulBuildResultBefore(@NotNull PlanResultKey planResultKey)
Finds the last successfulResultsSummary
before build@Nullable ResultsSummary
findLastSuccessfulBuildResultBefore(@NotNull PlanResultKey planResultKey, boolean includeOnceOffBuilds)
Finds the last successfulResultsSummary
before buildint
findMinimumBuildNumberForNLatest(@NotNull PlanKey planKey, int n)
Find a build number for which exist n non-specs results with a build number greater or equal.@NotNull List<? extends ResultsSummary>
findResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)
Finds a list of results which are linked to the given issue keys@NotNull List<? extends ResultsSummary>
findResultsSummariesByProjectKey(@Nullable String projectKey)
Provide a list of results which are linked to any issues under the given jira project key@NotNull List<ResultsSummary>
getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns all theResultsSummary
objects that represent build results strictly after the given build number.<T extends ResultsSummary>
@NotNull Collection<T>getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state<T extends ResultsSummary>
@NotNull Collection<T>getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state<T extends ResultsSummary>
@NotNull Collection<T>getAllInProgressResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state<T extends ResultsSummary>
@NotNull Collection<T>getAllPendingResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.PENDING
state<T extends ResultsSummary>
@NotNull Collection<T>getAllQueuedResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.QUEUED
state<T extends ResultsSummary>
TgetAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
Generic search to find any result summary basing on the criteria provided.long
getAveragePlanExecutionDuration(@NotNull ImmutablePlan plan, int numberOfResults)
Get average duration from n last results summaries in finished state for a plan.@NotNull List<ResultsSummary>
getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns all theResultsSummary
objects that represent build results strictly before the given build number.@Nullable ResultsSummary
getBreakingBuild(ResultsSummary buildResultsSummary)
Returns the first failing build after the last successful build.@Nullable ChainStageResult
getChainStageResultById(@NotNull Long id)
Returns aChainStageResult
by its id@NotNull List<UnassociatedCommit>
getCommitsForUser(@NotNull String username, int max)
Retrieve a list of recent Commits for the given user.<T extends ResultsSummary>
@NotNull List<T>getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
Returns all theResultsSummary
in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state with the givenClass
.@Nullable ResultsSummary
getFixingBuild(ResultsSummary buildResultsSummary)
Returns the first successfulResultsSummary
for givenResultsSummary
.@NotNull List<ResultsSummary>
getLastNFailedResultsSummaries(@NotNull PlanIdentifier planIdentifier, int numberOfResults)
Returns the most recent n failed build results.default @NotNull List<ResultsSummary>
getLastNFailedResultsSummaries(@NotNull Plan build, int numberOfResults)
Deprecated.since 8.2.0.default @NotNull List<ResultsSummary>
getLastNResultsSummaries(@NotNull ImmutablePlan plan, int numberOfResults)
Deprecated.since 8.2.0.@NotNull List<ResultsSummary>
getLastNResultsSummaries(@NotNull PlanIdentifier planIdentifier, int numberOfResults)
Provides a list of the latest N results summaries for the given plan, newest first.<T extends ResultsSummary>
TgetLastResultsSummary(@NotNull String planKey, Class<T> aClass)
Get the lastResultsSummary
for planKey andClass
<T extends ResultsSummary>
TgetLastResultsSummary(@NotNull String planKey, Class<T> aClass, boolean ignoreSpecsResults)
Get the lastResultsSummary
for planKey andClass
with possible skip of specs results.@Nullable ResultsSummary
getLastSuccessfulResultSummary(@NotNull PlanKey planKey)
Get the last successfulResultsSummary
for planKeyList<ResultsSummary>
getLatestFailedResultSummaries()
Retrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to seeList<ResultsSummary>
getLatestResultSummaries()
Retrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see@NotNull List<ResultsSummary>
getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns all theResultsSummary
objects that represent build results "around" the given build number.@NotNull List<ResultsSummary>
getNeighbouringSummaries(Plan plan, int buildNumber)
Returns all theResultsSummary
objects that matches the passed build numbersint
getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Gets the number of concurrently running buildslong
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(@NotNull Plan plan)
long
getNumberOfResults()
Get number of allResultsSummary
s@Nullable ChainResultsSummary
getParentResultSummary(ResultsSummary resultsSummary)
Get (@link ChainResultsSummary} containing givenResultsSummary
@NotNull List<PlanKey>
getPlanKeysSortedByNumberOfFinalizedResultSummaries()
@Nullable ResultsSummary
getResultsSummary(long id)
Lookup the ResultsSummary by id@Nullable ResultsSummary
getResultsSummary(@NotNull PlanResultKey planResultKey)
Lookup the ResultsSummary byPlanResultKey
<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.@Nullable ResultsSummary
getResultsSummary(@NotNull PlanResultKey planResultKey, ResultDataRead dataRead)
Lookup the ResultsSummary byPlanResultKey
.<T extends ResultsSummary>
@NotNull List<T>getResultSummaries(@NotNull ResultsSummaryCriteria criteria)
Generic search to find any result summaries basing on the criteria provided.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesByChangeSetId(@NotNull String changeSetId, @NotNull Class<T> discriminator)
Get a list of all build results containing a commit with the given changeset ID.<T extends ResultsSummary>
@NotNull 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>
@NotNull List<T>getResultSummariesByChangeSetIds(@NotNull Iterable<Pair<String,RepositoryData>> changeSetIds, Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs and which are in the supplied list of repository datas.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesByCheckoutChangesetId(@NotNull String changeSetId, @NotNull Class<T> discriminator)
Get a list of all build results containing repositories checked out with the given changeset ID.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria)
Searches forresult summaries
according to the givencriteria
for use in build expiry.<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)
<T extends ResultsSummary>
@NotNull List<T>getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
Get 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
void
invalidateLogSize(@NotNull PlanResultKey planResultKey)
Invalidates the log size of aResultsSummary
with the givenPlanResultKey
.int
markResultSummariesForDeletion(@NotNull PlanKey planKey)
Mass update of allResultsSummary
records in the database related to a Plan identified by planKey.void
moveResultSummaries(@NotNull Plan newParentPlan, @NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey)
Reassigns plan key ResultsSummaries associated with selected plan key.void
postBuildVariableSnapshotUpdate(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
Saves result variables produced in a job.int
removeAllOrphanedResultSummaries()
Removes all theResultsSummary
objects in the database that do not have a matchingPlan
void
removeArtifacts(@NotNull ImmutablePlan plan, int buildNumber)
Remove any artifacts stored for this plan resultvoid
removeArtifacts(@NotNull ResultsSummary resultsSummary)
Remove any artifacts stored for this plan resultvoid
removeBuildLogs(@NotNull ResultsSummary resultsSummary)
Remove any build logs stored for this plan resultvoid
removeBuildLogs(@NotNull ResultsSummary resultsSummary, long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).void
removeBuildLogs(ImmutablePlan plan, int buildNumber)
Remove any build logs stored for this plan resultvoid
removeBuildLogs(ImmutablePlan plan, int buildNumber, long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).void
removeMatchingArtifacts(@NotNull ResultsSummary resultsSummary, @NotNull com.google.common.base.Predicate<ArtifactLink> predicate)
Remove artifacts from results summary that match a predicate.void
removeMergeResultSummary(@NotNull MergeResultSummary mergeResult)
Removes merge result.int
removeResultsSummariesForPlan(@NotNull Plan plan)
Remove all resultSummary objects for the given plan.void
removeResultSummary(@NotNull ImmutablePlan plan, int buildNumber)
Remove plan result summary and all associated objects.void
removeResultSummary(@NotNull PlanResultKey planResultKey)
Remove plan result summary and all associated objects.void
removeResultSummary(@NotNull ResultsSummary resultsSummary)
Remove plan result summary and all associated objects.void
removeResultSummary(@Nullable ImmutablePlan plan, @NotNull ResultsSummary resultsSummary)
Deprecated.since 6.9 plan argument is not used.ResultsSummary
resetResultSummary(@NotNull BuildResultsSummary resultsSummary)
Prepare result summry to be reuse for plan rerunvoid
saveResultSummary(@NotNull ResultsSummary resultsSummary)
Saves theResultsSummary
long
scrollResultSummaries(@NotNull String buildKey, @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized.long
scrollResultSummaries(@NotNull String buildKey, ResultDataRead resultDataRead, @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized.void
updateLifeCycleState(@NotNull ResultsSummary resultsSummary, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState)
Update LifeCycleState and saves the givenResultsSummary
void
updateLifeCycleState(@NotNull BuildIdentifier buildIdentifier, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState)
Update LifeCycleState and saves theResultsSummary
for givenBuildContext
Updates also timing informationvoid
updateLifeCycleState(@NotNull CurrentlyBuilding currentlyBuilding, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState)
Update LifeCycleState and saves theResultsSummary
for givenBuildContext
Updates also timing information.void
updatePlanCompletedDate(@NotNull ChainResultsSummary resultsSummary, @NotNull Date completionDate)
Update completed date and duration ofChainResultsSummary
void
updateProcessingDuration(ChainResultsSummary resultSummary)
UpdatesImmutableResultsSummary.getProcessingDuration()
andChainStageResult.getProcessingDuration()
based on chain execution.void
updateResultSummaryWithBuildChanges(@NotNull BuildContext buildContext)
void
updateVariablesOnContinuedBuild(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
Add manual variables added when starting manual stage or restarting failed stage.
-
-
-
Method Detail
-
createResultsSummary
<T extends ResultsSummary> T createResultsSummary(@NotNull @NotNull BuildContext buildContext, @NotNull @NotNull Class<T> aClass) throws ResultsSummaryCreationException
Creates aResultsSummary
of the givenClass
- Type Parameters:
T
-- Parameters:
buildContext
-aClass
-- Returns:
- resultsSummary
- Throws:
ResultsSummaryCreationException
-
getResultsSummary
@Nullable @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey)
Lookup the ResultsSummary byPlanResultKey
- Parameters:
planResultKey
-- Returns:
- resultsSummary
-
getResultsSummary
@Nullable @Nullable ResultsSummary getResultsSummary(long id)
Lookup the ResultsSummary by id- Parameters:
id
- - database id- Returns:
- resultsSummary
-
getResultsSummary
@Nullable @Nullable ResultsSummary getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, ResultDataRead dataRead)
Lookup the ResultsSummary byPlanResultKey
. All lazy initialized collections can be eagerly fetched to avoid session problems. Use with caution - expensive call- Parameters:
planResultKey
-dataRead
-- Returns:
- resultsSummary
-
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 fetched to avoid session problems. Use with caution - expensive call- Type Parameters:
T
-- Parameters:
planResultKey
-aClass
-dataRead
-- Returns:
- resultSummary
-
updateLifeCycleState
void updateLifeCycleState(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState)
Update LifeCycleState and saves the givenResultsSummary
- Parameters:
resultsSummary
- ResultsSummary to be updated and savedlifeCycleState
- LifeCycleState to be setbuildState
- BuildState to be set
-
cleanPendingLifeCycleState
void cleanPendingLifeCycleState(@NotNull @NotNull PlanResultKey planResultKey)
Cleans state of pending result.
-
updateLifeCycleState
void updateLifeCycleState(@NotNull @NotNull BuildIdentifier buildIdentifier, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState)
Update LifeCycleState and saves theResultsSummary
for givenBuildContext
Updates also timing information- Parameters:
buildIdentifier
- BuildIdentifier used to get information on ResultsSummarylifeCycleState
- LifeCycleState to be setbuildState
- BuildState to be set
-
updateLifeCycleState
void updateLifeCycleState(@NotNull @NotNull CurrentlyBuilding currentlyBuilding, @NotNull @NotNull LifeCycleState lifeCycleState, @NotNull @NotNull BuildState buildState)
Update LifeCycleState and saves theResultsSummary
for givenBuildContext
Updates also timing information.- Parameters:
currentlyBuilding
- in-memory state of the buildlifeCycleState
- LifeCycleState to be setbuildState
- BuildState to be set- Since:
- 9.3
-
updatePlanCompletedDate
void updatePlanCompletedDate(@NotNull @NotNull ChainResultsSummary resultsSummary, @NotNull @NotNull Date completionDate)
Update completed date and duration ofChainResultsSummary
- Parameters:
resultsSummary
-completionDate
-
-
calculateAndSetDeltaState
void calculateAndSetDeltaState(ResultsSummary resultsSummary)
Figures out the delta state for the provided results summary, if a 'fixing' build will also calculate how long it took to fix. This method only updates the values on the provided results summary object, it does not save it to the database. Assumes buildState has already been set on resultsSummary.- Parameters:
resultsSummary
- to update
-
saveResultSummary
void saveResultSummary(@NotNull @NotNull ResultsSummary resultsSummary)
Saves theResultsSummary
- Parameters:
resultsSummary
-
-
addVariableContextSnapshotToResultSummary
void addVariableContextSnapshotToResultSummary(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext)
Adds state of global and plan variables to result at the beginning of execution. If first argument is chain result, also adds snapshot of manual variables.- Parameters:
resultsSummary
-variableContext
-
-
updateVariablesOnContinuedBuild
void updateVariablesOnContinuedBuild(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext)
Add manual variables added when starting manual stage or restarting failed stage. Does nothing for job results.- Parameters:
resultsSummary
-variableContext
-
-
clearVariablesOnRerunBuild
void clearVariablesOnRerunBuild(@NotNull @NotNull ResultsSummary resultSummary)
Clear stored stage manual variables when build is fully rerun. Does nothing for job results.- Parameters:
resultSummary
-
-
postBuildVariableSnapshotUpdate
void postBuildVariableSnapshotUpdate(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull VariableContext variableContext)
Saves result variables produced in a job. Does nothing for chain results.- Parameters:
resultsSummary
-variableContext
-
-
getAllPendingResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.PENDING
state- Returns:
- pendingSummaries
-
getAllQueuedResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.QUEUED
state- Returns:
- summaries
-
getAllInProgressResultSummaries
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state- Parameters:
aClass
-- Returns:
- summaries
-
getAllActiveResultSummariesForPlan
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
Returns all theResultsSummary
in aLifeCycleState.IN_PROGRESS
state- Parameters:
aClass
-- 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
. Results 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:
-
getNeighbouringSummaries
@NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int buildNumber)
Returns all theResultsSummary
objects that matches the passed build numbers- Parameters:
plan
-buildNumber
-- Returns:
List
ofBuildResultsSummary
-
getNeighbouringSummaries
@NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
Returns all theResultsSummary
objects that represent build results "around" the 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:
List
ofBuildResultsSummary
in ascending order. At most there will bemaxCount
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 all theResultsSummary
objects that represent build results strictly before the 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:
List
ofBuildResultsSummary
in ascending order. At most there will bemaxCount
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 all theResultsSummary
objects that represent build results strictly after the 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:
List
ofBuildResultsSummary
in ascending order. At most there will bemaxCount
items in the list, exclusive of the result forbuildNumber
(if present).
-
getNumberOfConcurrentlyRunningBuilds
int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Gets the number of concurrently running builds- Parameters:
planKey
-- Returns:
-
getAllBuildResultSummariesInUnknownState
@NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all theBuildResultsSummary
in aBuildState.UNKNOWN
state- Returns:
- summaries
-
findLastResultBefore
@Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass)
Finds the last successful or failingResultsSummary
before planResultKey.getBuildNumber- Parameters:
planResultKey
-aClass
-- Returns:
-
findLastResultBefore
@Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass, boolean includeOnceOffBuilds)
Finds the lastResultsSummary
before planResultKey.getBuildNumber- Parameters:
planResultKey
-aClass
-includeOnceOffBuilds
- - should we skip once-off builds or include them in the search- Returns:
-
getChainStageResultById
@Nullable @Nullable ChainStageResult getChainStageResultById(@NotNull @NotNull Long id)
Returns aChainStageResult
by its id- Returns:
- chainStageResult
-
getNumberOfResults
long getNumberOfResults()
Get number of allResultsSummary
s- Returns:
- number of summaries
-
getNumberOfFinishedResults
long getNumberOfFinishedResults(@NotNull @NotNull Plan plan)
- Parameters:
plan
-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
- Parameters:
plan
-- Returns:
- number of summaries
-
getNumberOfFinalizedResults
long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)
Get number of theResultsSummary
s in aLifeCycleState.FINISHED
orLifeCycleState.NOT_BUILT
state for the givenPlan
- Parameters:
planKey
-- Returns:
- number of summaries
- Since:
- 6.9
-
getResultSummariesForPlan
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
Get theResultsSummary
s for the givenPlan
in anyLifeCycleState
. Results are sorted by build number (descending). User can skip first n result and request maximum number of results.- 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
-
getAveragePlanExecutionDuration
long getAveragePlanExecutionDuration(@NotNull @NotNull ImmutablePlan plan, int numberOfResults)
Get average duration from n last results summaries in finished state for a plan. Results in SUCCESSFUL state are preferred; only if there are none those in FAILED state are selected.- Parameters:
plan
-numberOfResults
- amount of results to be taken into account for average calculation- Returns:
- average duration in milliseconds or 0 if there is no results
-
getLastResultsSummary
<T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull String planKey, Class<T> aClass)
Get the lastResultsSummary
for planKey andClass
- Type Parameters:
T
-- Parameters:
planKey
-aClass
-- Returns:
-
getLastResultsSummary
<T extends ResultsSummary> T getLastResultsSummary(@NotNull @NotNull String planKey, Class<T> aClass, boolean ignoreSpecsResults)
Get the lastResultsSummary
for planKey andClass
with possible skip of specs results.- Type Parameters:
T
-- Parameters:
planKey
-aClass
-ignoreSpecsResults
-- Returns:
-
getLastSuccessfulResultSummary
@Nullable @Nullable ResultsSummary getLastSuccessfulResultSummary(@NotNull @NotNull PlanKey planKey)
Get the last successfulResultsSummary
for planKey- Parameters:
planKey
-- Returns:
-
removeResultsSummariesForPlan
int removeResultsSummariesForPlan(@NotNull @NotNull Plan plan)
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 in such case#scheduleResultsSummariesForDelayedDeletion(Plan)
should be considered.- Parameters:
plan
- to remove results for.- Returns:
- number of
ResultsSummary
s removed
-
removeAllOrphanedResultSummaries
int removeAllOrphanedResultSummaries()
Removes all theResultsSummary
objects in the database that do not have a matchingPlan
- Returns:
- number of
ResultsSummary
s removed
-
findFirstFailedBuildResultAfter
@Nullable @Nullable ResultsSummary findFirstFailedBuildResultAfter(@NotNull @NotNull String buildKey, int buildNumber)
Finds the first failedResultsSummary
after buildNumber- Parameters:
buildKey
-buildNumber
-- Returns:
- buildResult
-
findFirstSuccessfulBuildResultAfter
@Nullable @Nullable ResultsSummary findFirstSuccessfulBuildResultAfter(@NotNull @NotNull PlanResultKey planResultKey)
Finds the last successfulResultsSummary
after buildNumber- Parameters:
planResultKey
-- Returns:
- buildResult
-
findLastSuccessfulBuildResultBefore
@Nullable @Nullable ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull @NotNull PlanResultKey planResultKey)
Finds the last successfulResultsSummary
before build- Parameters:
planResultKey
-- Returns:
- buildResult
-
findLastSuccessfulBuildResultBefore
@Nullable @Nullable ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull @NotNull PlanResultKey planResultKey, boolean includeOnceOffBuilds)
Finds the last successfulResultsSummary
before build- Since:
- 6.8.1
-
findLastFailingBuildResultBefore
@Nullable @Nullable ResultsSummary findLastFailingBuildResultBefore(@NotNull @NotNull ImmutablePlan build, int buildNumber)
Finds the last failingResultsSummary
before buildNumber- Parameters:
build
-buildNumber
-- Returns:
- buildResult
-
findLastFailingBuildResultBefore
@Nullable @Nullable ResultsSummary findLastFailingBuildResultBefore(@NotNull @NotNull PlanKey planKey, int buildNumber)
Finds the last failingResultsSummary
before buildNumber- Returns:
- buildResult
-
findFirstFailedBuildResultBetween
@Nullable @Nullable ResultsSummary findFirstFailedBuildResultBetween(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber)
Finds the first failed build between the upper and lower build numbers inclusively.*
-
findFirstFailedBuildResultBetween
@Nullable @Nullable ResultsSummary findFirstFailedBuildResultBetween(@NotNull @NotNull ImmutablePlan build, int lowerBuildNumber, int upperBuildNumber)
Finds the first failed build between the upper and lower build numbers inclusively.- Parameters:
build
-lowerBuildNumber
-upperBuildNumber
-- Returns:
- buildResults
-
findLastBuildResultBefore
@Nullable @Nullable ResultsSummary findLastBuildResultBefore(@NotNull @NotNull String buildKey, int buildNumber)
Finds the last successful or failingBuildResultsSummary
before buildNumber- Parameters:
buildKey
-buildNumber
-- Returns:
-
findLastBuildResultBeforeWithTests
@Nullable <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
Finds the last successful or failingBuildResultsSummary
before buildNumber- Parameters:
planResultKey
-includeOnceOffBuilds
- should once-off builds be considered or ignored in the searchaClass
-- Returns:
- resultsSummary
-
getBreakingBuild
@Nullable @Nullable ResultsSummary getBreakingBuild(ResultsSummary buildResultsSummary)
Returns the first failing build after the last successful build. ie the latest build before this one with the delta state "broken"- Parameters:
buildResultsSummary
- of the current build- Returns:
- null if there is no breaking build.
-
getFixingBuild
@Nullable @Nullable ResultsSummary getFixingBuild(ResultsSummary buildResultsSummary)
Returns the first successfulResultsSummary
for givenResultsSummary
. The input build is returned if it is successful.- Parameters:
buildResultsSummary
-- Returns:
- null if there is no fixing build.
-
getLatestResultSummaries
List<ResultsSummary> getLatestResultSummaries()
Retrieve list of build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see- Returns:
List
ofResultsSummary
-
getLatestFailedResultSummaries
List<ResultsSummary> getLatestFailedResultSummaries()
Retrieve list of failed build results (for all builds) in the last few days (number of days is specified in the DAO) This method is filtered to remove results that user doesn't have permission to see- Returns:
List
ofResultsSummary
-
getLastNResultsSummaries
@NotNull @NotNull List<ResultsSummary> getLastNResultsSummaries(@NotNull @NotNull PlanIdentifier planIdentifier, int numberOfResults)
Provides a list of the latest N results summaries for the given plan, newest first.- Parameters:
planIdentifier
- - to get the results fornumberOfResults
- - number of summaries you would like- Returns:
- list<ResultsSummary>
-
getLastNResultsSummaries
@Deprecated @NotNull default @NotNull List<ResultsSummary> getLastNResultsSummaries(@NotNull @NotNull ImmutablePlan plan, int numberOfResults)
Deprecated.since 8.2.0. UsegetLastNResultsSummaries(PlanIdentifier, int)
Provides a list of the latest N results summaries for the given plan, newest first.- Parameters:
plan
- - to get the results fornumberOfResults
- - number of summaries you would like- Returns:
- list<ResultsSummary>
-
getLastNFailedResultsSummaries
@NotNull @NotNull List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull @NotNull PlanIdentifier planIdentifier, int numberOfResults)
Returns the most recent n failed build results. Sorted by newest first.- Parameters:
planIdentifier
-numberOfResults
- must be > 0
-
getLastNFailedResultsSummaries
@NotNull @Deprecated default @NotNull List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull @NotNull Plan build, int numberOfResults)
Deprecated.since 8.2.0. UsegetLastNFailedResultsSummaries(PlanIdentifier, int)
Returns the most recent n failed build results. Sorted by newest first.- Parameters:
build
-numberOfResults
- must be > 0
-
getAnyResultSummary
@Nullable <T extends ResultsSummary> T getAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
Generic search to find any result summary basing on the criteria provided. Note that if criteria does not specify order then result of this method might be non-deterministic.- Parameters:
criteria
- containing all the search constraints- Returns:
- any resultSummary matching the criteria or null.
-
getResultSummaries
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
Generic search to find any result summaries basing on the criteria provided.- Parameters:
criteria
- containing all the search constraints- Returns:
- list of resultsSummaries matching the criteria.
-
getResultSummariesForExpiry
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria expiryCriteria)
Searches forresult summaries
according to the givencriteria
for use in build expiry.- Type Parameters:
T
- type of returned results (determined by the criteria)- Parameters:
expiryCriteria
- search constraints- Returns:
- list of
results summaries
matching the criteria
-
findJiraIssuesForResults
@NotNull @NotNull List<LinkedJiraIssue> findJiraIssuesForResults(@NotNull @NotNull List<ResultsSummary> buildResults)
Retrieves a list ofLinkedJiraIssue
linked to the given build result summaries- Parameters:
buildResults
- to look for issues attached to- Returns:
- a list of
LinkedJiraIssue
linked to the given build result summaries
-
findJiraIssuesForPlanKey
@NotNull @NotNull List<LinkedJiraIssue> findJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
Retrieves a list ofLinkedJiraIssue
linked to the given plan key- Parameters:
planKey
- to look for issues associated with plan of this key- Returns:
- a list of
LinkedJiraIssue
linked to the givenPlan
-
findResultsSummariesByJiraIssues
@NotNull @NotNull List<? extends ResultsSummary> findResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
Finds a list of results which are linked to the given issue keys- Parameters:
issueKeys
- to search for- Returns:
- al list of ResultsSummary associated with any of the given list of issue keys
-
findResultsSummariesByProjectKey
@NotNull @NotNull List<? extends ResultsSummary> findResultsSummariesByProjectKey(@Nullable @Nullable String projectKey)
Provide a list of results which are linked to any issues under the given jira project key- Parameters:
projectKey
- - jira project key- Returns:
- a list of results which are linked to any issues under the given jira project key
-
getParentResultSummary
@Nullable @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary resultsSummary)
Get (@link ChainResultsSummary} containing givenResultsSummary
- Parameters:
resultsSummary
-- Returns:
-
getStageForResult
@Nullable @Nullable ChainStageResult getStageForResult(ResultsSummary resultsSummary)
Get (@link ChainStageResult} containing givenResultsSummary
- Parameters:
resultsSummary
-- Returns:
-
removeResultSummary
void removeResultSummary(@NotNull @NotNull ImmutablePlan plan, int buildNumber)
Remove plan result summary and all associated objects.- Parameters:
plan
-buildNumber
-
-
removeResultSummary
@Deprecated void removeResultSummary(@Nullable @Nullable ImmutablePlan plan, @NotNull @NotNull ResultsSummary resultsSummary)
Deprecated.since 6.9 plan argument is not used. UseremoveResultSummary(ResultsSummary)
instead.Remove plan result summary and all associated objects.- Parameters:
plan
- not usedresultsSummary
-
-
removeResultSummary
void removeResultSummary(@NotNull @NotNull ResultsSummary resultsSummary)
Remove plan result summary and all associated objects.- Since:
- 6.9
-
removeResultSummary
void removeResultSummary(@NotNull @NotNull PlanResultKey planResultKey)
Remove plan result summary and all associated objects.- Since:
- 6.9
-
removeArtifacts
void removeArtifacts(@NotNull @NotNull ImmutablePlan plan, int buildNumber) throws IOException
Remove any artifacts stored for this plan result- Parameters:
plan
-buildNumber
-- Throws:
IOException
-
removeArtifacts
void removeArtifacts(@NotNull @NotNull ResultsSummary resultsSummary) throws IOException
Remove any artifacts stored for this plan result- Parameters:
resultsSummary
-- Throws:
IOException
-
removeMatchingArtifacts
void removeMatchingArtifacts(@NotNull @NotNull ResultsSummary resultsSummary, @NotNull @NotNull com.google.common.base.Predicate<ArtifactLink> predicate) throws IOException
Remove artifacts from results summary that match a predicate.- Parameters:
resultsSummary
-predicate
-- Throws:
IOException
-
removeBuildLogs
void removeBuildLogs(ImmutablePlan plan, int buildNumber)
Remove any build logs stored for this plan result- Parameters:
plan
-buildNumber
-
-
removeBuildLogs
void removeBuildLogs(@NotNull @NotNull ResultsSummary resultsSummary)
Remove any build logs stored for this plan result- Parameters:
resultsSummary
-
-
removeBuildLogs
void removeBuildLogs(ImmutablePlan plan, int buildNumber, long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).- Parameters:
plan
-buildNumber
-maxIgnoredLogSize
-
-
removeBuildLogs
void removeBuildLogs(@NotNull @NotNull ResultsSummary resultsSummary, long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).- Parameters:
resultsSummary
-maxIgnoredLogSize
-
-
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
-
moveResultSummaries
void moveResultSummaries(@NotNull @NotNull Plan newParentPlan, @NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)
Reassigns plan key ResultsSummaries associated with selected plan key.- Parameters:
newParentPlan
- the new parent plan of result summaries. This should be a plan, not a job.
-
scrollResultSummaries
long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
Scroll through and execute function for each of BuildResultsSummary Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.- Parameters:
buildKey
- of the plan you want to scroll the result summaries forfunction
- function to be executed on each of the BuildResultSummary- Returns:
- number of traversed rows
-
scrollResultSummaries
long scrollResultSummaries(@NotNull @NotNull String buildKey, ResultDataRead resultDataRead, @NotNull @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
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 forresultDataRead
- if the data should be loaded lazy or eagerlyfunction
- function to be executed on each of the BuildResultSummary- Returns:
- number of traversed rows
-
findFirstResultAfter
@Nullable <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull PlanResultKey planResultKey, Class<T> aClass)
Finds the firstResultsSummary
after a specified build which is either FINISHED or can be FINISHED, i.e. is not in NOT_BUILT state.- Parameters:
planResultKey
-aClass
-- Returns:
-
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
-
getResultSummariesByChangeSetId
@NotNull <T extends ResultsSummary> @NotNull 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)
- Type Parameters:
T
- extends ResultSummary- Parameters:
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
-
getResultSummariesByCheckoutChangesetId
@NotNull <T extends ResultsSummary> @NotNull 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)
- Type Parameters:
T
- extends ResultSummary- Parameters:
changeSetId
- of the checkout commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a repository which
was checked out with a
changeSetId
commit
-
getResultSummariesByChangeSetIdAndRepository
@NotNull <T extends ResultsSummary> @NotNull 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.- 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
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs.- Type Parameters:
T
- extends ResultSummary- Parameters:
changeSetIds
- of the commitdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with any of the given changeSetIds
-
getResultSummariesByChangeSetIds
@NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull Iterable<Pair<String,RepositoryData>> changeSetIds, Class<T> discriminator)
Get a list of all build results containing a commit with any of the given changeset IDs and which are in the supplied list of repository datas.- Type Parameters:
T
- extends ResultSummary- Parameters:
changeSetIds
- of the commit anding with the repository that commit came fromdiscriminator
- class of the ResultSummary interface required- Returns:
- List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with any of the given changeSetIds
-
getCommitsForUser
@NotNull @NotNull List<UnassociatedCommit> getCommitsForUser(@NotNull @NotNull String username, int max)
Retrieve a list of recent Commits for the given user. Items in the collection are unique and sorted by date.- Parameters:
username
- to filter commits bymax
- maximum number of commits to get.- Returns:
- a list of recent Commits for the given user
-
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
-
updateProcessingDuration
void updateProcessingDuration(ChainResultsSummary resultSummary)
UpdatesImmutableResultsSummary.getProcessingDuration()
andChainStageResult.getProcessingDuration()
based on chain execution.- Parameters:
resultSummary
-
-
markResultSummariesForDeletion
int markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)
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
-
updateResultSummaryWithBuildChanges
void updateResultSummaryWithBuildChanges(@NotNull @NotNull BuildContext buildContext) throws ResultsSummaryCreationException
- Throws:
ResultsSummaryCreationException
-
resetResultSummary
ResultsSummary resetResultSummary(@NotNull @NotNull BuildResultsSummary resultsSummary) throws IOException
Prepare result summry to be reuse for plan rerun- Parameters:
resultsSummary
-- Returns:
- Throws:
IOException
-
removeMergeResultSummary
void removeMergeResultSummary(@NotNull @NotNull MergeResultSummary mergeResult)
Removes merge result. Use with care.- Since:
- 5.0
-
getPlanKeysSortedByNumberOfFinalizedResultSummaries
@Internal @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
-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
@NotNull @NotNull List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
-
invalidateLogSize
void invalidateLogSize(@NotNull @NotNull PlanResultKey planResultKey)
Invalidates the log size of aResultsSummary
with the givenPlanResultKey
. For aBuildResultsSummary
theChainResultsSummary
's max log size will also be invalidated.- Parameters:
planResultKey
- result key
-
findBuildResultNumbersRange
@NotNull @NotNull Range<Integer> findBuildResultNumbersRange(@NotNull @NotNull 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
-
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. Internal use only- Since:
- 6.9
-
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
-
-