Interface BuildResultsSummaryDao

All Superinterfaces:
BambooObjectDao<ResultsSummary>
All Known Implementing Classes:
BuildResultsSummaryHibernateDao

@Internal public interface BuildResultsSummaryDao extends BambooObjectDao<ResultsSummary>
  • Field Details

  • Method Details

    • getAllBuildResultSummariesInUnknownState

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInUnknownState(Class<T> aClass)
      Returns all the BuildResultsSummary in a BuildState.UNKNOWN state This will not return records marked for deletion.
      Returns:
      summaries
    • getAllPendingResultSummaries

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllPendingResultSummaries(Class<T> aClass)
      Returns all the ResultsSummary in a LifeCycleState.PENDING state with the given Class This will not return records marked for deletion.
      Returns:
      summaries
    • getAllQueuedResultSummaries

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> 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.
      Returns:
      summaries
    • getAllInProgressResultSummaries

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> 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.
      Returns:
      summaries
    • getAllActiveResultSummariesForPlan

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllActiveResultSummariesForPlan(PlanKey planKey, Class<T> aClass)
      Returns:
      summaries
    • getFinalizedResultSummariesForPlan

      @NotNull <T extends ResultsSummary> @NotNull List<T> 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. Result are sorted descending by build number.
      Type Parameters:
      T -
      Parameters:
      planKey -
      aClass -
      firstResult - - specifies the first result to be included in the list.
      maxResults - - specifies the length of the result; 0 for all results;
      Returns:
    • getNumberOfConcurrentlyRunningBuilds

      int getNumberOfConcurrentlyRunningBuilds(PlanKey planKey)
      Get the number of concurrently running builds for planKey
      Parameters:
      planKey -
      Returns:
    • getResultsSummaryId

      @Internal @Nullable @Nullable Long getResultsSummaryId(@NotNull @NotNull PlanResultKey planResultKey)
      Return ResultsSummary's database id. This method is intended for internal use (currently in importer)
      Parameters:
      planResultKey - plan result key of ResultsSummary to be found
      Returns:
      id of ResultsSummary or null if not found
    • getResultsSummary

      @Nullable <T extends ResultsSummary> T getResultsSummary(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass)
      Lookup ResultsSummary by PlanResultKey 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)
      Lookup ResultsSummary by PlanResultKey and expected type, all lazy initialized collections can be eagerly read
      Type Parameters:
      T -
      Parameters:
      planResultKey -
      aClass -
      dataRead -
      Returns:
      resultSummary
    • getAllBuildResultSummariesInBuildState

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInBuildState(@NotNull @NotNull BuildState state, Class<T> aClass)
      Returns all the BuildResultsSummary in requested build state. This will not return records marked for deletion.
      Parameters:
      state -
      aClass -
      Returns:
      summaries
    • getAllBuildResultSummariesInLifeCycleState

      @NotNull <T extends ResultsSummary> @NotNull Collection<T> getAllBuildResultSummariesInLifeCycleState(@NotNull @NotNull LifeCycleState state, Class<T> aClass)
      Returns all the BuildResultsSummary in requested lifecycle state. This will not return records marked for deletion.
    • getAllInProgressBuildResultSummaries

      @NotNull @NotNull Collection<BuildResultsSummary> getAllInProgressBuildResultSummaries()
      Returns all the BuildResultsSummary in a LifeCycleState.IN_PROGRESS state This will not return records marked for deletion.
      Returns:
      summaries
    • getFirstBuildSummary

      @Nullable @Nullable BuildResultsSummary getFirstBuildSummary(@NotNull @NotNull PlanKey planKey)
      Returns the first available BuildResultsSummary for the given PlanKey
      Parameters:
      planKey -
      Returns:
      buildResult
    • getLastResultSummary

      <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass)
      Returns the latest completed ResultsSummary and Class for the plan represented by planKey
      Parameters:
      planKey -
      aClass -
      Returns:
      buildResult
    • getLastResultSummary

      <T extends ResultsSummary> T getLastResultSummary(String planKey, Class<T> aClass, boolean ignoreSpecsResults)
      Returns the latest completed ResultsSummary and Class for the plan represented by planKey with possible skip of specs results.
      Parameters:
      planKey -
      aClass -
      ignoreSpecsResults -
      Returns:
      buildResult
    • getNumberOfFinishedResults

      long getNumberOfFinishedResults(Plan build)
      Returns the number of finished results available for the given Plan
      Parameters:
      build -
      Returns:
      numberOfResults
    • getNumberOfFinalizedResults

      long getNumberOfFinalizedResults(@NotNull @NotNull ImmutablePlan plan)
      Get number of the ResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan
      Parameters:
      plan -
      Returns:
      number of summaries
    • getNumberOfFinalizedResults

      long getNumberOfFinalizedResults(@NotNull @NotNull PlanKey planKey)
      Get number of the ResultsSummarys in a LifeCycleState.FINISHED or LifeCycleState.NOT_BUILT state for the given Plan
      Parameters:
      planKey -
      Returns:
      number of summaries
      Since:
      6.9
    • getNeighbouringSummaries

      @NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(Plan plan, int currentBuildNumber)
      Returns build results "around" given build number
      Parameters:
      plan -
      currentBuildNumber -
      Returns:
    • getNeighbouringSummaries

      @NotNull @NotNull List<ResultsSummary> getNeighbouringSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
      Returns build results "around" given build number.
      Parameters:
      plan - the plan to return results for
      buildNumber - the build number to search around
      maxCount - the maximum number of builds to return
      Returns:
      the results in ascending order. At most there will be maxCount items in the list, inclusive of the result for buildNumber (if present).
    • getBeforeSummaries

      @NotNull @NotNull List<ResultsSummary> getBeforeSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
      Returns build results strictly before given build number.
      Parameters:
      plan - the plan to return results for
      buildNumber - the build number to search before
      maxCount - the maximum number of builds to return
      Returns:
      the results in ascending order. At most there will be maxCount items in the list, exclusive of the result for buildNumber (if present).
    • getAfterSummaries

      @NotNull @NotNull List<ResultsSummary> getAfterSummaries(@NotNull @NotNull ImmutablePlan plan, int buildNumber, int maxCount)
      Returns build results strictly after given build number.
      Parameters:
      plan - the plan to return results for
      buildNumber - the build number to search after
      maxCount - the maximum number of builds to return
      Returns:
      the results in ascending order. At most there will be maxCount items in the list, exclusive of the result for buildNumber (if present).
    • getBreakingBuild

      @Nullable @Nullable ResultsSummary getBreakingBuild(ResultsSummary summary)
    • getFixingBuild

      @Nullable @Nullable ResultsSummary getFixingBuild(ResultsSummary summary)
      Returns the first successful BuildResultsSummary for given BuildResultsSummary. The input build is returned if it is successful.
      Parameters:
      summary -
      Returns:
      null if there is no fixing build.
    • findAnyResultSummary

      @Nullable <T extends ResultsSummary> T findAnyResultSummary(@NotNull @NotNull ResultsSummaryCriteria criteria, ResultDataRead dataRead)
      Searches for any ResultsSummary object given a ResultsSummaryCriteria. Note that if criteria does not specify order then result of this method might be non-deterministic.
      Parameters:
      criteria -
      Returns:
      List of BuildResultsSummary
    • findByCriteria

      @NotNull <T extends ResultsSummary> @NotNull List<T> findByCriteria(@NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
      Searches for any ResultsSummary object given a ResultSummarySearchCriteria.
      Since:
      8.2
    • findByJiraCriteria

      @NotNull <T extends ResultsSummary> @NotNull List<T> findByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass, @NotNull @NotNull ResultDataRead dataRead)
      Since:
      8.2
    • countByJiraCriteria

      <T extends ResultsSummary> Long countByJiraCriteria(@NotNull @NotNull ByJiraIssueResultSearchCriteria jiraCriteria, @NotNull @NotNull ResultSummarySearchCriteria criteria, @NotNull @NotNull Class<T> resultClass)
      Since:
      8.2
    • findResultsSummaries

      @NotNull <T extends ResultsSummary> @NotNull List<T> findResultsSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
      Searches for 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.
      Parameters:
      criteria -
      Returns:
      List of BuildResultsSummary
    • moveResultSummaries

      @Internal int moveResultSummaries(@NotNull @NotNull PlanKey oldPlanKey, @NotNull @NotNull PlanKey newPlanKey)
      Reassigns plan key ResultsSummaries associated with selected plan key.
      Parameters:
      oldPlanKey - the plan key to move from
      newPlanKey - the plan key to move to
      Returns:
      the number of result summaries updated
    • countResultSummaries

      long countResultSummaries(@NotNull @NotNull ResultsSummaryCriteria criteria)
      Count the number of ResultsSummary objects given a ResultsSummaryCriteria.
      Parameters:
      criteria -
      Returns:
      long representing the count of ResultsSummary that match the criteria.
    • findResultSummariesForExpiry

      @NotNull <T extends ResultsSummary> @NotNull List<T> findResultSummariesForExpiry(@NotNull @NotNull ExpiryCriteria criteria)
      Searches for ResultsSummary objects given a ExpiryCriteria.
      Type Parameters:
      T - type of result objects (determined according to given criteria)
      Parameters:
      criteria - search constraints
      Returns:
      List of ResultsSummary
    • findJobKeysFromExistingChainResults

      @NotNull @NotNull List<PlanKey> findJobKeysFromExistingChainResults(@NotNull @NotNull PlanKey chainKey)
      Find keys of jobs for which results associated with given plan exist. The jobs themselves might no longer exist.
      Since:
      6.9
    • removeResultsSummariesForPlan

      int removeResultsSummariesForPlan(@NotNull @NotNull PlanKey planKey)
      Remove all resultSummary objects for the given plan. Time-cost of this method might be significant if there are thousands of ResultsSummary objects to be deleted
      Parameters:
      planKey - identifier of plan to remove results for.
      Returns:
      number of deleted ResultsSummary objects
    • findPlanKeysFromAllOrphanedResultSummaries

      Iterable<PlanKey> findPlanKeysFromAllOrphanedResultSummaries()
      Scans database for all the ChainResultsSummary objects in the database that do not have a matching Chain
      Returns:
      list of distinct PlanKeys they reference
    • countBuildResultsSummaries

      int countBuildResultsSummaries(@NotNull @NotNull String planKey)
    • countBuildResultsSummaries

      int countBuildResultsSummaries()
      Count all result summaries records. This will not count records marked for deletion.
      Returns:
    • removeResultsSummary

      void removeResultsSummary(@NotNull @NotNull ResultsSummary buildResultsSummary)
      Removes the passed result summary
      Parameters:
      buildResultsSummary - -
    • findBuildResultsSummariesByJiraIssues

      @NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByJiraIssues(@Nullable @Nullable List<String> issueKeys)
      Get a list of results summaries associated with the list of issue keys. This will not return records marked for deletion.
      Parameters:
      issueKeys -
      Returns:
      list of result summaries
    • findBuildResultsSummariesByProjectKey

      @NotNull @NotNull List<ResultsSummary> findBuildResultsSummariesByProjectKey(@Nullable @Nullable String jiraProjectKey)
      Retrieve a list of results summaries associated with given JIRA project key This will not return records marked for deletion.
      Parameters:
      jiraProjectKey - - JIRA project key (prefix of the jira issues e.g. 'BAM')
      Returns:
      a list of results summaries associated with given JIRA project key
    • getJiraIssuesForBuildResults

      @NotNull @NotNull List<LinkedJiraIssue> getJiraIssuesForBuildResults(@NotNull @NotNull List<ResultsSummary> buildResults)
      Retrieves a list of LinkedJiraIssue linked to the given build result summaries
      Parameters:
      buildResults -
      Returns:
    • getJiraIssuesForPlanKey

      List<LinkedJiraIssue> getJiraIssuesForPlanKey(@NotNull @NotNull PlanKey planKey)
      Retrieves a list of LinkedJiraIssue that are linked to the given build.
      Parameters:
      planKey -
      Returns:
    • findBuildsForImageConfiguration

      @NotNull @NotNull List<BuildResultsSummary> findBuildsForImageConfiguration(String planKey, ElasticImageConfiguration elasticImageConfiguration, @Nullable @Nullable BuildState buildState, int maxResults)
      Searcher for builds of an image
      Parameters:
      planKey -
      elasticImageConfiguration -
      buildState -
      maxResults -
      Returns:
    • findLastBuildResultBeforeWithTests

      @Nullable <T extends ResultsSummary> T findLastBuildResultBeforeWithTests(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull Class<T> aClass, boolean includeOnceOffBuilds)
      Type Parameters:
      T - of result
      Parameters:
      planResultKey - of the result
      includeOnceOffBuilds - tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations
      aClass - of
      Returns:
      resultsSummary
    • findLastResultBefore

      @Nullable <T extends ResultsSummary> T findLastResultBefore(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass, boolean includeOnceOffBuilds)
      Finds the last successful or failed ResultsSummary before buildNumber
      Parameters:
      planKey -
      buildNumber -
      includeOnceOffBuilds - tells whether we also consider 'once-off' builds (the ones with custom revision) or should we skip them in our calculations
      Returns:
      buildResult
    • findFirstResultAfter

      @Nullable <T extends ResultsSummary> T findFirstResultAfter(@NotNull @NotNull String planKey, int buildNumber, Class<T> aClass)
      Finds the first successful or failed BuildResultsSummary after buildNumber
      Parameters:
      planKey -
      buildNumber -
      aClass -
      Returns:
      buildResult
    • findFirstBuildResultWithBuildStateAfter

      @Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateAfter(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState)
      Finds the last successful BuildResultsSummary after buildNumber
      Parameters:
      planKey -
      buildNumber -
      buildState -
      Returns:
      buildResult
    • findLastBuildResultWithBuildStateBefore

      ResultsSummary findLastBuildResultWithBuildStateBefore(@NotNull @NotNull String planKey, int buildNumber, @NotNull @NotNull BuildState buildState, boolean includeOnceOffBuilds)
      Finds the last BuildResultsSummary before buildNumber with BuildState
      Parameters:
      planKey -
      buildNumber -
      buildState -
      includeOnceOffBuilds -
      Returns:
      buildResult
    • findFirstBuildResultWithBuildStateBetween

      @Nullable @Nullable ResultsSummary findFirstBuildResultWithBuildStateBetween(@NotNull @NotNull String planKey, int lowerBuildNumber, int upperBuildNumber, @NotNull @NotNull BuildState buildState)
      Returns the first build that matches BuildState between the given build number range Note that this function is inclusive of the upper and lower bound
      Parameters:
      planKey -
      lowerBuildNumber -
      upperBuildNumber -
      buildState -
      Returns:
      buildResult
    • findFirstBuildNumberAfter

      @Nullable @Nullable Integer findFirstBuildNumberAfter(@NotNull @NotNull String planKey, int buildNumber)
      Returns the build number of next existing build results.
      Parameters:
      planKey -
      buildNumber -
      Returns:
      null if no build result summary with higher number exists
    • findLastBuildNumberBefore

      @Nullable @Nullable Integer findLastBuildNumberBefore(@NotNull @NotNull String planKey, int buildNumber)
      Returns the build number of previous existing build results.
      Parameters:
      planKey -
      buildNumber -
      Returns:
      null if no build result summary with lower number exists
    • findBuildResultsWithArtifacts

      List<Pair<ArtifactLink,BuildResultsSummary>> findBuildResultsWithArtifacts(String planKey)
      Find all build results which have matching artifacts. Sorted by buildNumber, ascending
      Parameters:
      planKey -
      Returns:
    • scrollResultSummaries

      long scrollResultSummaries(@NotNull @NotNull String buildKey, @NotNull @NotNull ResultDataRead resultDataRead, @NotNull @NotNull Consumer<ResultsSummary> consumer)
      Scroll through and execute function for each of ResultsSummary (Build and Chain) Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
      Parameters:
      buildKey - of the plan you want to scroll the result summaries for
      consumer - consumer to accept each of the BuildResultSummaries
      resultDataRead - if the data should be loaded lazy or eagerly
      Returns:
      number of traversed rows
    • getChainStageResultById

      @Nullable @Nullable ChainStageResult getChainStageResultById(long id)
      Returns a ChainStageResult by its id
      Returns:
      chainStageResult
    • getAllResultSummariesForPlan

      <T extends ResultsSummary> List<T> getAllResultSummariesForPlan(@NotNull @NotNull Plan plan)
      Get all the ResultsSummarys for the given Plan
      Type Parameters:
      T -
      Parameters:
      plan -
      Returns:
      summaries
    • getResultSummariesForPlan

      @NotNull <T extends ResultsSummary> @NotNull List<T> getResultSummariesForPlan(@NotNull @NotNull ImmutablePlan plan, int firstResult, int maxResults)
      Get the ResultsSummarys 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.
      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 the ResultsSummarys 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.
      Type Parameters:
      T -
      Parameters:
      plan -
      lifeCycleState -
      firstResult - specifies the first item to be return (0 base index). Negative values treated as 0.
      maxResults - specifies amount of the results to be returned. Value <= 0 returns everything.
      Returns:
      summaries
    • getResultSummariesByChangeSetId

      <T extends ResultsSummary> List<T> getResultSummariesByChangeSetId(@NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)

      Get a list of all build results containing a commit with the given changeset ID.

      Please note that a build result summary contains list of commits which were added in a given build (compared to a previous one). It means that a list of commits may be empty if there were no repository changes. A list of commits is also empty in case of a first build in a plan or a first build of a plan's branch. A build results summary may also contain no commits if no version control system was used.

      This will not return records marked for deletion.

      In case you need to find build results based on commit which was checked out into a build workspace, see the getResultSummariesByCheckoutChangesetId(String, Class).

      Parameters:
      changeSetId - of the commit
      discriminator - class of the ResultSummary interface required
      Returns:
      List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
    • getResultSummariesByCheckoutChangesetId

      <T extends ResultsSummary> List<T> getResultSummariesByCheckoutChangesetId(@NotNull @NotNull String changesetId, @NotNull @NotNull Class<T> discriminator)

      Get a list of all build results containing repositories checked out with the given changeset ID.

      A build may use one or more repositories, each checked out with a certain changeset. This method returns build results having exact changeset ID checked out (note that it does not search for intermediate commits between two changeset IDs).

      This will not return records marked for deletion.

      In case you need to find build results based on commits which were added in certain build (compared to a previous one), see the getResultSummariesByChangeSetId(String, Class).

      Parameters:
      changesetId - of the commit
      discriminator - class of the ResultSummary interface required
      Returns:
      List of ResultsSummary (ResultSummary as determined by discriminator) containing a repository which was checked out with a changesetId commit
    • getResultSummariesByChangeSetIdAndRepository

      <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIdAndRepository(long repositoryId, @NotNull @NotNull String changeSetId, @NotNull @NotNull Class<T> discriminator)
      Get a list of all build results containing a commit with the given changeset ID that are in the given repository. This will not return records marked for deletion.
      Type Parameters:
      T - extends ResultSummary
      Parameters:
      repositoryId - of the repository
      changeSetId - of the commit
      discriminator - class of the ResultSummary interface required
      Returns:
      List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the given changeSetId
      Since:
      5.7
    • getResultSummariesByChangeSetIds

      <T extends ResultsSummary> List<T> getResultSummariesByChangeSetIds(@NotNull @NotNull List<String> changeSetIds, @NotNull @NotNull Class<T> discriminator)
      Get a list of all build results containing a commit with any of the given changeset IDs. This will not return records marked for deletion.
      Parameters:
      changeSetIds - of the commits
      discriminator - class of the ResultSummary interface required
      Returns:
      List of ResultsSummary (ResultSummary as determined by discriminator) containing a commit with the any of the given changeSetIds
    • getParentResultSummary

      @Nullable @Nullable ChainResultsSummary getParentResultSummary(ResultsSummary summary)
      Get (@link ChainResultsSummary} containing given ResultsSummary
      Parameters:
      summary -
      Returns:
    • getStageForResult

      @Nullable @Nullable ChainStageResult getStageForResult(ResultsSummary resultsSummary)
      Get (@link ChainStageResult} containing given ResultsSummary
      Parameters:
      resultsSummary -
      Returns:
    • findLatestResultsSummaries

      List<ResultsSummary> findLatestResultsSummaries()
      Find the result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER
      Returns:
      list of latest results summaries
    • findLatestFailedResultSummaries

      List<ResultsSummary> findLatestFailedResultSummaries()
      Find the failed result summaries for all TopLevelPlans in Bamboo that have occurred in the last X days, where x is the constant NUMBER_OF_DAYS_TO_FILTER
      Returns:
      list of latest results summaries
    • findChainResultsWithJobLabelled

      List<ChainResultsSummary> findChainResultsWithJobLabelled(ResultsSummaryCriteria criteria, List<Label> labels)
      Searches through all chains to find any that have jobs which match the given labels. The list of chains is then filtered if required, using other criteria elements. Currently the only used criteria are:
      • buildKey
      • toBuildDate
      • toBuildNumber
      This is to ensure performance is consistent and reduce the possibility of conflicts.
      Parameters:
      criteria - containing the restrictions for the chains to be returned
      labels - that the jobs can be associated with
      Returns:
      list of ChainResultSummary that match the criteria and have jobs with any of the given labels
    • findLastResultSummaryWithState

      @Nullable <T extends ResultsSummary> T findLastResultSummaryWithState(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull BuildState buildState, @NotNull @NotNull Class<T> aClass)
      Type Parameters:
      T -
      Parameters:
      planKey -
      buildState -
      aClass -
      Returns:
      the last ResultsSummary with the provided BuildState
    • 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 provided BuildState
    • 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 analyse
      lowerBuildNumber - the build number to start the count with
      upperBuildNumber - the build number to end the count with
      buildState - the state that will be counted
      Returns:
      the count
    • scrollVariableSubstitutionForExport

      long scrollVariableSubstitutionForExport(@NotNull @NotNull Consumer<VariableSubstitution> consumer)
      Scroll through and execute function for each of VariableSubstitution Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
      Parameters:
      consumer - consumer to accept each of the VariableSubstitution
      Returns:
      number of traversed rows
    • markResultSummariesForDeletion

      int markResultSummariesForDeletion(@NotNull @NotNull PlanKey planKey)
      Mass update of all ResultsSummary records in the database related to a Plan identified by planKey.
      Parameters:
      planKey - key of a plan
      Returns:
      number of updated records
    • getPlanKeysSortedByNumberOfFinalizedResultSummaries

      @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

      List<Integer> findAllBuildResultsNumbers(PlanKey planKey)
    • findBuildResultsNumberRange

      @NotNull @NotNull Range<Integer> findBuildResultsNumberRange(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
    • findSpecsStatesIdsReferencedByBuildResultSummaries

      @NotNull @NotNull Set<Long> findSpecsStatesIdsReferencedByBuildResultSummaries()
      Finds all specs states ids that are referenced by any build result summary
    • 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
    • findByAuthors

      <T extends ResultsSummary> List<T> findByAuthors(@NotNull @NotNull Collection<ExtendedAuthor> authors, @NotNull @NotNull Class<T> resultClass, int maxResults)
      Since:
      8.2