java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHIssue
org.kohsuke.github.GHPullRequest
- All Implemented Interfaces:
Reactable
,Refreshable
A pull request.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The status of auto merging a GHPullRequest.static enum
The enum MergeMethod.Nested classes/interfaces inherited from class org.kohsuke.github.GHIssue
GHIssue.PullRequest
-
Field Summary
Fields inherited from class org.kohsuke.github.GHIssue
assignee, assignees, body, closed_at, closed_by, comments, html_url, labels, locked, milestone, number, pull_request, state, state_reason, title, user
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Can maintainer modify boolean.Create review gh pull request review builder.Create gh pull request review comment builder.createReviewComment
(String body, String sha, String path, int position) Deprecated.int
Gets additions.protected String
Gets the api route.The status of auto merging a pull request.getBase()
This points to where the change should be pulled into, but I'm not really sure what exactly it means.int
Gets changed files.Gets the closed by.int
Gets the number of commits.int
Gets deletions.The diff file, like https://github.com/jenkinsci/jenkins/pull/100.diffgetHead()
The change that should be pulled.The URL of the patch file. like https://github.com/jenkinsci/jenkins/pull/100.patchIs this PR mergeable?.Gets mergeable state.See GitHub blog postGets merged at.Gets merged by.The URL of the patch file. like https://github.com/jenkinsci/jenkins/pull/100.patchGets the pull request.Gets requested reviewers.Gets requested teams.int
Gets review comments.boolean
isDraft()
Is draft boolean.boolean
isMerged()
Is merged boolean.Retrieves all the commits associated to this pull request.Retrieves all the files associated to this pull request.Obtains all the review comments associated with this pull request.Retrieves all the reviews associated to this pull request.void
Merge this pull request.void
Merge this pull request.void
merge
(String msg, String sha, GHPullRequest.MergeMethod method) Merge this pull request, using the specified merge method.void
refresh()
Repopulates this object.void
requestReviewers
(List<GHUser> reviewers) Request reviewers.void
requestTeamReviewers
(List<GHTeam> teams) Request team reviewers.setBaseBranch
(String newBaseBranch) Set the base branch on the pull request.void
Updates the branch.Methods inherited from class org.kohsuke.github.GHIssue
addAssignees, addAssignees, addLabels, addLabels, addLabels, assignTo, close, close, comment, createReaction, deleteReaction, getAssignee, getAssignees, getBody, getClosedAt, getComments, getCommentsCount, getHtmlUrl, getIssuesApiRoute, getLabels, getLogins, getMilestone, getNumber, getRepository, getState, getStateReason, getTitle, getUser, isLocked, isPullRequest, listComments, listEvents, listReactions, lock, queryComments, removeAssignees, removeAssignees, removeLabel, removeLabels, removeLabels, removeLabels, reopen, setAssignees, setAssignees, setBody, setLabels, setMilestone, setTitle, unlock
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.kohsuke.github.Refreshable
refresh
-
Constructor Details
-
GHPullRequest
public GHPullRequest()Create default GHPullRequest instance
-
-
Method Details
-
getApiRoute
Gets the api route.- Overrides:
getApiRoute
in classGHIssue
- Returns:
- the api route
-
getAutoMerge
The status of auto merging a pull request.- Returns:
- the GHPullRequest.AutoMerge or
null
if no auto merge is set.
-
getPatchUrl
The URL of the patch file. like https://github.com/jenkinsci/jenkins/pull/100.patch- Returns:
- the patch url
-
getIssueUrl
The URL of the patch file. like https://github.com/jenkinsci/jenkins/pull/100.patch- Returns:
- the issue url
-
getBase
This points to where the change should be pulled into, but I'm not really sure what exactly it means.- Returns:
- the base
-
getHead
The change that should be pulled. The tip of the commits to merge.- Returns:
- the head
-
getDiffUrl
The diff file, like https://github.com/jenkinsci/jenkins/pull/100.diff- Returns:
- the diff url
-
getMergedAt
Gets merged at.- Returns:
- the merged at
-
getClosedBy
Gets the closed by.- Overrides:
getClosedBy
in classGHIssue
- Returns:
- the closed by
-
getPullRequest
Gets the pull request.- Overrides:
getPullRequest
in classGHIssue
- Returns:
- the pull request
-
getMergedBy
Gets merged by.- Returns:
- the merged by
- Throws:
IOException
- the io exception
-
getReviewComments
Gets review comments.- Returns:
- the review comments
- Throws:
IOException
- the io exception
-
getAdditions
Gets additions.- Returns:
- the additions
- Throws:
IOException
- the io exception
-
getCommits
Gets the number of commits.- Returns:
- the number of commits
- Throws:
IOException
- the io exception
-
isMerged
Is merged boolean.- Returns:
- the boolean
- Throws:
IOException
- the io exception
-
canMaintainerModify
Can maintainer modify boolean.- Returns:
- the boolean
- Throws:
IOException
- the io exception
-
isDraft
Is draft boolean.- Returns:
- the boolean
- Throws:
IOException
- the io exception
-
getMergeable
Is this PR mergeable?.- Returns:
- null if the state has not been determined yet, for example when a PR is newly created. If this method is called on an instance whose mergeable state is not yet known, API call is made to retrieve the latest state.
- Throws:
IOException
- the io exception
-
getDeletions
Gets deletions.- Returns:
- the deletions
- Throws:
IOException
- the io exception
-
getMergeableState
Gets mergeable state.- Returns:
- the mergeable state
- Throws:
IOException
- the io exception
-
getChangedFiles
Gets changed files.- Returns:
- the changed files
- Throws:
IOException
- the io exception
-
getMergeCommitSha
See GitHub blog post- Returns:
- the merge commit sha
- Throws:
IOException
- the io exception
-
getRequestedReviewers
Gets requested reviewers.- Returns:
- the requested reviewers
- Throws:
IOException
- the io exception
-
getRequestedTeams
Gets requested teams.- Returns:
- the requested teams
- Throws:
IOException
- the io exception
-
refresh
Repopulates this object.- Specified by:
refresh
in interfaceRefreshable
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
listFiles
Retrieves all the files associated to this pull request. The paginated response returns 30 files per page by default.- Returns:
- the paged iterable
- See Also:
-
listReviews
Retrieves all the reviews associated to this pull request.- Returns:
- the paged iterable
-
listReviewComments
Obtains all the review comments associated with this pull request.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listCommits
Retrieves all the commits associated to this pull request.- Returns:
- the paged iterable
-
createReview
Create review gh pull request review builder.- Returns:
- the gh pull request review builder
-
createReviewComment
Create gh pull request review comment builder.- Returns:
- the gh pull request review comment builder.
-
createReviewComment
@Deprecated public GHPullRequestReviewComment createReviewComment(String body, String sha, String path, int position) throws IOException Deprecated.Create review comment gh pull request review comment.- Parameters:
body
- the bodysha
- the shapath
- the pathposition
- the position- Returns:
- the gh pull request review comment
- Throws:
IOException
- the io exception
-
requestReviewers
Request reviewers.- Parameters:
reviewers
- the reviewers- Throws:
IOException
- the io exception
-
requestTeamReviewers
Request team reviewers.- Parameters:
teams
- the teams- Throws:
IOException
- the io exception
-
setBaseBranch
Set the base branch on the pull request.- Parameters:
newBaseBranch
- the name of the new base branch- Returns:
- the updated pull request
- Throws:
IOException
- the io exception
-
updateBranch
Updates the branch. The same as pressing the button in the web GUI.- Throws:
IOException
- the io exception
-
merge
Merge this pull request.The equivalent of the big green "Merge pull request" button.
- Parameters:
msg
- Commit message. If null, the default one will be used.- Throws:
IOException
- the io exception
-
merge
Merge this pull request.The equivalent of the big green "Merge pull request" button.
- Parameters:
msg
- Commit message. If null, the default one will be used.sha
- SHA that pull request head must match to allow merge.- Throws:
IOException
- the io exception
-
merge
Merge this pull request, using the specified merge method.The equivalent of the big green "Merge pull request" button.
- Parameters:
msg
- Commit message. If null, the default one will be used.sha
- the shamethod
- SHA that pull request head must match to allow merge.- Throws:
IOException
- the io exception
-
createReviewComment()