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

Comment no longer triggers jenkins job in Gerrit 3.7.0

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • gerrit-trigger-plugin
    • None
    • Jenkins 2.361.4
      gerrit trigger plugin 2.37.0
      Gerrit 3.7.0

      I use comments in Gerrit to trigger jenkins jobs in my setup. This used to work well in the past with a few Jenkins/Gerrit/Gerrit-trigger combinations of different versions. The last good combination I used was:

      COMBO1: Jenkins 2.361.3 + Gerrit trigger 2.36.1 + Gerrit 3.6.1

      Recently I upgraded to:

      COMBO2: Jenkins 2.361.4 + Gerrit-trigger 2.37.0 + Gerrit 3.7.0

      Suddenly Gerrit comments are no longer able to trigger Jenkins jobs. At first I thought it's some problem in the plugin or Jenkins so I reverted them to the last version, as below:

      COMBO3: Jenkins 2.361.3 + Gerrit-trigger 2.36.1 + Gerrit 3.7.0

      But it still doesn't work. So I suspect it was Gerrit 3.7.0 caused the problem, or is not compatible with the trigger plugin. However upgrading Gerrit from 3.6 to 3.7 involved DB scheme changes so I didn't figure out a way to downgrade Gerrit yet.

      I also tried `ssh $user@$gerrit-server gerrit stream-event` command with Gerrit 3.7.0, I did see Gerrit emitting events with type of "comment-added", but the plugin on Jenkins side made no reaction at all. That's why I suspect there is some compatibility problem between this plugin and Gerrit 3.7.0.

      BTW, jobs are still able to be triggered by "patchset-created" event without problem, with COMBO2, or 1 or 3.

          [JENKINS-70123] Comment no longer triggers jenkins job in Gerrit 3.7.0

          Kai added a comment -

          It seems I was wrong... I managed to downgrade Gerrit from 3.7.0 to 3.6.3 with the help from Gerrit team. However, it still doesn't work to trigger Jenkins job from Gerrit comment.

          Any clue here? Or any instructions on how to further debug this issue, like logs, diagnostic commands etc.?

          Kai added a comment - It seems I was wrong... I managed to downgrade Gerrit from 3.7.0 to 3.6.3 with the help from Gerrit team. However, it still doesn't work to trigger Jenkins job from Gerrit comment. Any clue here? Or any instructions on how to further debug this issue, like logs, diagnostic commands etc.?

          ckreisl added a comment - - edited

          Hi kailiu, checked it in my debug environment and noticed that the comment does not contain the value anymore.

          Test instance:
          Gerrit Code Review (3.7.0)
          Jenkins 2.346.3

          Right now the retrieved JSON looks like this

          "comment" -> "Patch Set 7:\n\n(1 comment)"

          The real comment is nested now and the JSON seems to not provide these information anymore.
          So we need to check how the command data is retrieved from the event stream.
          We might need to query these information now in addition from Gerrit.

          There are additional breaking changes, see:
          https://www.gerritcodereview.com/3.7.html#breaking-changes

          And one related PR regarding commit messages:
          https://github.com/jenkinsci/gerrit-trigger-plugin/pull/480

          rsandell what kind of steps do you propose as maintainer to tackle this Gerrit version with the breaking changes?
          (In order to handle this version upgrade properly for the Gerrit Trigger plugin).

          ckreisl added a comment - - edited Hi kailiu , checked it in my debug environment and noticed that the comment does not contain the value anymore. Test instance: Gerrit Code Review (3.7.0) Jenkins 2.346.3 Right now the retrieved JSON looks like this "comment" -> "Patch Set 7:\n\n(1 comment)" The real comment is nested now and the JSON seems to not provide these information anymore. So we need to check how the command data is retrieved from the event stream. We might need to query these information now in addition from Gerrit. There are additional breaking changes, see: https://www.gerritcodereview.com/3.7.html#breaking-changes And one related PR regarding commit messages: https://github.com/jenkinsci/gerrit-trigger-plugin/pull/480 rsandell what kind of steps do you propose as maintainer to tackle this Gerrit version with the breaking changes? (In order to handle this version upgrade properly for the Gerrit Trigger plugin).

          Kai added a comment - - edited

          Thanks Christoph for your reply. I did some more tests and here are my findings:

          Gerrit 3.6.3:

          • Comment can trigger jobs if sending a new separated comment.
          • Comment can't trigger jobs if replying to a comment thread. However I'm not quite sure if this is because of the regex I used.

          Gerrit 3.7.0:

          • Doesn't work, as you have already found out.

          Kai added a comment - - edited Thanks Christoph for your reply. I did some more tests and here are my findings: Gerrit 3.6.3: Comment can trigger jobs if sending a new separated comment. Comment can't trigger jobs if replying to a comment thread. However I'm not quite sure if this is because of the regex I used. Gerrit 3.7.0: Doesn't work, as you have already found out.

          Mikko P added a comment -

          Hi kailiu !
          I reported the same problem on Gerrit forum side: https://groups.google.com/g/repo-discuss/c/k9tvgDxv8Lc

          Seems the problem was already known and fix should be coming to Gerrit 3.7.1.
          https://gerrit-review.googlesource.com/c/gerrit/+/353017

          Br. Mikko

          Mikko P added a comment - Hi kailiu ! I reported the same problem on Gerrit forum side: https://groups.google.com/g/repo-discuss/c/k9tvgDxv8Lc Seems the problem was already known and fix should be coming to Gerrit 3.7.1. https://gerrit-review.googlesource.com/c/gerrit/+/353017 Br. Mikko

          Kai added a comment -

          This is great news, thank you mip !

          Kai added a comment - This is great news, thank you mip !

            rsandell rsandell
            kailiu Kai
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: