Interface PullRequestHome
-
public interface PullRequestHomePull Request Home Service SPI. Methods are detached from deprecated pull request specific methods from RepositoryService GitHubRepositoryService needs to implements this.- Author:
- wangc
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddComment(PullRequest pullRequest, String comment)Add a comment to the specifiedPullRequestobject, and propagate the changes to the remote repository.booleanaddLabel(PullRequest pullRequest, Label label)Attach a label to the specified pull request.voidapproveOnPullRequest(PullRequest pullRequest)Approve pull request.List<PullRequest>findReferencedPullRequests(PullRequest pullRequest)Find the referenced pull requests to the given pull request in this PullRequestHome.CommitStatusgetCommitStatus(PullRequest pullRequest)Retrieve the current CI status of the latest commit associated with a given pull request.List<Label>getLabels(PullRequest pullRequest)Retrieve all labels associated with the providedPullRequestobject.booleanremoveLabel(PullRequest pullRequest, Label label)Remove a label from the providedPullRequestobject.voidrequestChangesOnPullRequest(PullRequest pullRequest, String body)Request changes on pull request with comment.booleansetLabels(PullRequest pullRequest, List<Label> labels)Set the labels for thePullRequestobject.
-
-
-
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- thePullRequeston 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 specifiedPullRequestobject, and propagate the changes to the remote repository.- Parameters:
pullRequest- thePullRequeston which the comment will be made.comment- the newComment.- 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 providedPullRequestobject.- Parameters:
pullRequest- thePullRequestobject whose associated labels should be returned.- Returns:
- a list of all matching
Labelobjects, or an empty list if no pull request can be found.
-
setLabels
boolean setLabels(PullRequest pullRequest, List<Label> labels)
Set the labels for thePullRequestobject.- Parameters:
pullRequest- thePullRequestobject whose will be set.labels- theLabelapply to thePullRequest- 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- thePullRequestto 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 providedPullRequestobject.- Parameters:
pullRequest- thePullRequestwhose label will be removed.name- theLabelname 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- thePullRequestobject 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-
-
-