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

Comment Added event does not work

    XMLWordPrintable

Details

    Description

      We recently upgraded our jenkins server from version 2.28 to 2.30. Gerrit trigger(v2.22.0) on comments added Contains Regex does not seem to work ever since the upgrade. Other gerrit triggers seems to be working flawlessly.

      Attachments

        Activity

          fabo Fathi Boudra added a comment -

          Similar regression. Jobs used to work with 2.20.0 version. After upgrading to 2.22.0 version, it doesn't work anymore.

          fabo Fathi Boudra added a comment - Similar regression. Jobs used to work with 2.20.0 version. After upgrading to 2.22.0 version, it doesn't work anymore.
          ry Ry Jones added a comment -

          fabo this is our experience, as well. Rolling back to 2.20.0 causes the plugin to crash, and 2.22.0 is inop. I've tried adding regexes but they don't seem to fire

          ry Ry Jones added a comment - fabo this is our experience, as well. Rolling back to 2.20.0 causes the plugin to crash, and 2.22.0 is inop. I've tried adding regexes but they don't seem to fire
          fabo Fathi Boudra added a comment -

          yes, unfortunately, reverting to 2.20.0 has incompatibilities with JGit4: http://jenkins-ci.361315.n4.nabble.com/JGit-api-changed-Handling-removal-of-methods-from-an-underlying-API-td4822183.html

          you'll also need to revert to git-client/1.19.6 and git/2.4.4 as well.

          Moving forward, the proper fix is really to get comments-added event support fixed.

          rsandell any chance to get your opinion please?

          fabo Fathi Boudra added a comment - yes, unfortunately, reverting to 2.20.0 has incompatibilities with JGit4: http://jenkins-ci.361315.n4.nabble.com/JGit-api-changed-Handling-removal-of-methods-from-an-underlying-API-td4822183.html you'll also need to revert to git-client/1.19.6 and git/2.4.4 as well. Moving forward, the proper fix is really to get comments-added event support fixed. rsandell any chance to get your opinion please?
          afahd fahd arshad added a comment -

          Any update on this ? gerrit-trigger 2.22.0 version does not seem to work with Jenkins version 2.30

          afahd fahd arshad added a comment - Any update on this ? gerrit-trigger 2.22.0 version does not seem to work with Jenkins version 2.30

          I can confirm that  we see the same effect wiht a current gerrit-trigger: the comment-added-regex does not trigger new builds.

          pedersen Björn Pedersen added a comment - I can confirm that  we see the same effect wiht a current gerrit-trigger: the comment-added-regex does not trigger new builds.

          I did some debugging: events/PluginCommentAddedContainsEvent.java#match

          compiles the pattern without MULTILINE

          I added: logger.debug("input comment: '{}'", ca.getComment());
           in the match function:

          The incoming message is a multi line text:

           
          Mai 10, 2017 10:11:50 AM FEIN com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent match
          input comment: 'Patch Set 1:

          #recheck'
           
           

          I'll try to prepare a match with multiline added to the pattern.

          pedersen Björn Pedersen added a comment - I did some debugging: events/PluginCommentAddedContainsEvent.java#match compiles the pattern without MULTILINE I added: logger.debug("input comment: '{}'", ca.getComment());  in the match function: The incoming message is a multi line text:   Mai 10, 2017 10:11:50 AM FEIN com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent match input comment: 'Patch Set 1: #recheck'     I'll try to prepare a match with multiline added to the pattern.
          pedersen Björn Pedersen added a comment - https://github.com/jenkinsci/gerrit-trigger-plugin/pull/312

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/events/PluginCommentAddedContainsEvent.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/25b4597276f70fa22bbd1154c18c48b5798666ce
          Log:
          Merge pull request #312 from bpedersen2/39010

          JENKINS-39010 CommentAddedRegex: Input is a multiline message

          Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/31a31de744ec...25b4597276f7

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/events/PluginCommentAddedContainsEvent.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/25b4597276f70fa22bbd1154c18c48b5798666ce Log: Merge pull request #312 from bpedersen2/39010 JENKINS-39010 CommentAddedRegex: Input is a multiline message Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/31a31de744ec...25b4597276f7
          d3viation Komail Kanjee added a comment - - edited

          Is this issue resolved? Trying with this regular expression but its not triggering the job: 

          (?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*(recheck)
          
          d3viation Komail Kanjee added a comment - - edited Is this issue resolved? Trying with this regular expression but its not triggering the job:  (?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*(recheck)
          ry Ry Jones added a comment - - edited

          This is still an issue in Jenkins 2.89.4, gerrit-trigger-plugin 2.27.5. Specifically:

          Job 0 triggers on new patchset, leaves a comment "DO BUILD 1" in gerrit when it completes.

          Job 1 triggers on comment regex of "DO BUILD 1". Does not trigger, even though comment appears in Gerrit

          However: if a user manually places a comment "DO BUILD 1" on patchset, Job 1 is triggered correctly.

          see below

          ry Ry Jones added a comment - - edited This is still an issue in Jenkins 2.89.4, gerrit-trigger-plugin 2.27.5. Specifically: Job 0 triggers on new patchset, leaves a comment "DO BUILD 1" in gerrit when it completes. Job 1 triggers on comment regex of "DO BUILD 1". Does not trigger, even though comment appears in Gerrit However: if a user manually places a comment "DO BUILD 1" on patchset, Job 1 is triggered correctly. see below

          ry:

          I think this actually excpected behaviour: The plugin filters it's own  comments to avoid trigger-loops. 

          One solution: use the gerrit ssh cli to post the  review 'DO BUILD 1' with another account to force triggering, or just trigger the other job directly (there are different ways to do that in jenkins...)

          pedersen Björn Pedersen added a comment - ry : I think this actually excpected behaviour: The plugin filters it's own  comments to avoid trigger-loops.  One solution: use the gerrit ssh cli to post the  review 'DO BUILD 1' with another account to force triggering, or just trigger the other job directly (there are different ways to do that in jenkins...)
          ry Ry Jones added a comment -

          pedersen you are correct. What we did to work around this is change the email address the plugin uses to post comments.

          ry Ry Jones added a comment - pedersen you are correct. What we did to work around this is change the email address the plugin uses to post comments.

          People

            rsandell rsandell
            afahd fahd arshad
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: