@@ -492,6 +492,16 @@ public boolean isMerged() throws IOException {
492492 return merged ;
493493 }
494494
495+ /**
496+ * Since a GHPullRequest is always a pull request, this method always returns true.
497+ *
498+ * @return true
499+ */
500+ @ Override
501+ public boolean isPullRequest () {
502+ return true ;
503+ }
504+
495505 /**
496506 * Retrieves all the commits associated to this pull request.
497507 *
@@ -520,7 +530,13 @@ public PagedIterable<GHPullRequestFileDetail> listFiles() {
520530 /**
521531 * Obtains all the review comments associated with this pull request.
522532 *
533+ * <p>
534+ * Unlike {@link GHPullRequestReview#listReviewComments()}, this method returns full
535+ * {@link GHPullRequestReviewComment} objects including line-related fields such as
536+ * {@link GHPullRequestReviewComment#getLine() line}, {@link GHPullRequestReviewComment#getSide() side}, etc.
537+ *
523538 * @return the paged iterable
539+ * @see GHPullRequestReview#listReviewComments()
524540 */
525541 public PagedIterable <GHPullRequestReviewComment > listReviewComments () {
526542 return root ().createRequest ()
@@ -539,6 +555,30 @@ public PagedIterable<GHPullRequestReview> listReviews() {
539555 .toIterable (GHPullRequestReview [].class , item -> item .wrapUp (this ));
540556 }
541557
558+ /**
559+ * Converts a draft pull request to ready for review.
560+ *
561+ * @throws IOException
562+ * the io exception
563+ * @throws IllegalStateException
564+ * if the pull request is not a draft
565+ */
566+ public void markReadyForReview () throws IOException {
567+ if (!draft ) {
568+ throw new IllegalStateException ("Pull request is not a draft" );
569+ }
570+
571+ StringBuilder inputBuilder = new StringBuilder ();
572+ addParameter (inputBuilder , "pullRequestId" , this .getNodeId ());
573+
574+ String graphqlBody = "mutation MarkReadyForReview { markPullRequestReadyForReview(input: {" + inputBuilder
575+ + "}) { pullRequest { id } } }" ;
576+
577+ root ().createGraphQLRequest (graphqlBody ).sendGraphQL ();
578+
579+ refresh ();
580+ }
581+
542582 /**
543583 * Merge this pull request.
544584 *
0 commit comments