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

Missing space in IRC notifications

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Trivial
    • Resolution: Fixed
    • ircbot-plugin
    • Ubuntu, Jenkins 1.509.2, IRC plugin 2.23, instant-messaging plugin 1.28

    Description

      When a build fails, jenkins messages me privately on IRC to say

      Build app isSTILL FAILING: https://...

      ("app" is the project name, "STILL FAILING" is bold red).

      Note the missing space between "is" and the build status.

      Public notifications to the channel are also missing a space in front of the build status:

      Project app build #2129:STILL FAILING in 19 min: https://...

      Attachments

        Activity

          kutzi kutzi added a comment - - edited

          There's clearly a space after 'is', as you can confirm for yourself:
          https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/build_notify/BuildToChatNotifier.java#L66

          Have you confirmed that this is not some visual artifact or your IRC client - e.g. C&P the message into a Text editor to see if there's really no whitespace?

          kutzi kutzi added a comment - - edited There's clearly a space after 'is', as you can confirm for yourself: https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/build_notify/BuildToChatNotifier.java#L66 Have you confirmed that this is not some visual artifact or your IRC client - e.g. C&P the message into a Text editor to see if there's really no whitespace?

          This is very interesting! My IRC client is XChat-GNOME. The space is missing visually, it's missing in ~/.xchat2/xchatlogs/*.log file, and it's missing when I copy & paste the text.

          I'm also connecting to the IRC server through an IRC proxy (znc).

          I wonder if one of those components might be eating the space in front of the IRC color code. I'll report back after I've narrowed this down.

          mgedmin Marius Gedminas added a comment - This is very interesting! My IRC client is XChat-GNOME. The space is missing visually, it's missing in ~/.xchat2/xchatlogs/*.log file, and it's missing when I copy & paste the text. I'm also connecting to the IRC server through an IRC proxy (znc). I wonder if one of those components might be eating the space in front of the IRC color code. I'll report back after I've narrowed this down.

          I've ruled out znc and xchat. We're logging our dev channel with Supybot (that connects directly to the IRC server), and the IRC logs are also showing "Project app build #2131:STILL FAILING in 18 min: https://..." with no space in front of STILL FAILING.

          mgedmin Marius Gedminas added a comment - I've ruled out znc and xchat. We're logging our dev channel with Supybot (that connects directly to the IRC server), and the IRC logs are also showing "Project app build #2131:STILL FAILING in 18 min: https:// ..." with no space in front of STILL FAILING.
          mgedmin Marius Gedminas added a comment - I think this line might be accidentally eating the space: https://github.com/jenkinsci/ircbot-plugin/blob/master/src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java#L72

          I've created a pull request for this, but I'm not sure how to test it:
          https://github.com/jenkinsci/ircbot-plugin/pull/13

          I think I should be able to build an .hpi file and install it via https://jenkins.example.com/pluginManager/advanced? Only I'm not familiar with the Java build ecosystem. If you could give me some tips on what to do after cloning https://github.com/jenkinsci/ircbot-plugin, I'd appreciate it (I'm on Ubuntu 13.10).

          mgedmin Marius Gedminas added a comment - I've created a pull request for this, but I'm not sure how to test it: https://github.com/jenkinsci/ircbot-plugin/pull/13 I think I should be able to build an .hpi file and install it via https://jenkins.example.com/pluginManager/advanced? Only I'm not familiar with the Java build ecosystem. If you could give me some tips on what to do after cloning https://github.com/jenkinsci/ircbot-plugin , I'd appreciate it (I'm on Ubuntu 13.10).

          A coworker suggested that 'pom.xml' files are used by Maven, so `sudo apt-get install maven' followed by 'mvn' produced a target/ircbot.hpi, which I'm trying to test now.

          Unfortunately the plugin I built fails to connect to IRC with a non-specific

          Mar 27, 2014 1:57:40 PM WARNING hudson.plugins.ircbot.v2.IRCConnection connect
          Error connecting to irc: java.lang.NullPointerException

          BTW here's a screenshot of the bug: http://i.imgur.com/JKa4QQN.png. I'd hoped to mention it together with a screenshot for the fix, but see above

          mgedmin Marius Gedminas added a comment - A coworker suggested that 'pom.xml' files are used by Maven, so `sudo apt-get install maven' followed by 'mvn' produced a target/ircbot.hpi, which I'm trying to test now. Unfortunately the plugin I built fails to connect to IRC with a non-specific Mar 27, 2014 1:57:40 PM WARNING hudson.plugins.ircbot.v2.IRCConnection connect Error connecting to irc: java.lang.NullPointerException BTW here's a screenshot of the bug: http://i.imgur.com/JKa4QQN.png . I'd hoped to mention it together with a screenshot for the fix, but see above

          The CI bot built an .hpi of my pull request, and I tried it instead of the .hpi I built on my laptop:
          https://jenkins.ci.cloudbees.com/job/plugins/job/ircbot-plugin/27/

          It works! http://i.imgur.com/sJvY0dp.png

          mgedmin Marius Gedminas added a comment - The CI bot built an .hpi of my pull request, and I tried it instead of the .hpi I built on my laptop: https://jenkins.ci.cloudbees.com/job/plugins/job/ircbot-plugin/27/ It works! http://i.imgur.com/sJvY0dp.png

          Code changed in jenkins
          User: Marius Gedminas
          Path:
          src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java
          http://jenkins-ci.org/commit/ircbot-plugin/d9672576e9775e9c1962e55512edf2b98530f9d4
          Log:
          Don't drop the space in front of the build status

          Should fix https://issues.jenkins-ci.org/browse/JENKINS-22360

          (I haven't tested the fix yet.)

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marius Gedminas Path: src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java http://jenkins-ci.org/commit/ircbot-plugin/d9672576e9775e9c1962e55512edf2b98530f9d4 Log: Don't drop the space in front of the build status Should fix https://issues.jenkins-ci.org/browse/JENKINS-22360 (I haven't tested the fix yet.)

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java
          src/test/java/hudson/plugins/ircbot/v2/IRCColorizerTest.java
          http://jenkins-ci.org/commit/ircbot-plugin/abb2a3f84c120c89a22f7bcdd632031d32cfe68b
          Log:
          Test case for JENKINS-22360

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/plugins/ircbot/v2/IRCColorizer.java src/test/java/hudson/plugins/ircbot/v2/IRCColorizerTest.java http://jenkins-ci.org/commit/ircbot-plugin/abb2a3f84c120c89a22f7bcdd632031d32cfe68b Log: Test case for JENKINS-22360

          People

            kutzi kutzi
            mgedmin Marius Gedminas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: