[Ci-users] Gerrit trigger failing on ci.centos

Thu Sep 8 17:05:32 UTC 2016
Attila Darazs <adarazs at redhat.com>

On 09/07/2016 07:56 PM, Adriano Petrich wrote:
> Thanks Brian!
>
> On Wed, Sep 7, 2016 at 3:44 PM, Brian Stinson <brian at bstinson.com
> <mailto:brian at bstinson.com>> wrote:
>
>     On Sep 07 13:56, Adriano Petrich wrote:
>     > Hi folks
>     >
>     >  Retriggering a job or trying to trigger it from gerrit is not working
>     >
>     > I'm getting a NullPointerException on
>     >
>     > Caused by: java.lang.NullPointerException
>     >       at
>     com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerParameters.setOrCreateParameters(GerritTriggerParameters.java:447)
>     >       at
>     com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.createParameters(EventListener.java:263)
>     >       at
>     com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.EventListener.schedule(EventListener.java:188)
>     >       at
>     com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger.retriggerThisBuild(GerritTrigger.java:849)
>     >       at
>     com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.RetriggerAction.doIndex(RetriggerAction.java:148)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     >       at java.lang.reflect.Method.invoke(Method.java:606)
>     >       at
>     org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:320)
>     >       at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:163)
>     >       at
>     org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
>     >       at
>     org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:26)
>     >       at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
>     >
>     >
>     >
>     > It looks related to the gerrit plugin. and arrfab found this bug
>     > https://issues.jenkins-ci.org/browse/JENKINS-31198
>     <https://issues.jenkins-ci.org/browse/JENKINS-31198> but I'm not sure on
>     > what to do.
>     >
>     >
>     > Right now gating is broken because of this
>     >
>     > Cheers,
>     >
>     >   Adriano
>
>     Hi All,
>
>     If you use the Gerrit retrigger functionality, you can mitigate this by
>     running jjb over your specs or by opening the job config in the web
>     interface and hitting save. This is needed to pick up some new fields in
>     the job config that were added by plugin updates.
>
>     If you have any questions please let us know.

Hi Brian,

I have a question. :)

The "recheck" functionality is broken. This is not the same as 
"retrigger", we're looking for something in the comments like this:

>             trigger-on:
>                 - patchset-created-event
>                 - comment-added-contains-event:
>                     comment-contains-value:  '(?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*(recheck)'

from here[1].

i.e. when somebody writes 'recheck' as a comment the jobs should trigger 
and it doesn't happen. This might be because of the update?

I repushed the JJB changes a couple of times today, so that doesn't 
solve the issue. It does seem to trigger on patchset creation though.

When commenting "recheck" on this[2] for example, it should rerun this 
job[3] but nothing happens. This was working fine until recently and we 
didn't change the jenkins-job-builder package or the JJBs around this part.

Jenkins Job Builder version: 1.6.1

Do you see anything in the logs about this? Did something change around 
the Gerrit Trigger?

Best regards,
Attila

[1] 
https://github.com/rdo-infra/ci-config/blob/master/jenkins/jobs/tripleo-quickstart-triggers.yml#L98-L101
[2] https://review.openstack.org/#/c/364394/
[3] 
https://ci.centos.org/view/rdo/view/tripleo-gate/job/tripleo-quickstart-gate-master-delorean-quick-basic/