use of com.google.startupos.tools.reviewer.job.sync.GithubPullRequestProtos.ReviewComment in project startup-os by google.
the class GithubWriter method createReviewComment.
public ReviewComment createReviewComment(long pullRequestNumber, ReviewComment reviewComment, PullRequest pullRequest) {
final String reviewerLink = reviewerUrl + pullRequest.getAssociatedReviewerDiff() + "/" + pullRequest.getRepo() + "/" + reviewComment.getPath();
ReviewComment githubComment = githubClient.createReviewComment(CreateReviewCommentRequest.newBuilder().setOwner(pullRequest.getOwner()).setRepo(pullRequest.getRepo()).setNumber(pullRequestNumber).setRequestData(CreateReviewCommentRequest.CreateReviewCommentRequestData.newBuilder().setBody(getReviewCommentContent(reviewComment, reviewerLink)).setCommitId(reviewComment.getCommitId()).setPath(reviewComment.getPath()).setPosition(reviewComment.getPosition()).build()).build()).getReviewComment();
log.atInfo().log("Review comment with id *%s* was CREATED on GitHub(owner: %s, name: %s, PR number: %s): %s", githubComment.getId(), pullRequest.getOwner(), pullRequest.getRepo(), pullRequestNumber, reviewComment);
return githubComment;
}
Aggregations