Interface PersonalBuildManager


  • public interface PersonalBuildManager
    Provides information about personal builds.
    • Method Detail

      • getModifications

        java.util.List<SVcsModification> getModifications​(long userId)
        Returns collection of SVcsModification modifications ran by the given user.
        Parameters:
        userId - specified user.
        Returns:
        all personal changes run by the user, resent first
        Since:
        5.0
      • getModification

        @Nullable
        SVcsModification getModification​(long changesId)
        Returns SVcsModification object for the personal modification with the given id.
        Parameters:
        changesId - personal change id.
        Returns:
        modification object for the personal change.
      • addRemoteRunToQueue

        @Nullable
        SQueuedBuild addRemoteRunToQueue​(@NotNull
                                         BuildType buildType,
                                         long changeListId,
                                         java.lang.String comment)
        Schedules configuration to run specified personal changes.
        Parameters:
        buildType - specified build configuration.
        changeListId - specified personal change id.
        comment - user comment.
        Returns:
        temporary created configuration id.
      • addRemoteRunToQueue

        @Nullable
        SQueuedBuild addRemoteRunToQueue​(@NotNull
                                         BuildType buildType,
                                         @NotNull
                                         BuildAgent agent,
                                         long changeListId,
                                         java.lang.String comment)
        Schedules configuration to run specified personal changes on specified agent.
        Parameters:
        buildType - specified build configuration.
        agent - specified agent.
        changeListId - specified personal change id.
        comment - user comment.
        Returns:
        temporary created configuration id.
      • publishChangeList

        @Deprecated
        long publishChangeList​(PersonalChangeInfo changeInfo,
                               java.io.InputStream input)
                        throws java.io.IOException
        Publishes personal changes.
        Parameters:
        changeInfo - personal changes information object.
        input - input stream containing personal changes.
        Returns:
        newly created personal change id.
        Throws:
        java.io.IOException - exception if the publishing process fails.
      • publishChangeList

        long publishChangeList​(PersonalChangeInfo changeInfo,
                               java.io.InputStream input,
                               PersonalChangeFormatType type)
                        throws java.io.IOException
        Publishes personal changes.
        Parameters:
        changeInfo - personal changes information object.
        input - input stream containing personal changes.
        type - type of patch format (binary of unified diff).
        Returns:
        newly created personal change id.
        Throws:
        java.io.IOException - exception if the publishing process fails.
      • findBuildPromotionsByChangesId

        @NotNull
        java.util.List<BuildPromotion> findBuildPromotionsByChangesId​(long id)
        Finds personal build promotions by change id.
        Parameters:
        id - specified change id.
        Returns:
        list of all personal build promotions, starting from oldest, ordering added since 2018.2.3
        Since:
        7.1
      • findBuildPromotionsByUserId

        @NotNull
        java.util.List<BuildPromotion> findBuildPromotionsByUserId​(long userId)
        Finds personal build promotions by user id.
        Parameters:
        userId - specified user id.
        Returns:
        list of all personal build promotions owned by specified user.
        Since:
        7.1
      • setPersonalChangeStatus

        void setPersonalChangeStatus​(long changeId,
                                     Status status)
        Changes personal change commit status (if the change was committed successfully).
        Parameters:
        changeId - specified change id.
        status - commit status.
      • getPersonalChangeInfo

        @Nullable
        PersonalChangeInfo getPersonalChangeInfo​(long id)
        returns information about personal change by the change id (the same as modification id)
        Parameters:
        id - personal change id
        Returns:
        data object containing information about personal change
      • schedulePersonalChangeForDeletion

        void schedulePersonalChangeForDeletion​(long changeId,
                                               User user)
        Schedules personal change for deletion. If some build is in queue or finished it will be deleted immediately. If build is being ran it cancel request will be sent to the agent. Change will be marked as scheduled for deletion and will be excluded from user changes.
        Parameters:
        changeId - specified change id.
        user - specified user. Only user who ran the change can delete it.
      • getContent

        byte[] getContent​(VcsModification modification,
                          VcsChangeInfo change)
                   throws VcsException
        Returns sent content of the specified file.
        Parameters:
        modification - specified personal modification.
        change - specified file change.
        Returns:
        file content.
        Throws:
        VcsException - throws exception if file content cannot be read.
      • applyAndGetContent

        byte[] applyAndGetContent​(byte[] originData,
                                  VcsModification modification,
                                  VcsChangeInfo change)
                           throws VcsException
        Returns applied patch from specified file on specified original data.
        Parameters:
        originData - original data which will be used as base for patch.
        modification - specified personal modification.
        change - specified file change.
        Returns:
        applied patch.
        Throws:
        VcsException - throws exception if file content cannot be read or patch cannot be applied.
      • getCurrentRepositoryContentForPersonallyChangedFile

        byte[] getCurrentRepositoryContentForPersonallyChangedFile​(VcsModification modification,
                                                                   java.lang.String fileName,
                                                                   SBuildType buildType)
                                                            throws VcsException,
                                                                   VcsFileNotFoundException
        Returns last vcs repository content of the file specified.
        Parameters:
        modification - specified modification.
        fileName - specified file relative name.
        buildType - specified configuration.
        Returns:
        file content from the repository.
        Throws:
        VcsException - throws exception if content cannot be loaded from the repository.
        VcsFileNotFoundException - if requested file does not exist in the repository.
      • getPersonalChangeRelativeFilePath

        java.lang.String getPersonalChangeRelativeFilePath​(java.lang.String original,
                                                           long startedBuildId)
        Returns relative personal change path mapped when personal patch was built to send it to an agent.
        Parameters:
        original - - original change full file path.
        startedBuildId - - build id when change was used.
        Returns:
        relative personal change path built for the specified build, null is change was not built yet.
      • isApplicable

        boolean isApplicable​(long personalChangeId,
                             @NotNull
                             java.util.List<VcsRootInstanceEntry> vcsRootEntries)
        Returns true if personal change files can be applied to VCS roots of the specified build configuration.
        Parameters:
        personalChangeId - personal change id
        vcsRootEntries - vcs root entries
        Returns:
        see above
      • isApplicable

        boolean isApplicable​(@NotNull
                             SBuildType buildType,
                             @NotNull
                             java.util.Collection<java.lang.String> personalChangeFilePaths,
                             boolean searchThroughDependencies)
        Returns true if personal change files can be applied to VCS roots of the specified build configuration.
        Parameters:
        buildType - build configuration
        personalChangeFilePaths - paths from the personal change
        searchThroughDependencies - whether to search through build configuration dependencies or not
        Returns:
        see above
      • isApplicable

        @Deprecated
        boolean isApplicable​(@NotNull
                             VcsRootInstanceEntry vcsRootEntry,
                             @NotNull
                             java.util.Collection<java.lang.String> personalChangeFilePaths)
        Deprecated.
        since 10.0, not used in TC code anymore
        Returns true if personal change files can be applied to specified VCS root entry.
        Parameters:
        vcsRootEntry - VCS root entry
        personalChangeFilePaths - paths to check
        Returns:
        see above
        Since:
        6.5
      • isRelated

        @Deprecated
        boolean isRelated​(@NotNull
                          VcsRootInstanceEntry vcsRootEntry,
                          @NotNull
                          java.util.Collection<java.lang.String> personalChangeFilePaths)
        Deprecated.
        since 10.0, not used in TC code anymore
        Returns true if files are related to specified VCS root entry. By another words returns true if files are applicable to specified VCS root entry or would be applicable if VCS root entry is less specific (has path "a/b" instead of "a/b/c").
        Parameters:
        vcsRootEntry - VCS root entry
        personalChangeFilePaths - paths to check
        Returns:
        see above
        Since:
        7.0
      • setDescription

        void setDescription​(long personalChangeId,
                            @NotNull
                            java.lang.String newDescription)
        Change description of the personal modification
        Parameters:
        personalChangeId - personal change id
        newDescription - must not be empty
        Since:
        10.0