Skip to content

Commit

Permalink
Merge pull request #302 from tyroneabdy/master
Browse files Browse the repository at this point in the history
[JENKINS-40059] CommentAdded trigger firing on every comment
  • Loading branch information
rsandell committed Apr 11, 2017
2 parents b0b2c86 + 0a8e1c2 commit a36413b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Expand Up @@ -1036,14 +1036,18 @@ private boolean isServerInteresting(GerritTriggeredEvent event) {
* Gerrit stream events changed to append approval info to
* every comment-added event.
**/
if (approval.isUpdated()
&& approval.getType().equals(
commentAdded.getVerdictCategory())
&& (approval.getValue().equals(
commentAdded.getCommentAddedTriggerApprovalValue())
|| ("+" + approval.getValue()).equals(
commentAdded.getCommentAddedTriggerApprovalValue()))) {
return true;
if (GerritVersionChecker.isCorrectVersion(
GerritVersionChecker.Feature.commentAlwaysApproval,
serverName)) {
if (approval.isUpdated()
&& approval.getType().equals(
commentAdded.getVerdictCategory())
&& (approval.getValue().equals(
commentAdded.getCommentAddedTriggerApprovalValue())
|| ("+" + approval.getValue()).equals(
commentAdded.getCommentAddedTriggerApprovalValue()))) {
return true;
}
} else {
if (approval.getType().equals(
commentAdded.getVerdictCategory())
Expand Down
Expand Up @@ -60,7 +60,13 @@ public static enum Feature {
/**
* Project created events, added in Gerrit 2.12.
*/
projectCreatedEvents("Project created events", "2.12");
projectCreatedEvents("Project created events", "2.12"),


/**
* Gerrit CommentAdded always contains approval information, added in Gerrit 2.13.
*/
commentAlwaysApproval("CommentAdded always contains approval", "2.13");

private final String displayName;
private final String version;
Expand Down

0 comments on commit a36413b

Please sign in to comment.