Interface PlanBranchPullRequestService

All Known Implementing Classes:
PlanBranchPullRequestServiceImpl

@ExperimentalApi public interface PlanBranchPullRequestService
Service for managing relations between plan branches and pull requests.
Since:
6.0
See Also:
  • Method Details

    • findForChainBranch

      @NotNull @NotNull Optional<PlanBranchPullRequest> findForChainBranch(long branchId)
      Retrieves a PlanBranchPullRequest connection for the given plan branch by branch id. Only one VCS pull request may be associated with a plan branch.
      Parameters:
      branchId - id of the plan branch
      Returns:
      PlanBranchPullRequest if found
    • findForChainBranch

      @NotNull @NotNull Optional<PlanBranchPullRequest> findForChainBranch(@NotNull @NotNull PlanKey branchKey)
      Retrieves a PlanBranchPullRequest connection for the given plan branch by branch key. Only one VCS pull request may be associated with a plan branch.
      Parameters:
      branchKey - key of the plan branch
      Returns:
      PlanBranchPullRequest if found
    • 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
    • findForChain

      @NotNull @NotNull List<PlanBranchPullRequest> findForChain(long chainId)
      Retrieves a PlanBranchPullRequest connections for the given chain.
      Parameters:
      chainId - id of the top level plan
      Returns:
      a list of PlanBranchPullRequest
      Since:
      8.2.7
    • findForChainAndPullRequest

      @NotNull @NotNull Optional<PlanBranchPullRequest> findForChainAndPullRequest(@NotNull @NotNull PlanKey chainKey, 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.
      Parameters:
      chainKey - key of the top level plan
      pullRequestId - id of the VCS pull request
      Returns:
      PlanBranchPullRequest if found
    • findForPullRequest

      @NotNull @NotNull List<PlanBranchPullRequest> findForPullRequest(long pullRequestId)
      Retrieves all PlanBranchPullRequest connections for the given pull request by pull request database id. Multiple plan branches may be associated with a single pull request.
      Parameters:
      pullRequestId - id of the pull request
      Returns:
      a list of PlanBranchPullRequests
    • 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