Search in sources :

Example 6 with ReviewComment

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;
}
Also used : ReviewComment(com.google.startupos.tools.reviewer.job.sync.GithubPullRequestProtos.ReviewComment)

Aggregations

ReviewComment (com.google.startupos.tools.reviewer.job.sync.GithubPullRequestProtos.ReviewComment)6 IssueComment (com.google.startupos.tools.reviewer.job.sync.GithubPullRequestProtos.IssueComment)2 ImmutableList (com.google.common.collect.ImmutableList)1 GitRepo (com.google.startupos.common.repo.GitRepo)1 PullRequest (com.google.startupos.tools.reviewer.job.sync.GithubPullRequestProtos.PullRequest)1 Comment (com.google.startupos.tools.reviewer.local_server.service.Protos.Comment)1 Diff (com.google.startupos.tools.reviewer.local_server.service.Protos.Diff)1 Thread (com.google.startupos.tools.reviewer.local_server.service.Protos.Thread)1 ArrayList (java.util.ArrayList)1