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

Gerrit Verified Commands ignored when RestAPI is enabled

    Details

    • Similar Issues:

      Description

      Took me a lot of time to figure it out... But it seems like the commands specified in "Gerrit Verified Commands" are ignored if RestAPI is enabled.

      The RestAPI has two functions:

      1. Event "Missed Events Playback" - I thought this is the only one.
      2. Review comments.

      If I read the code correctly, yhere is no way to distinguish between the two as far as I read the code:

      NotificationFactory::queueBuildStarted
      if (config.isUseRestApi() && event instanceof ChangeBasedEvent) {
      
      NotificationFactory::queueBuildCompleted
      if (config.isUseRestApi()
              && memoryImprint.getEvent() instanceof ChangeBasedEvent) 

       

      I guess there should be a switch in configuration if to use the "Verified Commands" via RestAPI or not, so that both "Missed Events Playback" and the "Verified Commands" can work.

      Currently I disabled the RestAPI as it is more important to have a custom command that sets a custom label.

        Attachments

          Activity

          Hide
          foot Renato Costallat added a comment -

          I had the same problem, I was searching everywhere to find why it was not voting when the build start as some users was bypassing the Jenkins check due to it's only voting in the end of the build, what takes some time and I can't enable the Gerrit default vote as some projects doesn't have a job on Jenkins to vote +1 if the build is okay.

          As soon as I found this ticket, I disabled the REST API and it started to vote on build start.

          Show
          foot Renato Costallat added a comment - I had the same problem, I was searching everywhere to find why it was not voting when the build start as some users was bypassing the Jenkins check due to it's only voting in the end of the build, what takes some time and I can't enable the Gerrit default vote as some projects doesn't have a job on Jenkins to vote +1 if the build is okay. As soon as I found this ticket, I disabled the REST API and it started to vote on build start.

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              alonbl Alon Bar-Lev
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: