rameshthoomu
rameshthoomu

Reputation: 1274

gerrit-trigger is not triggering jenkins job based on the comment posted to patchset

Jenkins Version: 2.73.1 Gerrit-Trigger plug-in version: 2.27.1 Gerrit Version: 2.14.2

my scenario here is:

New patch set triggers job 1, job1 posts a message (build first) to that patch set, then job2 should be triggered by that comment, but job2 is not triggered for some reason. Below is the configuration of job 1 and job 2

Job 1 Configuration in Gerrit events:

enter image description here

Job 2 Configuration in Gerrit Trigger >> Trigger on enter image description here

After job 1 executed successfully, this should send a custom message (build first) to patch set and job 2 should trigger based on the message.

Job 2 is not triggering in this case. Don't know what wrong here.

Upvotes: 1

Views: 1697

Answers (2)

Andrew Geissler
Andrew Geissler

Reputation: 136

I ran into this issue recently with Jenkins 2.235.1 talking to gerrit 2.16.9

I found an option in Jenkins

  • Jenkins->Manage Jenkins->Gerrit Trigger
  • Edit Gerrit Instance
  • Click Advanced
  • Ensure "Trigger on all comments, even default users" is enabled

Not sure if this was added to address the issue documented here or not but it fixed my issue after enabling this and rebooting jenkins.

Upvotes: 0

zxiiro
zxiiro

Reputation: 102

This is not a complete solution as I believe there may be another way to reproduce the issue but we discovered that we can reproduce this issue if we enable the 3 checkboxes:

  • Build Current Patches Only
  • Abort new patch sets
  • Abort manual patch sets

By disabling these settings Jenkins will no longer abort old job builds if a newer patch is available but it will allow Gerrit Trigger to respond to it's own Gerrit Comments thus triggering additional builds.

We have another system we deployed that experiences this issue but even disabling those 3 checkboxes did not resolve it for that system. I feel like certain settings configurations may cause Gerrit Trigger to ignore it's own comments thus not allowing you to create a job that triggers another job by modifying the success/fail messages of the first job.

Upvotes: 1

Related Questions