Interface PlanBranchPullRequestService

    • Method Detail

      • findForChainAndPullRequest

        @NotNull
        @NotNull Optional<PlanBranchPullRequest> findForChainAndPullRequest​(long chainId,
                                                                            long pullRequestId)
        Retrieves a PlanBranchPullRequest connection for the given chain and pull request. Should yield only one result, since a single pull requests should only create a single plan branch per plan. In clustered mode, there is NO consistency guarantee.
        Parameters:
        chainId - id of the top level plan
        pullRequestId - id of the VCS pull request
        Returns:
        PlanBranchPullRequest if found
      • findForChainAndPullRequestWithConsistencyGuarantee

        @NotNull
        @NotNull Optional<PlanBranchPullRequest> findForChainAndPullRequestWithConsistencyGuarantee​(long chainId,
                                                                                                    long pullRequestId)
        Retrieves a PlanBranchPullRequest connection for the given chain and pull request. Should yield only one result, since a single pull requests should only create a single plan branch per plan. There is a guarantee that the data will be up-to-date.
        Parameters:
        chainId - id of the top level plan
        pullRequestId - id of the VCS pull request
        Returns:
        PlanBranchPullRequest if found
        Since:
        9.4
      • create

        @NotNull
        @NotNull PlanBranchPullRequest create​(@NotNull
                                              @NotNull PlanKey branchKey,
                                              long pullRequestId)
        Creates a new link between chain branch and pull request.
        Parameters:
        branchKey - key of the chain branch to link
        pullRequestId - id of the pull request to link
        Returns:
        newly created link between chain branch and pull request
        Throws:
        IllegalStateException - if any pull request is already linked to the given plan branch
      • create

        @NotNull
        @NotNull PlanBranchPullRequest create​(@NotNull
                                              @NotNull ChainBranch chainBranch,
                                              @NotNull
                                              @NotNull MutableVcsPullRequest vcsPullRequest)
        Creates a new link between chain branch and pull request.
        Parameters:
        chainBranch - chain branch to link
        vcsPullRequest - pull request to link
        Returns:
        newly created link between chain branch and pull request
        Throws:
        IllegalStateException - if any pull request is already linked to the given plan branch
      • deleteForChainBranch

        boolean deleteForChainBranch​(long branchId)
        Deletes a link for the given plan branch.
        Parameters:
        branchId - id of the plan branch
        Returns:
        true if a link was found and deleted, false otherwise
      • deleteForChainBranch

        boolean deleteForChainBranch​(@NotNull
                                     @NotNull PlanKey branchKey)
        Deletes a link for the given plan branch.
        Parameters:
        branchKey - key of the plan branch
        Returns:
        true if a link was found and deleted, false otherwise
      • deleteForVcsPullRequest

        int deleteForVcsPullRequest​(long pullRequestId)
        Deletes all links for the given pull request.
        Parameters:
        pullRequestId - id of the vcs pull request
        Returns:
        number of deleted links, 0 if none were found