@PublicApi
public interface ResultsSummaryManager
ResultsSummary
derivatives that supersedes BuildResultsSummaryManager
Modifier and Type | Method and Description |
---|---|
void |
addVariableContextSnapshotToResultSummary(ResultsSummary resultsSummary,
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.
|
Long |
calculateQueueDuration(ChainResultsSummary resultsSummary)
Calculates queueDuration value for a chain result as a maximum value of (vcsUpdateTime - queueTime) for all related job results.
|
Long |
calculateVcsUpdateDuration(ChainResultsSummary resultsSummary)
Calculates vcsUpdateDuration value for a chain result as a maximum value of (buildDate - vcsUpdateTime) for all related job results.
|
void |
clearVariablesOnRerunBuild(ResultsSummary resultSummary)
Clear stored stage manual variables when build is fully rerun.
|
int |
countResultsWithState(PlanKey planKey,
int lowerBuildNumber,
int upperBuildNumber,
BuildState buildState)
Counts results with a given state in a given build number range for plan.
|
<T extends ResultsSummary> |
createResultsSummary(BuildContext buildContext,
Class<T> aClass)
Creates a
ResultsSummary of the given Class |
List<Integer> |
findAllBuildResultsNumbers(PlanKey planKey) |
Range<Integer> |
findBuildResultNumbersRange(PlanKey planKey)
Finds minimum and maximum build number for a plan.
|
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.
|
ResultsSummary |
findFirstFailedBuildResultAfter(String buildKey,
int buildNumber)
Finds the first failed
ResultsSummary after buildNumber |
ResultsSummary |
findFirstFailedBuildResultBetween(ImmutablePlan build,
int lowerBuildNumber,
int upperBuildNumber)
Finds the first failed build between the upper and lower build numbers inclusively.
|
<T extends ResultsSummary> |
findFirstResultAfter(PlanResultKey planResultKey,
Class<T> aClass)
Finds the first
ResultsSummary after a specified build which is either FINISHED or can be FINISHED, i.e. |
ResultsSummary |
findFirstSuccessfulBuildResultAfter(PlanResultKey planResultKey)
Finds the last successful
ResultsSummary after buildNumber |
List<LinkedJiraIssue> |
findJiraIssuesForPlanKey(PlanKey planKey)
Retrieves a list of
LinkedJiraIssue linked to the given plan key |
List<LinkedJiraIssue> |
findJiraIssuesForResults(List<ResultsSummary> buildResults)
Retrieves a list of
LinkedJiraIssue linked to the given build result summaries |
ResultsSummary |
findLastBuildResultBefore(String buildKey,
int buildNumber)
Finds the last successful or failing
BuildResultsSummary before buildNumber |
<T extends ResultsSummary> |
findLastBuildResultBeforeWithTests(PlanResultKey planResultKey,
Class<T> aClass,
boolean includeOnceOffBuilds)
Finds the last successful or failing
BuildResultsSummary before buildNumber |
ResultsSummary |
findLastFailingBuildResultBefore(ImmutablePlan build,
int buildNumber)
Finds the last failing
ResultsSummary before buildNumber |
<T extends ResultsSummary> |
findLastResultBefore(PlanResultKey planResultKey,
Class<T> aClass)
Finds the last successful or failing
ResultsSummary before planResultKey.getBuildNumber |
<T extends ResultsSummary> |
findLastResultBefore(PlanResultKey planResultKey,
Class<T> aClass,
boolean includeOnceOffBuilds)
Finds the last
ResultsSummary before planResultKey.getBuildNumber |
<T extends ResultsSummary> |
findLastResultSummaryWithState(PlanKey planKey,
BuildState buildState,
Class<T> aClass) |
ResultsSummary |
findLastSuccessfulBuildResultBefore(PlanResultKey planResultKey)
Finds the last successful
ResultsSummary before build |
List<? extends ResultsSummary> |
findResultsSummariesByJiraIssues(List<String> issueKeys)
Finds a list of results which are linked to the given issue keys
|
List<? extends ResultsSummary> |
findResultsSummariesByProjectKey(String projectKey)
Provide a list of results which are linked to any issues under the given jira project key
|
List<ResultsSummary> |
getAfterSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns all the
ResultsSummary objects that represent build results strictly after the given build number. |
<T extends ResultsSummary> |
getAllActiveResultSummariesForPlan(PlanKey planKey,
Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.IN_PROGRESS state |
<T extends ResultsSummary> |
getAllBuildResultSummariesInUnknownState(Class<T> aClass)
Returns all the
BuildResultsSummary in a BuildState.UNKNOWN
state |
<T extends ResultsSummary> |
getAllInProgressResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.IN_PROGRESS state |
<T extends ResultsSummary> |
getAllPendingResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.PENDING state |
<T extends ResultsSummary> |
getAllQueuedResultSummaries(Class<T> aClass)
Returns all the
ResultsSummary in a LifeCycleState.QUEUED state |
<T extends ResultsSummary> |
getAnyResultSummary(ResultsSummaryCriteria criteria,
ResultDataRead dataRead)
Generic search to find any result summary basing on the criteria provided.
|
long |
getAveragePlanExecutionDuration(ImmutablePlan plan,
int numberOfResults)
Get average duration from n last results summaries in finished state for a plan.
|
List<ResultsSummary> |
getBeforeSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns all the
ResultsSummary objects that represent build results strictly before the given build number. |
ResultsSummary |
getBreakingBuild(ResultsSummary buildResultsSummary)
Returns the first failing build after the last successful build.
|
ChainStageResult |
getChainStageResultById(Long id)
Returns a
ChainStageResult by its id |
List<UnassociatedCommit> |
getCommitsForUser(String username,
int max)
Retrieve a list of recent Commits for the given user.
|
<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 . |
ResultsSummary |
getFixingBuild(ResultsSummary buildResultsSummary)
Returns the first successful
ResultsSummary for given ResultsSummary . |
List<ResultsSummary> |
getLastNFailedResultsSummaries(Plan build,
int numberOfResults)
Returns the most recent n failed build results.
|
List<ResultsSummary> |
getLastNResultsSummaries(ImmutablePlan plan,
int numberOfResults)
Provides a list of the latest N results summaries for the given plan, newest first.
|
<T extends ResultsSummary> |
getLastResultsSummary(String planKey,
Class<T> aClass)
Get the last
ResultsSummary for planKey and Class |
ResultsSummary |
getLastSuccessfulResultSummary(PlanKey planKey)
Get the last successful
ResultsSummary for planKey |
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
|
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
|
List<ResultsSummary> |
getNeighbouringSummaries(ImmutablePlan plan,
int buildNumber,
int maxCount)
Returns all the
ResultsSummary objects that represent build results "around" the given build number. |
List<ResultsSummary> |
getNeighbouringSummaries(Plan plan,
int buildNumber)
Returns all the
ResultsSummary objects that matches the passed build numbers |
int |
getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
Gets the number of concurrently running builds
|
long |
getNumberOfFinalizedResults(ImmutablePlan plan)
Get number of the
ResultsSummary s in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan |
long |
getNumberOfFinishedResults(Plan plan)
|
long |
getNumberOfResults()
Get number of all
ResultsSummary s |
ChainResultsSummary |
getParentResultSummary(ResultsSummary resultsSummary)
Get (@link ChainResultsSummary} containing given
ResultsSummary |
List<PlanKey> |
getPlanKeysSortedByNumberOfFinalizedResultSummaries() |
ResultsSummary |
getResultsSummary(long id)
Lookup the ResultsSummary by id
|
ResultsSummary |
getResultsSummary(PlanResultKey planResultKey)
Lookup the ResultsSummary by
PlanResultKey |
<T extends ResultsSummary> |
getResultsSummary(PlanResultKey planResultKey,
Class<T> aClass)
Lookup
ResultsSummary by PlanResultKey and expected type |
<T extends ResultsSummary> |
getResultsSummary(PlanResultKey planResultKey,
Class<T> aClass,
ResultDataRead dataRead)
Lookup
ResultsSummary by PlanResultKey and expected type. |
ResultsSummary |
getResultsSummary(PlanResultKey planResultKey,
ResultDataRead dataRead)
Lookup the ResultsSummary by
PlanResultKey . |
<T extends ResultsSummary> |
getResultSummaries(ResultsSummaryCriteria criteria)
Generic search to find any result summaries basing on the criteria provided.
|
<T extends ResultsSummary> |
getResultSummariesByChangeSetId(String changeSetId,
Class<T> discriminator)
Get a list of all build results containing a commit with the given changeset ID.
|
<T extends ResultsSummary> |
getResultSummariesByChangeSetIdAndRepository(long repositoryId,
String changeSetId,
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(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> |
getResultSummariesByChangeSetIds(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> |
getResultSummariesByCheckoutChangesetId(String changeSetId,
Class<T> discriminator)
Get a list of all build results containing repositories checked out with the given changeset ID.
|
<T extends ResultsSummary> |
getResultSummariesForExpiry(ExpiryCriteria expiryCriteria)
Searches for
result summaries according to the given criteria for
use in build expiry. |
<T extends ResultsSummary> |
getResultSummariesForPlan(ImmutablePlan plan,
int firstResult,
int maxResults)
|
<T extends ResultsSummary> |
getResultSummariesForPlanByLifeCycleState(Plan plan,
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). |
ChainStageResult |
getStageForResult(ResultsSummary resultsSummary)
Get (@link ChainStageResult} containing given
ResultsSummary |
void |
invalidateLogSize(PlanResultKey planResultKey)
Invalidates the log size of a
ResultsSummary with the given PlanResultKey . |
void |
logSubstitutedVariables(BuildContext buildContext,
ResultsSummary resultsSummary)
Deprecated.
since 5.15 without replacement, no op
|
void |
logVariablesForSubstitution(BuildContext buildContext,
ResultsSummary resultsSummary)
Deprecated.
since 5.15 without replacement, no op
|
int |
markResultSummariesForDeletion(PlanKey planKey)
Mass update of all
ResultsSummary records in the database related to a Plan identified by planKey. |
void |
moveResultSummaries(Plan newParentPlan,
PlanKey oldPlanKey,
PlanKey newPlanKey)
Reassigns plan key ResultsSummaries associated with selected plan key.
|
void |
postBuildVariableSnapshotUpdate(ResultsSummary resultsSummary,
VariableContext variableContext)
Saves result variables produced in a job.
|
int |
removeAllOrphanedResultSummaries()
Removes all the
ResultsSummary objects in the database that do not have a matching Plan |
void |
removeArtifacts(ImmutablePlan plan,
int buildNumber)
Remove any artifacts stored for this plan result
|
void |
removeArtifacts(ResultsSummary resultsSummary)
Remove any artifacts stored for this plan result
|
void |
removeBuildLogs(ImmutablePlan plan,
int buildNumber)
Remove any build logs stored for this plan result
|
void |
removeBuildLogs(ImmutablePlan plan,
int buildNumber,
long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).
|
void |
removeBuildLogs(ResultsSummary resultsSummary)
Remove any build logs stored for this plan result
|
void |
removeBuildLogs(ResultsSummary resultsSummary,
long maxIgnoredLogSize)
Remove build logs stored for this plan result that are greater than given size (in bytes).
|
void |
removeMatchingArtifacts(ResultsSummary resultsSummary,
com.google.common.base.Predicate<ArtifactLink> predicate)
Remove artifacts from results summary that match a predicate.
|
void |
removeMergeResultSummary(MergeResultSummary mergeResult)
Removes merge result.
|
int |
removeResultsSummariesForPlan(Plan plan)
Remove all resultSummary objects for the given plan.
|
void |
removeResultSummary(ImmutablePlan plan,
int buildNumber)
Remove plan result summary and all associated objects.
|
void |
removeResultSummary(ImmutablePlan plan,
ResultsSummary resultsSummary)
Remove plan result summary and all associated objects.
|
ResultsSummary |
resetResultSummary(BuildResultsSummary resultsSummary)
Prepare result summry to be reuse for plan rerun
|
void |
saveResultSummary(ResultsSummary resultsSummary)
Saves the
ResultsSummary |
long |
scrollResultSummaries(String buildKey,
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(String buildKey,
ResultDataRead resultDataRead,
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(BuildIdentifier buildIdentifier,
LifeCycleState lifeCycleState,
BuildState buildState)
Update LifeCycleState and saves the
ResultsSummary for given BuildContext
Updates also timing information |
void |
updateLifeCycleState(ResultsSummary resultsSummary,
LifeCycleState lifeCycleState,
BuildState buildState)
Update LifeCycleState and saves the given
ResultsSummary |
void |
updatePlanCompletedDate(ChainResultsSummary resultsSummary,
Date completionDate)
Update completed date and duration of
ChainResultsSummary |
void |
updateProcessingDuration(ChainResultsSummary resultSummary)
Updates
ImmutableResultsSummary.getProcessingDuration() and ChainStageResult.getProcessingDuration()
based on chain execution. |
void |
updateResultSummaryWithBuildChanges(BuildContext buildContext) |
void |
updateVariablesOnContinuedBuild(ResultsSummary resultsSummary,
VariableContext variableContext)
Add manual variables added when starting manual stage or restarting failed stage.
|
<T extends ResultsSummary> T createResultsSummary(@NotNull BuildContext buildContext, @NotNull Class<T> aClass) throws ResultsSummaryCreationException
ResultsSummary
of the given Class
T
- buildContext
- aClass
- ResultsSummaryCreationException
@Nullable ResultsSummary getResultsSummary(@NotNull PlanResultKey planResultKey)
PlanResultKey
planResultKey
- @Nullable ResultsSummary getResultsSummary(long id)
id
- - database id@Nullable ResultsSummary getResultsSummary(@NotNull PlanResultKey planResultKey, ResultDataRead dataRead)
PlanResultKey
. All lazy initialized collections can be eagerly fetched to avoid session problems.
Use with caution - expensive callplanResultKey
- dataRead
- @Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass)
ResultsSummary
by PlanResultKey
and expected typeT
- planResultKey
- aClass
- @Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, ResultDataRead dataRead)
ResultsSummary
by PlanResultKey
and expected type. All lazy initialized collections can be eagerly fetched to avoid session problems.
Use with caution - expensive callT
- planResultKey
- aClass
- dataRead
- void updateLifeCycleState(@NotNull ResultsSummary resultsSummary, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState)
ResultsSummary
resultsSummary
- ResultsSummary to be updated and savedlifeCycleState
- LifeCycleState to be setbuildState
- BuildState to be setvoid updateLifeCycleState(@NotNull BuildIdentifier buildIdentifier, @NotNull LifeCycleState lifeCycleState, @NotNull BuildState buildState)
ResultsSummary
for given BuildContext
Updates also timing informationbuildIdentifier
- BuildIdentifier used to get information on ResultsSummarylifeCycleState
- LifeCycleState to be setbuildState
- BuildState to be setvoid updatePlanCompletedDate(@NotNull ChainResultsSummary resultsSummary, @NotNull Date completionDate)
ChainResultsSummary
resultsSummary
- completionDate
- void calculateAndSetDeltaState(ResultsSummary resultsSummary)
resultsSummary
- to updatevoid saveResultSummary(@NotNull ResultsSummary resultsSummary)
ResultsSummary
resultsSummary
- void addVariableContextSnapshotToResultSummary(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
resultsSummary
- variableContext
- void updateVariablesOnContinuedBuild(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
resultsSummary
- variableContext
- void clearVariablesOnRerunBuild(@NotNull ResultsSummary resultSummary)
resultSummary
- void postBuildVariableSnapshotUpdate(@NotNull ResultsSummary resultsSummary, @NotNull VariableContext variableContext)
resultsSummary
- variableContext
- @NotNull <T extends ResultsSummary> Collection<T> getAllPendingResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.PENDING
state@NotNull <T extends ResultsSummary> Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.QUEUED
state@NotNull <T extends ResultsSummary> Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
ResultsSummary
in a LifeCycleState.IN_PROGRESS
stateaClass
- @NotNull <T extends ResultsSummary> Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
ResultsSummary
in a LifeCycleState.IN_PROGRESS
stateaClass
- @NotNull <T extends ResultsSummary> 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
.
Results 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;@NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int buildNumber)
ResultsSummary
objects that matches the passed build numbersplan
- buildNumber
- List
of BuildResultsSummary
@NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
ResultsSummary
objects that represent build results "around" the given build number.plan
- the plan to return results forbuildNumber
- the build number to search aroundmaxCount
- the maximum number of builds to returnList
of BuildResultsSummary
in ascending order. At most there will be maxCount
items in the list, inclusive of the result for buildNumber
(if present).@NotNull List<ResultsSummary> getBeforeSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
ResultsSummary
objects that represent build results strictly before the given build number.plan
- the plan to return results forbuildNumber
- the build number to search beforemaxCount
- the maximum number of builds to returnList
of BuildResultsSummary
in ascending order. At most there will be maxCount
items in the list, exclusive of the result for buildNumber
(if present).@NotNull List<ResultsSummary> getAfterSummaries(@NotNull ImmutablePlan plan, int buildNumber, int maxCount)
ResultsSummary
objects that represent build results strictly after the given build number.plan
- the plan to return results forbuildNumber
- the build number to search aftermaxCount
- the maximum number of builds to returnList
of BuildResultsSummary
in ascending order. At most there will be maxCount
items in the list, exclusive of the result for buildNumber
(if present).int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
planKey
- @NotNull <T extends ResultsSummary> Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
BuildResultsSummary
in a BuildState.UNKNOWN
state@Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass)
ResultsSummary
before planResultKey.getBuildNumberplanResultKey
- aClass
- @Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull PlanResultKey planResultKey, Class<T> aClass, boolean includeOnceOffBuilds)
ResultsSummary
before planResultKey.getBuildNumberplanResultKey
- aClass
- includeOnceOffBuilds
- - should we skip once-off builds or include them in the search@Nullable ChainStageResult getChainStageResultById(@NotNull Long id)
ChainStageResult
by its idlong getNumberOfResults()
ResultsSummary
slong getNumberOfFinishedResults(@NotNull Plan plan)
plan
- long getNumberOfFinalizedResults(@NotNull ImmutablePlan plan)
ResultsSummary
s in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state for the given Plan
plan
- @NotNull <T extends ResultsSummary> List<T> getResultSummariesForPlan(@NotNull ImmutablePlan plan, int firstResult, int maxResults)
ResultsSummary
s for the given Plan
in any LifeCycleState
. Results are sorted by build number (descending). User can skip first n result
and request maximum number of results.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> List<T> getResultSummariesForPlanByLifeCycleState(@NotNull Plan plan, @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.long getAveragePlanExecutionDuration(@NotNull ImmutablePlan plan, int numberOfResults)
plan
- numberOfResults
- amount of results to be taken into account for average calculation<T extends ResultsSummary> T getLastResultsSummary(@NotNull String planKey, Class<T> aClass)
ResultsSummary
for planKey and Class
T
- planKey
- aClass
- @Nullable ResultsSummary getLastSuccessfulResultSummary(@NotNull PlanKey planKey)
ResultsSummary
for planKeyplanKey
- int removeResultsSummariesForPlan(@NotNull Plan plan)
ResultsSummary
objects to be deleted
in such case #scheduleResultsSummariesForDelayedDeletion(Plan)
should be considered.plan
- to remove results for.ResultsSummary
s removedint removeAllOrphanedResultSummaries()
ResultsSummary
objects in the database that do not have a matching Plan
ResultsSummary
s removed@Nullable ResultsSummary findFirstFailedBuildResultAfter(@NotNull String buildKey, int buildNumber)
ResultsSummary
after buildNumberbuildKey
- buildNumber
- @Nullable ResultsSummary findFirstSuccessfulBuildResultAfter(@NotNull PlanResultKey planResultKey)
ResultsSummary
after buildNumberplanResultKey
- @Nullable ResultsSummary findLastSuccessfulBuildResultBefore(@NotNull PlanResultKey planResultKey)
ResultsSummary
before buildplanResultKey
- @Nullable ResultsSummary findLastFailingBuildResultBefore(@NotNull ImmutablePlan build, int buildNumber)
ResultsSummary
before buildNumberbuild
- buildNumber
- @Nullable ResultsSummary findFirstFailedBuildResultBetween(@NotNull ImmutablePlan build, int lowerBuildNumber, int upperBuildNumber)
build
- lowerBuildNumber
- upperBuildNumber
- @Nullable ResultsSummary findLastBuildResultBefore(@NotNull String buildKey, int buildNumber)
BuildResultsSummary
before buildNumberbuildKey
- buildNumber
- @Nullable <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull PlanResultKey planResultKey, @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
BuildResultsSummary
before buildNumberplanResultKey
- includeOnceOffBuilds
- should once-off builds be considered or ignored in the searchaClass
- @Nullable ResultsSummary getBreakingBuild(ResultsSummary buildResultsSummary)
buildResultsSummary
- of the current build@Nullable ResultsSummary getFixingBuild(ResultsSummary buildResultsSummary)
ResultsSummary
for given ResultsSummary
. The input build
is returned if it is successful.buildResultsSummary
- List<ResultsSummary> getLatestResultSummaries()
List
of ResultsSummary
List<ResultsSummary> getLatestFailedResultSummaries()
List
of ResultsSummary
@NotNull List<ResultsSummary> getLastNResultsSummaries(@NotNull ImmutablePlan plan, int numberOfResults)
plan
- - to get the results fornumberOfResults
- - number of summaries you would like@NotNull List<ResultsSummary> getLastNFailedResultsSummaries(@NotNull Plan build, int numberOfResults)
build
- numberOfResults
- must be > 0@NotNull <T extends ResultsSummary> T getAnyResultSummary(@NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
criteria
- containing all the search constraints@NotNull <T extends ResultsSummary> List<T> getResultSummaries(@NotNull ResultsSummaryCriteria criteria)
criteria
- containing all the search constraints@NotNull <T extends ResultsSummary> List<T> getResultSummariesForExpiry(@NotNull ExpiryCriteria expiryCriteria)
result summaries
according to the given criteria
for
use in build expiry.T
- type of returned results (determined by the criteria)expiryCriteria
- search constraintsresults summaries
matching the criteria@NotNull List<LinkedJiraIssue> findJiraIssuesForResults(@NotNull List<ResultsSummary> buildResults)
LinkedJiraIssue
linked to the given build result summariesbuildResults
- to look for issues attached toLinkedJiraIssue
linked to the given build result summaries@NotNull List<LinkedJiraIssue> findJiraIssuesForPlanKey(@NotNull PlanKey planKey)
LinkedJiraIssue
linked to the given plan keyplanKey
- to look for issues associated with plan of this keyLinkedJiraIssue
linked to the given Plan
@NotNull List<? extends ResultsSummary> findResultsSummariesByJiraIssues(@Nullable List<String> issueKeys)
issueKeys
- to search for@NotNull List<? extends ResultsSummary> findResultsSummariesByProjectKey(@Nullable String projectKey)
projectKey
- - jira project key@Nullable ChainResultsSummary getParentResultSummary(ResultsSummary resultsSummary)
ResultsSummary
resultsSummary
- @Nullable ChainStageResult getStageForResult(ResultsSummary resultsSummary)
ResultsSummary
resultsSummary
- void removeResultSummary(@NotNull ImmutablePlan plan, int buildNumber)
plan
- buildNumber
- void removeResultSummary(@NotNull ImmutablePlan plan, @NotNull ResultsSummary resultsSummary)
plan
- resultsSummary
- void removeArtifacts(@NotNull ImmutablePlan plan, int buildNumber) throws IOException
plan
- buildNumber
- IOException
void removeArtifacts(@NotNull ResultsSummary resultsSummary) throws IOException
resultsSummary
- IOException
void removeMatchingArtifacts(@NotNull ResultsSummary resultsSummary, @NotNull com.google.common.base.Predicate<ArtifactLink> predicate) throws IOException
resultsSummary
- predicate
- IOException
void removeBuildLogs(ImmutablePlan plan, int buildNumber)
plan
- buildNumber
- void removeBuildLogs(@NotNull ResultsSummary resultsSummary)
resultsSummary
- void removeBuildLogs(ImmutablePlan plan, int buildNumber, long maxIgnoredLogSize)
plan
- buildNumber
- maxIgnoredLogSize
- void removeBuildLogs(@NotNull ResultsSummary resultsSummary, long maxIgnoredLogSize)
resultsSummary
- maxIgnoredLogSize
- List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels)
criteria
- containing the restrictions for the chains to be returnedlabels
- that the jobs can be associated withvoid moveResultSummaries(@NotNull Plan newParentPlan, @NotNull PlanKey oldPlanKey, @NotNull PlanKey newPlanKey)
newParentPlan
- the new parent plan of result summaries. This should be a plan, not a job.long scrollResultSummaries(@NotNull String buildKey, @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
buildKey
- of the plan you want to scroll the result summaries forfunction
- function to be executed on each of the BuildResultSummarylong scrollResultSummaries(@NotNull String buildKey, ResultDataRead resultDataRead, @NotNull com.google.common.base.Function<ResultsSummary,Void> function)
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@Nullable <T extends ResultsSummary> T findFirstResultAfter(@NotNull PlanResultKey planResultKey, Class<T> aClass)
ResultsSummary
after a specified build which is either FINISHED or can be FINISHED, i.e. is not
in NOT_BUILT state.planResultKey
- aClass
- @Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull PlanKey planKey, @NotNull BuildState buildState, @NotNull Class<T> aClass)
T
- planKey
- buildState
- aClass
- ResultsSummary
with the provided BuildState
@NotNull <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.
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)
T
- extends ResultSummarychangeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required@NotNull <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.
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)
T
- extends ResultSummarychangeSetId
- of the checkout commitdiscriminator
- class of the ResultSummary interface requiredchangeSetId
commit@NotNull <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull String changeSetId, @NotNull Class<T> discriminator)
T
- extends ResultSummaryrepositoryId
- of the repositorychangeSetId
- of the commitdiscriminator
- class of the ResultSummary interface required@NotNull <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull List<String> changeSetIds, Class<T> discriminator)
T
- extends ResultSummarychangeSetIds
- of the commitdiscriminator
- class of the ResultSummary interface required@NotNull <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull Iterable<Pair<String,RepositoryData>> changeSetIds, Class<T> discriminator)
T
- extends ResultSummarychangeSetIds
- of the commit anding with the repository that commit came fromdiscriminator
- class of the ResultSummary interface required@NotNull List<UnassociatedCommit> getCommitsForUser(@NotNull String username, int max)
username
- to filter commits bymax
- maximum number of commits to get.int countResultsWithState(@NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @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 counted@Deprecated void logVariablesForSubstitution(@NotNull BuildContext buildContext, @NotNull ResultsSummary resultsSummary)
@Deprecated void logSubstitutedVariables(@NotNull BuildContext buildContext, @NotNull ResultsSummary resultsSummary)
void updateProcessingDuration(ChainResultsSummary resultSummary)
ImmutableResultsSummary.getProcessingDuration()
and ChainStageResult.getProcessingDuration()
based on chain execution.resultSummary
- int markResultSummariesForDeletion(@NotNull PlanKey planKey)
ResultsSummary
records in the database related to a Plan identified by planKey.planKey
- key of a planvoid updateResultSummaryWithBuildChanges(@NotNull BuildContext buildContext) throws ResultsSummaryCreationException
ResultsSummaryCreationException
ResultsSummary resetResultSummary(@NotNull BuildResultsSummary resultsSummary) throws IOException
resultsSummary
- IOException
void removeMergeResultSummary(@NotNull MergeResultSummary mergeResult)
@Internal @NotNull List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
@Nullable Long calculateQueueDuration(@NotNull ChainResultsSummary resultsSummary)
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
records@Nullable Long calculateVcsUpdateDuration(@NotNull ChainResultsSummary resultsSummary)
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
recordsvoid invalidateLogSize(@NotNull PlanResultKey planResultKey)
ResultsSummary
with the given PlanResultKey
.
For a BuildResultsSummary
the ChainResultsSummary
's max log size will also be invalidated.planResultKey
- result key@NotNull Range<Integer> findBuildResultNumbersRange(@NotNull PlanKey planKey)
planKey
- @Deprecated @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.