-
Improvement
-
Resolution: Unresolved
-
Major
-
jenkins-2.73.2
gerrit-trigger-2.26.1
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:
- Event "Missed Events Playback" - I thought this is the only one.
- 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.
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.