github-api icon indicating copy to clipboard operation
github-api copied to clipboard

GHPullRequestReviewComment.getLine() always returns -1

Open tsantalis opened this issue 6 months ago • 0 comments

Describe the bug GHPullRequestReviewComment.getLine() API does not return accurate value. As a matter of fact it always returns -1

To Reproduce Steps to reproduce the behavior: For the following PR review comment the line is 422 https://api.github.com/repos/JabRef/jabref/pulls/comments/2127829134

//PR URL: https://github.com/JabRef/jabref/pull/11845
GHRepository repository = ...;
GHPullRequest pullRequest = repository.getPullRequest(11845);
PagedIterable<GHPullRequestReview> reviews = pullRequest.listReviews();

for (GHPullRequestReview review : reviews) {
    PagedIterable<GHPullRequestReviewComment> comments = review.listReviewComments();
    for (GHPullRequestReviewComment comment : comments) {
        String path = comment.getPath();
        int lineNumber = comment.getLine();
    }
}

Expected behavior The line number for https://api.github.com/repos/JabRef/jabref/pulls/comments/2127829134 should be 422 instead of -1

Desktop (please complete the following information):

  • OS: iOS
  • Browser [Firefox]
  • Version [139]

Additional context Add any other context about the problem here.

tsantalis avatar Jun 09 '25 00:06 tsantalis