Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17379

dynamically join IRC channels defined in jobs

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ircbot-plugin
    • Labels:
    • Environment:
      IRC plugin 2.21
      Jenkins LTS 1.480.3
    • Similar Issues:

      Description

      Whenever a job specify an IRC channel that is not defined in the global configuration, the IRC bot is not able to send to that channel.

      Given a job like:

      <publishers>
      <hudson.plugins.ircbot.IrcPublisher>
      <targets>
      <hudson.plugins.im.GroupChatIMMessageTarget>
      <name>#wikimedia-test</name>
      <notificationOnly>false</notificationOnly>
      </hudson.plugins.im.GroupChatIMMessageTarget>
      </targets>
      <strategy>ALL</strategy>
      <notifyOnBuildStart>true</notifyOnBuildStart>
      <notifySuspects>false</notifySuspects>
      <notifyCulprits>false</notifyCulprits>
      <notifyFixers>false</notifyFixers>
      <notifyUpstreamCommitters>false</notifyUpstreamCommitters>
      <buildToChatNotifier class="hudson.plugins.im.build_notify.DefaultBuildToChatNotifier"/>
      <matrixMultiplier>ONLY_CONFIGURATIONS</matrixMultiplier>
      <channels/>
      </hudson.plugins.ircbot.IrcPublisher>
      </publishers>

      The resulting FINEST log for 'hudson.plugins.ircbot' gives out:

      Mar 27, 2013 12:09:14 PM hudson.plugins.ircbot.v2.PircListener onServerResponse
      WARNING: IRC server responded error 404 Message:
      mw-jenkinsbot #wikimedia-test :Cannot send to channel
      Mar 27, 2013 12:09:14 PM hudson.plugins.ircbot.v2.PircListener onServerResponse
      WARNING: IRC server responded error 404 Message:
      mw-jenkinsbot #wikimedia-test :Cannot send to channel

      There are several ways to solve this issue. Either:

      • in job configuration, only list the globally configured channels. Maybe using a list to pick from.
      • dynamically register channels on job save and make the bot join. Could be made an optional feature.

      Also, with the default login level, the plugin does not warn that it has not been able to send the notification. The console shows:

      Started by user hashar
      Building on master in workspace /var/lib/jenkins/jobs/Test - IRC notification/workspace
      IRC notifier plugin: Sending notification to: #wikimedia-test
      Finished: SUCCESS

      Which is a bit misleading.

        Attachments

          Activity

          Hide
          kutzi kutzi added a comment -

          I think, I'd prefer to only allow channels defined in the global config.
          Otherwise, we would need a lot of more config options (channel authentication data) per job.

          Show
          kutzi kutzi added a comment - I think, I'd prefer to only allow channels defined in the global config. Otherwise, we would need a lot of more config options (channel authentication data) per job.
          Hide
          kalamatee Nick Andrews added a comment -

          Our Jenkins server builds source for multiple projects - the current IRC setup is useless and relays ALL build output to ALL channels. This should be set-able on a per-job basis, and not forced globaly.

          Show
          kalamatee Nick Andrews added a comment - Our Jenkins server builds source for multiple projects - the current IRC setup is useless and relays ALL build output to ALL channels. This should be set-able on a per-job basis, and not forced globaly.
          Hide
          timp Tim Pizey added a comment -

          This is a problem for us too.

          We have many projects, many builds and quite a few teams.

          Each team is intensely disinterested in other teams builds, so subscribing to the top level channel is only of interest to the quality team.

          This is a BUG as the configuration in the individual projects leads you to believe that it should be possible to configure on a channel per project basis.

          Show
          timp Tim Pizey added a comment - This is a problem for us too. We have many projects, many builds and quite a few teams. Each team is intensely disinterested in other teams builds, so subscribing to the top level channel is only of interest to the quality team. This is a BUG as the configuration in the individual projects leads you to believe that it should be possible to configure on a channel per project basis.
          Hide
          dty Dean Yu added a comment -

          I just discovered this behavior on our instance.

          One suggestion is to have the global list be the list of possible channels to send notifications to, and allow individual jobs to specify a subset of those channels to notify. For compatibility with existing behavior, a new per job configuration could be added to allow for this ("Only notify to the following channels"), and the default would be the existing functionality of notifying all configured channels.

          Show
          dty Dean Yu added a comment - I just discovered this behavior on our instance. One suggestion is to have the global list be the list of possible channels to send notifications to, and allow individual jobs to specify a subset of those channels to notify. For compatibility with existing behavior, a new per job configuration could be added to allow for this ("Only notify to the following channels"), and the default would be the existing functionality of notifying all configured channels.
          Hide
          kutzi kutzi added a comment -

          I think it's reasonable to be able to specify the channels to notify per job.
          I also think that the basic configuration of the channels (especially authentication) should remain global.
          So defining the channels globally and then specifying per job, which channels should be notified, sounds like the way to go.

          Pull requests are welcome, as I'm currently not using the IRC plugin myself and so am unlikely to change this myself anytime soon.

          Show
          kutzi kutzi added a comment - I think it's reasonable to be able to specify the channels to notify per job. I also think that the basic configuration of the channels (especially authentication) should remain global. So defining the channels globally and then specifying per job, which channels should be notified, sounds like the way to go. Pull requests are welcome, as I'm currently not using the IRC plugin myself and so am unlikely to change this myself anytime soon.

            People

            • Assignee:
              kutzi kutzi
              Reporter:
              hashar Antoine Musso
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: