Skip to content

Commit

Permalink
Merge pull request #282 from osmocom/master
Browse files Browse the repository at this point in the history
HACK: Set Notify on the build started trigger as well
  • Loading branch information
rsandell committed May 9, 2016
2 parents d5fb995 + 2d1a57f commit 9971373
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -482,7 +482,7 @@ public Notify getHighestNotificationLevel(MemoryImprint memoryImprint, boolean o
* @param trigger the trigger.
* @return the level value.
*/
private Notify getNotificationLevel(GerritTrigger trigger) {
public Notify getNotificationLevel(GerritTrigger trigger) {
String level = trigger.getNotificationLevel();
if (level != null && level.length() > 0) {
return Notify.valueOf(level);
Expand Down
Expand Up @@ -29,6 +29,8 @@
import com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig;
import com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander;
import com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.model.BuildsStartedStats;
import com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger;
import com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify;
import com.sonymobile.tools.gerrit.gerritevents.dto.rest.ReviewInput;
import hudson.model.Run;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -70,7 +72,12 @@ public BuildStartedRestCommandJob(IGerritHudsonTriggerConfig config, Run build,
*/
protected ReviewInput createReview() {
String message = parameterExpander.getBuildStartedMessage(build, listener, event, stats);
return new ReviewInput(message);
Notify notificationLevel = Notify.ALL;
GerritTrigger trigger = GerritTrigger.getTrigger(build.getParent());
if (trigger != null) {
notificationLevel = parameterExpander.getNotificationLevel(trigger);
}
return new ReviewInput(message).setNotify(notificationLevel);
}

}

0 comments on commit 9971373

Please sign in to comment.