Skip to content

Commit

Permalink
Merge branch 'master' into merge_job_started_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimilian authored Jul 3, 2017
2 parents 46fbe7c + 1b5a1e6 commit 1b0d3e2
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>com.sonyericsson.hudson.plugins.gerrit</groupId>
<artifactId>gerrit-trigger</artifactId>
<version>2.23.3-SNAPSHOT</version>
<version>2.24.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>Gerrit Trigger</name>
<description>Integrates with Gerrit code review.</description>
Expand Down 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public BuildStartedRestCommandJob(IGerritHudsonTriggerConfig config, List<Run> b
protected ReviewInput createReview() {
String message = parameterExpander.getBuildsStartedMessage(builds, listener, event, stats);
Notify notificationLevel = parameterExpander.getHighestNotificationLevel(builds, false);
return new ReviewInput(message).setNotify(notificationLevel);
return new ReviewInput(message).setNotify(notificationLevel).setTag(Constants.TAG_VALUE);
}

}
Original file line number Diff line number Diff line change
@@ -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() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private static List<GerritProject> readAndParseTriggerConfig(BufferedReader read
char operChar = oper.charAt(0);
CompareType type = CompareType.findByOperator(operChar);

logger.trace("==> item:({0}) oper:({1}) text:({2})", new Object[]{item, oper, text});
logger.trace("==> item:({}) oper:({}) text:({})", new Object[]{item, oper, text});

if (SHORTNAME_PROJECT.equals(item)) { // Project
// stash previous project to the list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,11 @@ public static GerritTrigger getTrigger(@Nullable Job project) {
*/
public void cancelTimer() {
if (gerritTriggerTimerTask != null) {
logger.trace("GerritTrigger.cancelTimer(): {0}", job.getName());
String name = "N/A";
if (job != null) {
name = job.getName();
}
logger.trace("GerritTrigger.cancelTimer(): {}", name);
gerritTriggerTimerTask.cancel();
gerritTriggerTimerTask = null;
}
Expand Down

0 comments on commit 1b0d3e2

Please sign in to comment.