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

IRC plugin: custom post-build message

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It would be very useful if the message could be customized like:

      "${job.name} run ${build.number} for ${build.name} - ${build.result} ${build.result.tests.failed.count.asString} ${build.git.pr.url}"
      

      would result in

      windup-pr-builder run #1656: for "PR #924: Fixed some mistaked in the ..." - FAILED 6 tests https://github.com/windup/windup/pull/925

        Attachments

          Issue Links

            Activity

            Show
            ozizka ozizka added a comment - https://github.com/hudson3-plugins/instant-messaging-plugin/blob/master/src/main/resources/hudson/plugins/im/build_notify/Messages.properties
            Hide
            ozizka ozizka added a comment -

            It seems this was fixed in 2011 by https://github.com/jenkinsci/instant-messaging-plugin/commit/8241564a92d342259ae4c95b1467b45998fb0188
            but for some reason, we are still getting
            (15:58:08) windup-jenkins: Yippee, build fixed!
            (15:58:08) windup-jenkins: Project windup-pr-builder build #1707: FIXED in 33 min: http://wonka.mw.lab.eng.bos.redhat.com/jenkins/job/windup-pr-builder/1707/

            Show
            ozizka ozizka added a comment - It seems this was fixed in 2011 by https://github.com/jenkinsci/instant-messaging-plugin/commit/8241564a92d342259ae4c95b1467b45998fb0188 but for some reason, we are still getting (15:58:08) windup-jenkins: Yippee, build fixed! (15:58:08) windup-jenkins: Project windup-pr-builder build #1707: FIXED in 33 min: http://wonka.mw.lab.eng.bos.redhat.com/jenkins/job/windup-pr-builder/1707/
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            Is there a way to disable the "Yippee, build fixed" message completely? It drives me crazy to see so much spam as the real info is in the next line.

            Show
            ssbarnea Sorin Sbarnea added a comment - Is there a way to disable the "Yippee, build fixed" message completely? It drives me crazy to see so much spam as the real info is in the next line.
            Hide
            jimklimov Jim Klimov added a comment -

            I don't think there is currently a way to disable that line, but it could be an option (literally, adding a configuration knob). PRs welcome

            According to `git grep` in the current instant-messaging-plugin master sources, there are two "Yippee" lines:

            • `src/main/resources/hudson/plugins/im/build_notify/Messages.properties`: `SummaryOnlyBuildToChatNotifier.BuildIsFixed=Yippee, build fixed!\n` – this is a text resource leading to its usage in src/main/java/hudson/plugins/im/build_notify/SummaryOnlyBuildToChatNotifier.java
            • a verbatim line in src/main/java/hudson/plugins/im/build_notify/BuildToChatNotifier.java apparently for a message to developer who contributed to fixing a job's state since the last (failed) run

            In any case, there are several sides to the original problem (custom format strings effectively) and to Yippee's : there can be a text resource change that is relatively easy to convey at run-time through configurable instant-messaging-plugin options (global or in the job, and maybe have to be exposed in protocol plugins like ircbot), and a logical change (passing needed Java values instead of the placeholders configured in the format string, enabling or disabling Yippee's optionally) that has to be coded, compiled and distributed.

            Show
            jimklimov Jim Klimov added a comment - I don't think there is currently a way to disable that line, but it could be an option (literally, adding a configuration knob). PRs welcome According to `git grep` in the current instant-messaging-plugin master sources, there are two "Yippee" lines: `src/main/resources/hudson/plugins/im/build_notify/Messages.properties`: `SummaryOnlyBuildToChatNotifier.BuildIsFixed=Yippee, build fixed!\n` – this is a text resource leading to its usage in src/main/java/hudson/plugins/im/build_notify/SummaryOnlyBuildToChatNotifier.java a verbatim line in src/main/java/hudson/plugins/im/build_notify/BuildToChatNotifier.java apparently for a message to developer who contributed to fixing a job's state since the last (failed) run In any case, there are several sides to the original problem (custom format strings effectively) and to Yippee's : there can be a text resource change that is relatively easy to convey at run-time through configurable instant-messaging-plugin options (global or in the job, and maybe have to be exposed in protocol plugins like ircbot), and a logical change (passing needed Java values instead of the placeholders configured in the format string, enabling or disabling Yippee's optionally) that has to be coded, compiled and distributed.
            Hide
            jimklimov Jim Klimov added a comment -

            In this month's release of the two plugins, there are a couple of features that can help:

            • adding an "extra message" that should work in the legacy and pipeline invocations, which is a string you can provide and will be attached to the standard build starting/completed notifications. Your job could generate it somehow (easier in a scripted pipeline). Not sure if it supports groovy variable expansion like many other plugins do, but I'd assume that is relatively easy to research and implement if needed. This might be flexible enough for passing the extra data.
            • more for the pipeline context, calling `ircNotify customMessage:"Some text"` should just post that message verbatim (which again you can create in the pipeline) at that point in execution
            Show
            jimklimov Jim Klimov added a comment - In this month's release of the two plugins, there are a couple of features that can help: adding an "extra message" that should work in the legacy and pipeline invocations, which is a string you can provide and will be attached to the standard build starting/completed notifications. Your job could generate it somehow (easier in a scripted pipeline). Not sure if it supports groovy variable expansion like many other plugins do, but I'd assume that is relatively easy to research and implement if needed. This might be flexible enough for passing the extra data. more for the pipeline context, calling `ircNotify customMessage:"Some text"` should just post that message verbatim (which again you can create in the pipeline) at that point in execution

              People

              Assignee:
              kutzi kutzi
              Reporter:
              ozizka ozizka
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: