public class BuildResultsSummaryHibernateDao extends BambooHibernateObjectDao<ResultsSummary> implements BuildResultsSummaryDao
Modifier and Type | Field and Description |
---|---|
protected static String |
BUILD_AGENT_ID |
protected static String |
BUILD_COMPLETED_DATE |
protected static String |
BUILD_NUMBER |
protected static String |
BUILD_STATE |
protected static String |
CONTINUABLE |
protected static String |
CREATION_DATE |
protected static String |
DELTA_STATE |
protected static String |
LIFE_CYCLE_STATE |
static int |
NEIGHBOURING_SUMMARIES_MAX_COUNT |
protected static String |
PLAN_KEY |
NUMBER_OF_DAYS_TO_FILTER
Constructor and Description |
---|
BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate) |
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 elasticImage,
@Nullable BuildState buildState,
int maxResults)
Searcher for builds of an image
|
<T extends ResultsSummary> |
findByAuthors(Collection<ExtendedAuthor> authors,
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 . |
<E extends ResultsSummary> |
findById(long id,
@NotNull Class<E> aClass)
Find an entity by its id
|
<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) |
List<ChainResultsSummary> |
findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria,
List<Label> labels)
Searches through all chains to find any that have jobs which match the given labels.
|
Integer |
findFirstBuildNumberAfter(@NotNull String planKey,
int buildNumber)
Returns the build number of next existing build results.
|
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.
|
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 expiryCriteria)
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,
@NotNull Class<T> aClass)
Returns all the
BuildResultsSummary in requested build state. |
<T extends ResultsSummary> |
getAllBuildResultSummariesInLifeCycleState(@NotNull LifeCycleState state,
@NotNull 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) |
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 . |
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 |
@NotNull 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)
|
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 plan)
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 |
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 summary)
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 resultsSummary)
Removes the passed result summary
|
long |
scrollResultSummaries(@NotNull String buildKey,
@NotNull ResultDataRead dataRead,
@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.
|
void |
setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry) |
void |
setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry) |
countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, merge, save, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countAll, countWithRestriction, delete, deleteAll, findAll, merge, save, saveAll
protected static final String CREATION_DATE
protected static final String BUILD_COMPLETED_DATE
protected static final String BUILD_AGENT_ID
protected static final String BUILD_NUMBER
protected static final String PLAN_KEY
protected static final String BUILD_STATE
protected static final String LIFE_CYCLE_STATE
protected static final String DELTA_STATE
protected static final String CONTINUABLE
public static final int NEIGHBOURING_SUMMARIES_MAX_COUNT
public BuildResultsSummaryHibernateDao(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
public Long getResultsSummaryId(@NotNull @NotNull PlanResultKey planResultKey)
BuildResultsSummaryDao
ResultsSummary
's database id.
This method is intended for internal use (currently in importer)getResultsSummaryId
in interface BuildResultsSummaryDao
planResultKey
- plan result key of ResultsSummary
to be foundResultsSummary
or null if not found@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
by PlanResultKey
and expected typegetResultsSummary
in interface BuildResultsSummaryDao
@Nullable public <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, ResultDataRead dataRead)
BuildResultsSummaryDao
ResultsSummary
by PlanResultKey
and expected type, all lazy initialized collections can be eagerly readgetResultsSummary
in interface BuildResultsSummaryDao
public <E extends ResultsSummary> E findById(long id, @NotNull @NotNull Class<E> aClass)
BambooObjectDao
findById
in interface BambooObjectDao<ResultsSummary>
findById
in class BambooHibernateObjectDao<ResultsSummary>
id
- id of entityaClass
- class of entity@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInBuildState(@NotNull @NotNull BuildState state, @NotNull @NotNull Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
in requested build state.
This will not return records marked for deletion.getAllBuildResultSummariesInBuildState
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull @NotNull LifeCycleState state, @NotNull @NotNull Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
in requested lifecycle state.
This will not return records marked for deletion.getAllBuildResultSummariesInLifeCycleState
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
in a BuildState.UNKNOWN
state
This will not return records marked for deletion.getAllBuildResultSummariesInUnknownState
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.PENDING
state with the given Class
This will not return records marked for deletion.getAllPendingResultSummaries
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllQueuedResultSummaries(Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.QUEUED
state with the given Class
This will not return records marked for deletion.getAllQueuedResultSummaries
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllInProgressResultSummaries(Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.IN_PROGRESS
state with the given Class
This will not return records marked for deletion.getAllInProgressResultSummaries
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.PENDING
, LifeCycleState.QUEUED
, LifeCycleState.IN_PROGRESS
state with the given Class
See also LifeCycleState.isActive(LifeCycleState)
and ImmutableResultsSummary.isActive()
getAllActiveResultSummariesForPlan
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull List<T> getFinalizedResultSummariesForPlan(PlanKey planKey, Class<T> aClass, int firstResult, int maxResults)
BuildResultsSummaryDao
ResultsSummary
in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state with the given Class
.
Result are sorted descending by build number.getFinalizedResultSummariesForPlan
in interface BuildResultsSummaryDao
firstResult
- - specifies the first result to be included in the list.maxResults
- - specifies the length of the result; 0 for all results;public int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
BuildResultsSummaryDao
getNumberOfConcurrentlyRunningBuilds
in interface BuildResultsSummaryDao
@NotNull public @NotNull Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
BuildResultsSummaryDao
BuildResultsSummary
in a LifeCycleState.IN_PROGRESS
state
This will not return records marked for deletion.getAllInProgressBuildResultSummaries
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> T findAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
BuildResultsSummaryDao
ResultsSummary
object given a ResultsSummaryCriteria
.
Note that if criteria does not specify order then result of this method might be non-deterministic.findAnyResultSummary
in interface BuildResultsSummaryDao
List
of BuildResultsSummary
@NotNull public <T extends ResultsSummary> @NotNull List<T> findByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
BuildResultsSummaryDao
ResultsSummary
object given a ByJiraIssueResultSearchCriteria
and ResultSummarySearchCriteria
.findByJiraCriteria
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass)
BuildResultsSummaryDao
ResultsSummary
objects given a ByJiraIssueResultSearchCriteria
and ResultSummarySearchCriteria
.countByJiraCriteria
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
BuildResultsSummaryDao
ResultsSummary
object given a ResultSummarySearchCriteria
.findByCriteria
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
BuildResultsSummaryDao
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.findResultsSummaries
in interface BuildResultsSummaryDao
List
of BuildResultsSummary
public <T extends ResultsSummary> List<T> findByAuthors(Collection<ExtendedAuthor> authors, Class<T> resultClass, int maxResults)
findByAuthors
in interface BuildResultsSummaryDao
public int moveResultSummaries(@NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)
BuildResultsSummaryDao
moveResultSummaries
in interface BuildResultsSummaryDao
oldPlanKey
- the plan key to move fromnewPlanKey
- the plan key to move topublic long countResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
BuildResultsSummaryDao
ResultsSummary
objects given a ResultsSummaryCriteria
.countResultSummaries
in interface BuildResultsSummaryDao
ResultsSummary
that match the criteria.@NotNull public <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria expiryCriteria)
BuildResultsSummaryDao
ResultsSummary
objects given a ExpiryCriteria
.findResultSummariesForExpiry
in interface BuildResultsSummaryDao
T
- type of result objects (determined according to given criteria)expiryCriteria
- search constraintsList
of ResultsSummary
@NotNull public @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey)
BuildResultsSummaryDao
findJobKeysFromExistingChainResults
in interface BuildResultsSummaryDao
public int removeResultsSummariesForPlan(@NotNull @NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
objects to be deletedremoveResultsSummariesForPlan
in interface BuildResultsSummaryDao
planKey
- identifier of plan to remove results for.ResultsSummary
objectspublic Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
BuildResultsSummaryDao
ChainResultsSummary
objects in the database that do not have a matching Chain
findPlanKeysFromAllOrphanedResultSummaries
in interface BuildResultsSummaryDao
PlanKey
s they referencepublic int countBuildResultsSummaries(@NotNull @NotNull String planKey)
countBuildResultsSummaries
in interface BuildResultsSummaryDao
public int countBuildResultsSummaries()
BuildResultsSummaryDao
countBuildResultsSummaries
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImage, @Nullable @Nullable BuildState buildState, int maxResults)
BuildResultsSummaryDao
findBuildsForImageConfiguration
in interface BuildResultsSummaryDao
public List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
BuildResultsSummaryDao
findBuildResultsWithArtifacts
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
BuildResultsSummaryDao
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
BuildResultsSummaryDao.getResultSummariesByCheckoutChangesetId(String, Class)
.
getResultSummariesByChangeSetId
in interface BuildResultsSummaryDao
changeSetId
- of the commitdiscriminator
- class of the ResultSummary interface requiredpublic <T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull @NotNull String changesetId, @NotNull @NotNull Class<T> discriminator)
BuildResultsSummaryDao
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 BuildResultsSummaryDao.getResultSummariesByChangeSetId(String, Class)
.
getResultSummariesByCheckoutChangesetId
in interface BuildResultsSummaryDao
changesetId
- of the commitdiscriminator
- class of the ResultSummary interface requiredchangesetId
commitpublic <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
BuildResultsSummaryDao
getResultSummariesByChangeSetIdAndRepository
in interface BuildResultsSummaryDao
T
- extends ResultSummaryrepositoryId
- of the repositorychangeSetId
- of the commitdiscriminator
- class of the ResultSummary interface requiredpublic <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, @NotNull @NotNull Class<T> discriminator)
BuildResultsSummaryDao
getResultSummariesByChangeSetIds
in interface BuildResultsSummaryDao
changeSetIds
- of the commitsdiscriminator
- class of the ResultSummary interface required@NotNull public @NotNull List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
BuildResultsSummaryDao
findBuildResultsSummariesByJiraIssues
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable @Nullable String jiraProjectKey)
BuildResultsSummaryDao
findBuildResultsSummariesByProjectKey
in interface BuildResultsSummaryDao
jiraProjectKey
- - JIRA project key (prefix of the jira issues e.g. 'BAM')public void removeResultsSummary(@NotNull @NotNull ResultsSummary resultsSummary)
BuildResultsSummaryDao
removeResultsSummary
in interface BuildResultsSummaryDao
resultsSummary
- -public BuildResultsSummary getFirstBuildSummary(@NotNull @NotNull PlanKey planKey)
BuildResultsSummaryDao
BuildResultsSummary
for the given PlanKey
getFirstBuildSummary
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
BuildResultsSummaryDao
ResultsSummary
and Class
for the plan represented by planKeygetLastResultSummary
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
BuildResultsSummaryDao
ResultsSummary
and Class
for the plan represented by planKey
with possible skip of specs results.getLastResultSummary
in interface BuildResultsSummaryDao
public Integer findFirstBuildNumberAfter(@NotNull @NotNull String planKey, int buildNumber)
BuildResultsSummaryDao
findFirstBuildNumberAfter
in interface BuildResultsSummaryDao
public Integer findLastBuildNumberBefore(@NotNull @NotNull String planKey, int buildNumber)
BuildResultsSummaryDao
findLastBuildNumberBefore
in interface BuildResultsSummaryDao
public long getNumberOfFinishedResults(Plan plan)
BuildResultsSummaryDao
Plan
getNumberOfFinishedResults
in interface BuildResultsSummaryDao
public long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)
getNumberOfFinalizedResults
in interface BuildResultsSummaryDao
plan
- public long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
s in a LifeCycleState.FINISHED
or LifeCycleState.NOT_BUILT
state for the given Plan
getNumberOfFinalizedResults
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDao
getNeighbouringSummaries
in interface BuildResultsSummaryDao
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 public @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDao
getBeforeSummaries
in interface BuildResultsSummaryDao
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 public @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
BuildResultsSummaryDao
getAfterSummaries
in interface BuildResultsSummaryDao
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 public @Nullable ResultsSummary getBreakingBuild(ResultsSummary summary)
getBreakingBuild
in interface BuildResultsSummaryDao
@Nullable public @Nullable ResultsSummary getFixingBuild(ResultsSummary summary)
BuildResultsSummaryDao
BuildResultsSummary
for given BuildResultsSummary
.
The input build is returned if it is successful.getFixingBuild
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull @NotNull List<ResultsSummary> buildResults)
BuildResultsSummaryDao
LinkedJiraIssue
linked to the given build result summariesgetJiraIssuesForBuildResults
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
BuildResultsSummaryDao
LinkedJiraIssue
that are linked to the given build.getJiraIssuesForPlanKey
in interface BuildResultsSummaryDao
public long scrollVariableSubstitutionForExport(@NotNull @NotNull Consumer<VariableSubstitution> consumer)
BuildResultsSummaryDao
scrollVariableSubstitutionForExport
in interface BuildResultsSummaryDao
consumer
- consumer to accept each of the VariableSubstitution@Nullable public <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumberfindFirstResultAfter
in interface BuildResultsSummaryDao
@Nullable public <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
BuildResultsSummaryDao
ResultsSummary
before buildNumberfindLastResultBefore
in interface BuildResultsSummaryDao
includeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculationspublic <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
findLastBuildResultBeforeWithTests
in interface BuildResultsSummaryDao
T
- of resultplanResultKey
- of the resultaClass
- ofincludeOnceOffBuilds
- tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculationspublic ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState)
BuildResultsSummaryDao
BuildResultsSummary
after buildNumberfindFirstBuildResultWithBuildStateAfter
in interface BuildResultsSummaryDao
public ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds)
BuildResultsSummaryDao
BuildResultsSummary
before buildNumber with BuildState
findLastBuildResultWithBuildStateBefore
in interface BuildResultsSummaryDao
@Nullable public @Nullable ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull @NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
BuildResultsSummaryDao
BuildState
between the given build number range
Note that this function is inclusive of the upper and lower boundfindFirstBuildResultWithBuildStateBetween
in interface BuildResultsSummaryDao
public long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull ResultDataRead dataRead, @NotNull @NotNull Consumer<ResultsSummary> consumer)
BuildResultsSummaryDao
scrollResultSummaries
in interface BuildResultsSummaryDao
buildKey
- of the plan you want to scroll the result summaries fordataRead
- if the data should be loaded lazy or eagerlyconsumer
- consumer to accept each of the BuildResultSummariespublic ChainStageResult getChainStageResultById(long id)
BuildResultsSummaryDao
ChainStageResult
by its idgetChainStageResultById
in interface BuildResultsSummaryDao
public <T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull @NotNull Plan plan)
BuildResultsSummaryDao
ResultsSummary
s for the given Plan
getAllResultSummariesForPlan
in interface BuildResultsSummaryDao
@NotNull public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
BuildResultsSummaryDao
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.getResultSummariesForPlan
in interface BuildResultsSummaryDao
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 public <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlanByLifeCycleState(@NotNull @NotNull Plan plan, @NotNull @NotNull LifeCycleState lifeCycleState, int firstResult, int maxResults)
BuildResultsSummaryDao
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.getResultSummariesForPlanByLifeCycleState
in interface BuildResultsSummaryDao
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.@Nullable public @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary summary)
BuildResultsSummaryDao
ResultsSummary
getParentResultSummary
in interface BuildResultsSummaryDao
@Nullable public @Nullable ChainStageResult getStageForResult(ResultsSummary summary)
BuildResultsSummaryDao
ResultsSummary
getStageForResult
in interface BuildResultsSummaryDao
public List<ResultsSummary> findLatestResultsSummaries()
BuildResultsSummaryDao
findLatestResultsSummaries
in interface BuildResultsSummaryDao
public List<ResultsSummary> findLatestFailedResultSummaries()
BuildResultsSummaryDao
findLatestFailedResultSummaries
in interface BuildResultsSummaryDao
public List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria queryCriteria, List<Label> labels)
BuildResultsSummaryDao
findChainResultsWithJobLabelled
in interface BuildResultsSummaryDao
queryCriteria
- containing the restrictions for the chains to be returnedlabels
- that the jobs can be associated withpublic <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass)
findLastResultSummaryWithState
in interface BuildResultsSummaryDao
ResultsSummary
with the provided BuildState
@Nullable public <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass, boolean ignoreSpecsResults)
findLastResultSummaryWithState
in interface BuildResultsSummaryDao
ResultsSummary
with the provided BuildState
public int countResultsWithState(@NotNull @NotNull PlanKey planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
BuildResultsSummaryDao
countResultsWithState
in interface BuildResultsSummaryDao
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 countedpublic int markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)
BuildResultsSummaryDao
ResultsSummary
records in the database related to a Plan identified by planKey.markResultSummariesForDeletion
in interface BuildResultsSummaryDao
planKey
- key of a plan@NotNull public @NotNull List<PlanKey> getPlanKeysSortedByNumberOfFinalizedResultSummaries()
getPlanKeysSortedByNumberOfFinalizedResultSummaries
in interface BuildResultsSummaryDao
@Nullable public @Nullable Long calculateQueueDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDao
calculateQueueDuration
in interface BuildResultsSummaryDao
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
records@Nullable public @Nullable Long calculateVcsUpdateDuration(@NotNull @NotNull ChainResultsSummary resultsSummary)
BuildResultsSummaryDao
calculateVcsUpdateDuration
in interface BuildResultsSummaryDao
resultsSummary
- ChainResultsSummary
for which calculation has to be madeBuildResultsSummary
recordspublic void setResultsSummaryDiscriminatorRegistry(ResultsSummaryDiscriminatorRegistry resultsSummaryDiscriminatorRegistry)
public void setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
public List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
findAllBuildResultsNumbers
in interface BuildResultsSummaryDao
@NotNull public @NotNull Range<Integer> findBuildResultsNumberRange(PlanKey planKey)
BuildResultsSummaryDao
findBuildResultsNumberRange
in interface BuildResultsSummaryDao
@NotNull public @NotNull List<PlanResultKey> findChainResultsWithFormatVersionLessThan(int formatVersion, int maxResults)
findChainResultsWithFormatVersionLessThan
in interface BuildResultsSummaryDao
@NotNull public @NotNull Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
BuildResultsSummaryDao
findSpecsStatesIdsReferencedByBuildResultSummaries
in interface BuildResultsSummaryDao
public int findMinimumBuildNumberForNLatest(@NotNull @NotNull PlanKey planKey, int n)
BuildResultsSummaryDao
findMinimumBuildNumberForNLatest
in interface BuildResultsSummaryDao
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.