Interface BuildResultsSummaryDao

    • Method Detail

      • 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.
      • 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
      • 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).
      • 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
      • 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 ResultsSummaryList<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 ResultsSummaryList<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 ResultsSummaryList<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 ResultsSummaryList<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 ResultsSummaryList<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
      • 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