use of com.google.gerrit.reviewdb.client.RobotComment in project gerrit by GerritCodeReview.
the class CommentSender method appendComment.
/** No longer used except for Velocity. Remove this method when VTL support is removed. */
@Deprecated
private void appendComment(StringBuilder out, int contextLines, PatchFile currentFileData, Comment comment) {
if (comment instanceof RobotComment) {
RobotComment robotComment = (RobotComment) comment;
out.append("Robot Comment from ").append(robotComment.robotId).append(" (run ID ").append(robotComment.robotRunId).append("):\n");
}
if (comment.range != null) {
appendRangedComment(out, currentFileData, comment);
} else {
appendLineComment(out, contextLines, currentFileData, comment);
}
}
use of com.google.gerrit.reviewdb.client.RobotComment in project gerrit by GerritCodeReview.
the class RobotCommentNotes method onLoad.
@Override
protected void onLoad(LoadHandle handle) throws IOException, ConfigInvalidException {
metaId = handle.id();
if (metaId == null) {
loadDefaults();
return;
}
metaId = metaId.copy();
RevCommit tipCommit = handle.walk().parseCommit(metaId);
ObjectReader reader = handle.walk().getObjectReader();
revisionNoteMap = RevisionNoteMap.parseRobotComments(args.noteUtil, reader, NoteMap.read(reader, tipCommit));
ListMultimap<RevId, RobotComment> cs = MultimapBuilder.hashKeys().arrayListValues().build();
for (RobotCommentsRevisionNote rn : revisionNoteMap.revisionNotes.values()) {
for (RobotComment c : rn.getComments()) {
cs.put(new RevId(c.revId), c);
}
}
comments = ImmutableListMultimap.copyOf(cs);
}
use of com.google.gerrit.reviewdb.client.RobotComment in project gerrit by GerritCodeReview.
the class CommentsUtil method newRobotComment.
public RobotComment newRobotComment(ChangeContext ctx, String path, PatchSet.Id psId, short side, String message, String robotId, String robotRunId) {
RobotComment c = new RobotComment(new Comment.Key(ChangeUtil.messageUuid(), path, psId.get()), ctx.getUser().getAccountId(), ctx.getWhen(), side, message, serverId, robotId, robotRunId);
ctx.getUser().updateRealAccountId(c::setRealAuthor);
return c;
}
Aggregations