Interface BuildHistoryEx

    • Method Detail

      • getHistoryByAgentType

        @NotNull
        List<SFinishedBuild> getHistoryByAgentType​(@NotNull
                                                   AgentType agent,
                                                   @Nullable
                                                   User user,
                                                   boolean includeCanceled)
        Returns the build history filtered by the agent type.
        Parameters:
        agent - the build agent type
        user - if set the result will contain only builds by user
        includeCanceled - if set the result will include calceled builds as well
        Returns:
        build history
        Since:
        5.1
      • getLastChangesBuild

        @Nullable
        SFinishedBuild getLastChangesBuild​(String buildTypeId)
        Returns last finished build with last changes in the specified configuration, excluding personal and canceled builds.
        Parameters:
        buildTypeId - specified configuration id.
        Returns:
        last finished build in the specified configuration or null if there are no finished builds.
      • getLastSuccessfulChangesBuild

        @Nullable
        SFinishedBuild getLastSuccessfulChangesBuild​(String buildTypeId)
        Returns last successfully finished build with last changes in the specified configuration, personal and canceled builds are not considered
        Parameters:
        buildTypeId - specified configuration id.
        Returns:
        last successfully finished build in the specified configuration (excluding personal) or null if there are no successfully finished builds.
      • createEntry

        void createEntry​(@NotNull
                         HistoryBuild build,
                         @NotNull
                         Date finishTime)
      • createEntryForNotStartedBuild

        void createEntryForNotStartedBuild​(@NotNull
                                           HistoryBuild build,
                                           @NotNull
                                           Date finishTime)
      • getLastEntryId

        long getLastEntryId​(boolean includeCanceled)
      • getEntriesBetween

        @NotNull
        List<SFinishedBuild> getEntriesBetween​(long from,
                                               long to,
                                               boolean includeCanceled)
      • clearCache

        void clearCache()
      • removeCachedEntry

        void removeCachedEntry​(long buildId)
        Removes a single cached build from builds history cache
        Parameters:
        buildId - build id
      • buildsRemoved

        void buildsRemoved​(@NotNull
                           String buildTypeId,
                           @NotNull
                           BuildTypeRemovedBuilds predicate)
        Accepts a build configuration id and a collection of removed finished builds ids. Cleans internal caches for builds in this collection.
      • createHistoryQueryRunner

        @NotNull
        HistoryQueryRunner createHistoryQueryRunner​(@Nullable
                                                    User user,
                                                    boolean includePersonalBuildsIfUserNotSpecified,
                                                    boolean includeCanceled,
                                                    boolean orderByChanges)
      • getTestHistory

        @Deprecated
        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      String buildTypeId,
                                      long userId,
                                      @Nullable
                                      String branchName)
        Deprecated.
        since 2020.2, see TestHistory
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        buildTypeId - required to set the build configuration for the test history
        userId - if > 0, includes personal builds of the given user
        branchName - if not null, returns only builds which match given branchName
        Returns:
        Test run objects for given test, recent builds go first
        See Also:
        TestHistory
      • getTestHistory

        @Deprecated
        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      SProject project,
                                      long userId,
                                      @Nullable
                                      String branchName)
        Deprecated.
        since 2020.2, see TestHistory
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        project - required to set the parent project, all returned test runs will belong to build configurations under this project and its subprojects
        userId - if > 0, includes personal builds of the given user
        branchName - if not null, returns only builds which match given branchName
        Returns:
        Test run objects for given test, recent builds go first
        See Also:
        TestHistory
      • getTestHistory

        @Deprecated
        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      String buildTypeId,
                                      Filter<STestRun> filter)
        Deprecated.
        since 2020.2, see TestHistory
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        buildTypeId - required to set the build configuration for the test history
        filter - additional filter for the returned test runs
        Returns:
        Test run objects for given test, recent builds go first
        See Also:
        TestHistory
      • getTestHistory

        @Deprecated
        @NotNull
        List<STestRun> getTestHistory​(long testNameId,
                                      @NotNull
                                      SProject project,
                                      Filter<STestRun> filter)
        Deprecated.
        since 2020.2, see TestHistory
        Order of the returned TestRuns is recent runs first, according to the starting order of the builds. Multiple test runs in the build are NOT wrapped into MultiRun class, i.e. each test run is returned independently
        Parameters:
        project - required to set the parent project, all returned test runs will belong to build configurations under this project and its subprojects
        filter - additional filter for the returned test runs
        Returns:
        Test run objects for given test, recent builds go first
        See Also:
        TestHistory
      • removeEntry

        boolean removeEntry​(long buildId,
                            @Nullable
                            String comment)
        Removes finished build from the history with specified reason.
        Parameters:
        buildId - build identifier of the finished build.
        comment - reason for audit why build is removed
        Returns:
        true if the build was successfully removed
      • getNumberOfBuildsInBuildType

        int getNumberOfBuildsInBuildType​(@NotNull
                                         SBuildType buildType)
        Return the number of all builds for this build configuration, including personal and canceled ones
        Since:
        2020.2
      • getNumberOfPinnedBuildsInBuildType

        int getNumberOfPinnedBuildsInBuildType​(@NotNull
                                               SBuildType buildType)
        Return the number of pinned builds for this build configuration
        Since:
        2020.2
      • getPinnedBuildsIds

        @NotNull
        Set<Long> getPinnedBuildsIds​(@NotNull
                                     Collection<Long> buildIds)
        Accepts a collection of build ids and returns those which are pinned.
        Parameters:
        buildIds -
        Returns:
        Since:
        2023.11
      • getBuildNumbers

        @NotNull
        Map<Long,​String> getBuildNumbers​(@NotNull
                                               Collection<Long> buildIds)
        Returns build numbers of the specified builds
        Parameters:
        buildIds -
        Returns:
        Since:
        2023.11