Skip to content
Permalink
Browse files
pr-bot: throw on unexpected jcheck issues
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Feb 11, 2020
1 parent b7fd5b6 commit 8a386afc926da0538b87be00ec86c00222ce4da2
Showing with 9 additions and 7 deletions.
  1. +9 −7 bots/pr/src/main/java/org/openjdk/skara/bots/pr/PullRequestCheckIssueVisitor.java
@@ -112,18 +112,19 @@ public void visit(TooFewReviewersIssue e) {

@Override
public void visit(InvalidReviewersIssue e) {
log.fine("ignored: invalid reviewers: " + e.invalid());
var invalid = String.join(", ", e.invalid());
throw new IllegalStateException("Invalid reviewers " + invalid);
}

@Override
public void visit(MergeMessageIssue e) {
var hex = e.commit().hash().abbreviate();
log.fine("ignored: " + hex + ": merge commits should only have commit message 'Merge'");
var message = String.join("\n", e.commit().message());
throw new IllegalStateException("Merge commit message is not " + e.expected() + ", but: " + message);
}

@Override
public void visit(HgTagCommitIssue e) {
log.fine("ignored: invalid tag commit");
throw new IllegalStateException("Hg tag commit issue - should not happen");
}

@Override
@@ -143,12 +144,12 @@ public void visit(CommitterEmailIssue issue) {

@Override
public void visit(AuthorNameIssue issue) {
log.fine("ignored: invalid author name");
throw new IllegalStateException("Invalid author name: " + issue.commit().author());
}

@Override
public void visit(AuthorEmailIssue issue) {
log.fine("ignored: invalid author email");
throw new IllegalStateException("Invalid author email: " + issue.commit().author());
}

@Override
@@ -186,7 +187,8 @@ public void visit(WhitespaceIssue e) {

@Override
public void visit(MessageIssue issue) {
log.fine("ignored: incorrectly formatted commit message");
var message = String.join("\n", issue.commit().message());
throw new IllegalStateException("Incorrectly formatted commit message: " + message);
}

@Override

0 comments on commit 8a386af

Please sign in to comment.