jenkinsci / hipchat-plugin

HipChat notification plugin for Jenkins
https://plugins.jenkins.io/hipchat/
54 stars 85 forks source link

"Build successful" not enabled using Job DSL plugin #64

Closed ryanerato closed 8 years ago

ryanerato commented 8 years ago

I'm using the Jobs DSL plugin ([https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin]) to generate many other jobs of ours. Following the documentation of that plugin ([https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.hipChat]) I want HipChat notifications enabled for successful, failed, and aborted builds. The latter two options are added and enabled, but the "successful" notification is added, but not enabled. I attached images from the config pages for both jobs (the generator and the generated). I haven't noticed anything in the logs that would indicated an issue, but I could've missed something.

screen shot 2016-01-15 at 2 10 36 pm

screen shot 2016-01-15 at 2 11 35 pm

aldaris commented 8 years ago

This is expected behavior. Firstly the Notify Room column is about whether the HipChat room should be notified (with a visible card and notification sound). Secondly by default only notifications that have non-green color associated will notify the room. I think you are running into this behavior because the config is now stored differently since the 1.0.0 release (previously there was no notify room option), so what is probably happennig is that this DSL plugin creates the config in the old format, and then this old-style config is converted into the new style config by the plugin, which for backwards compatibility reasons will follow the exact same logic when determining notification color and notify room fields based on the notification type.

I think you should ask the DSL plugin's maintainer to update the HipChat integration to work with the new configuration structure.

ryanerato commented 8 years ago

Interesting that it works for the other notification types I have specified, only "successful" doesn't work. The Job DSL wiki page merely linked to the HipChat Plugin page, so I assumed the plugin owner had to enable support for DSL, but that seems to not be the case.

Thanks for the quick response, I'll let the Job DSL team know, it seems they're still referencing a < 1.0 version of the HipChat plugin.

aldaris commented 8 years ago

It should be the same with Started notifications as well, in the previous version only those two were associated with green notification color (and those never triggered room notifications), see code