Skip to content
Permalink
Browse files
147: Update the "Changes required" message
Reviewed-by: ehelin
  • Loading branch information
rwestberg committed Nov 5, 2019
1 parent 0e3e711 commit 0d73a1f81f2f6019eeede509fc951925785d6070
@@ -147,7 +147,7 @@ static String reviewCommentBody(String body, Review.Verdict verdict, String user
if (verdict == Review.Verdict.APPROVED) {
result.append("Approved");
} else {
result.append("Disapproved");
result.append("Changes requested");
}
result.append(" by ");
result.append(user);
@@ -341,7 +341,7 @@ void addReview(Review review) {
}

var userName = contributor != null ? contributor.username() : review.reviewer().userName() + "@" + censusInstance.namespace().name();
var userRole = contributor != null ? projectRole(contributor) : "none";
var userRole = contributor != null ? projectRole(contributor) : "no project role";
var replyBody = ArchiveMessages.reviewCommentBody(review.body().orElse(""), review.verdict(), userName, userRole);

addReplyCommon(parent, review.reviewer(), subject, replyBody, id);
@@ -1063,7 +1063,7 @@ void notifyReviewVerdicts(TestInfo testInfo) throws IOException {

// The archive should contain a note
Repository.materialize(archiveFolder.path(), archive.url(), "master");
assertEquals(1, archiveContainsCount(archiveFolder.path(), "Disapproved by "));
assertEquals(1, archiveContainsCount(archiveFolder.path(), "Changes requested by "));
assertEquals(1, archiveContainsCount(archiveFolder.path(), " by integrationreviewer1"));
if (author.forge().supportsReviewBody()) {
assertEquals(1, archiveContainsCount(archiveFolder.path(), "Reason 1"));
@@ -1091,7 +1091,7 @@ void notifyReviewVerdicts(TestInfo testInfo) throws IOException {

// The archive should contain another note
Repository.materialize(archiveFolder.path(), archive.url(), "master");
assertEquals(2, archiveContainsCount(archiveFolder.path(), "Disapproved by "));
assertEquals(2, archiveContainsCount(archiveFolder.path(), "Changes requested by "));
if (author.forge().supportsReviewBody()) {
assertEquals(1, archiveContainsCount(archiveFolder.path(), "Reason 3"));
}

0 comments on commit 0d73a1f

Please sign in to comment.