My job works well when the patchset is uploaded for first time. After that when a new patchset is again uploaded on the same gerrit change, it does not trigger again. I already tried the Trigger On Comment Added Contains Regular Expression. I have these Trigger On currently in the same job: Patchset Create Comment Added Contains Regular Expression
Asked
Active
Viewed 774 times
1 Answers
0
You just need to use "Patchset Created" on "Trigger on" item in the Gerrit Trigger configuration options:

Marcelo Ávila de Oliveira
- 19,950
- 3
- 39
- 50
-
Thanks Marcelo. I tried it but it works only for a new gerrit commit that is patchset 1 but not for the subsequent ones which are uploaded later on on the same gerrit. I currently have like this: http://imgur.com/a/qT8tV – SBH Apr 25 '17 at 19:01
-
Using "Patchset Created" you can remove the "Comment Added Contains Regular Expression" (I don't think this will solve your issue but it worth to try). Are you using any other configuration, like "Dynamic Trigger Configuration" or "File path"? – Marcelo Ávila de Oliveira Apr 25 '17 at 19:31
-
At first I didnt have the Comment Added Contains Regular Expression and only had the Patchset Created but was not working still and hence I added that. No, I have not checked the Dynamic Trigger box. I did check the box for This project is parameterized and have the string parameters GERRIT_REFSPEC and GERRIT_BRANCH. Also my Jenkins ver. 2.46.1 – SBH Apr 25 '17 at 22:05
-
Here: Jenkins 2.46.1 and gerrit-trigger 2.23.2 (I don't think this is an issue). When you said "only had the Patchset Created but was not working still" you mean: the first patchset was triggering but the second one not, right? Are you sure that you're pushing the second/third/... patchset correctly? – Marcelo Ávila de Oliveira Apr 26 '17 at 10:57
-
I do see in the gerrit page about the new patchset uploaded successfully. Also when manually querying the patches in the jenkins i could see all the patches and was able to trigger it. I am not owner of the gerrit repo. My comments are added to the gerrit page of build started, build successful etc but the verified bits are not being set and i am waiting to get the permissions. Can that be there reason because jenkins couldn't set the bit, next time it didnt trigger? I dont see any logs in the jenkins system log though. Thanks for helping out. – SBH Apr 26 '17 at 22:59
-
But the first Jenkins build (triggered by the first patchset) is finished, right? I mean: have you checked if the Jenkins build is not running? Because the second build (triggered by the second patchset) will not start if the first one is still running (BTW the gerrit-trigger has a configuration option for this). Actually I'm running out of options :-( – Marcelo Ávila de Oliveira Apr 27 '17 at 00:16
-
no it does complete. am sorry i cannot share too much details about the repo and structure because of the kind of place i work :-( – SBH Apr 27 '17 at 20:18