Interface PullRequestHome


  • public interface PullRequestHome
    Pull Request Home Service SPI. Methods are detached from deprecated pull request specific methods from RepositoryService GitHubRepositoryService needs to implements this.
    Author:
    wangc
    • Method Detail

      • findReferencedPullRequests

        List<PullRequest> findReferencedPullRequests​(PullRequest pullRequest)
        Find the referenced pull requests to the given pull request in this PullRequestHome. In order to locate all the PRs in all the repos use the aphrodite method.
        Parameters:
        pullRequest - the PullRequest on which referenced pull requests are being searched
        Returns:
        list of referenced pull requests.
        See Also:
        org.jboss.set.aphrodite.Aphrodite#findReferencedPullRequests(org.jboss.set.aphrodite.domain.PullRequest)
      • addComment

        boolean addComment​(PullRequest pullRequest,
                           String comment)
        Add a comment to the specified PullRequest object, and propagate the changes to the remote repository.
        Parameters:
        pullRequest - the PullRequest on which the comment will be made.
        comment - the new Comment.
        Returns:
        true if this comment is added as a result of the call
      • getLabels

        List<Label> getLabels​(PullRequest pullRequest)
        Retrieve all labels associated with the provided PullRequest object.
        Parameters:
        pullRequest - the PullRequest object whose associated labels should be returned.
        Returns:
        a list of all matching Label objects, or an empty list if no pull request can be found.
      • setLabels

        boolean setLabels​(PullRequest pullRequest,
                          List<Label> labels)
        Set the labels for the PullRequest object.
        Parameters:
        pullRequest - the PullRequest object whose will be set.
        labels - the Label apply to the PullRequest
        Returns:
        true if this label is set as a result of the call
      • addLabel

        boolean addLabel​(PullRequest pullRequest,
                         Label label)
        Attach a label to the specified pull request. Note the label must already exist at remote repository. If the specified label is already associated with the provided pull request then no further action is taken.
        Parameters:
        pullRequest - the PullRequest to which the label will be applied.
        labelName - the name of the label to be applied.
        Returns:
        true if this label is added as a result of the call
      • removeLabel

        boolean removeLabel​(PullRequest pullRequest,
                            Label label)
        Remove a label from the provided PullRequest object.
        Parameters:
        pullRequest - the PullRequest whose label will be removed.
        name - the Label name will be removed.
        Returns:
        true if a label was removed as a result of this call
      • getCommitStatus

        CommitStatus getCommitStatus​(PullRequest pullRequest)
        Retrieve the current CI status of the latest commit associated with a given pull request.
        Parameters:
        pullRequest - the PullRequest object whose status is to be queried
        Returns:
        the CI status of the latest commit associated with the given pull request
      • approveOnPullRequest

        void approveOnPullRequest​(PullRequest pullRequest)
        Approve pull request.
        Parameters:
        pullRequest -
      • requestChangesOnPullRequest

        void requestChangesOnPullRequest​(PullRequest pullRequest,
                                         String body)
        Request changes on pull request with comment.
        Parameters:
        pullRequest -
        body -