Skip to content

Commit

Permalink
Set tag for review comments on REST
Browse files Browse the repository at this point in the history
This allows to filter out these messages on Gerrit 2.14 UI

[JENKINS-43904]
  • Loading branch information
orgads committed Jun 15, 2017
1 parent bf283c8 commit c6437c8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>com.sonymobile.tools.gerrit</groupId>
<artifactId>gerrit-events</artifactId>
<version>2.10.2</version>
<version>2.11.0</version>
<!-- New source is here: https://github.com/sonyxperiadev/gerrit-events -->
</dependency>
<dependency>
Expand Down
Expand Up @@ -116,7 +116,8 @@ protected ReviewInput createReview() {
}
}

return new ReviewInput(message, scoredLabels, commentedFiles).setNotify(notificationLevel);
return new ReviewInput(message, scoredLabels, commentedFiles).setNotify(notificationLevel)
.setTag(Constants.TAG_VALUE);
} finally {
SecurityContextHolder.setContext(old);
}
Expand Down
Expand Up @@ -78,7 +78,7 @@ protected ReviewInput createReview() {
if (trigger != null) {
notificationLevel = parameterExpander.getNotificationLevel(trigger);
}
return new ReviewInput(message).setNotify(notificationLevel);
return new ReviewInput(message).setNotify(notificationLevel).setTag(Constants.TAG_VALUE);
}

}
@@ -0,0 +1,36 @@
/*
* The MIT License
*
* Copyright 2013 Jyrki Puttonen. All rights reserved.
* Copyright 2013 Sony Mobile Communications AB. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.job.rest;

/**
* Constants for REST commands.
*/
final class Constants {
public static final String TAG_VALUE = "jenkins-gerrit-trigger";

/** Internal */
private Constants() {
}
}

0 comments on commit c6437c8

Please sign in to comment.