jenkinsci / jenkinsci/gerrit-trigger-plugin

[JENKINS-57250] Gerrit trigger does not send results back to a correct server configuration

Open
#889 0 comments 0 reactions 0 assignees View on GitHub
component:gerrit-trigger-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
226
Forks
289
PR merge metrics
No merged PRs in 30d

Description

When having multiple server definitions for Gerrit trigger plugin under /gerrit-trigger/ that point to the same server, Gerrit trigger plugin only sends Successful results back to the first one for all jobs that may be configured to use different server instances. Different server instances can have different configuration, especially with the SSH interface in "Gerrit Verified Commands" and different jobs should be able to use these different server instances in the same Jenkins to submit their results.

How to replicate:



  • Install Gerrit Trigger plugin

  • Create a new server in /gerrit-trigger/ with the appropriate configuration.

  • Create another Gerrit server connection to the same server with different name but change for example build successful message to "gerrit review , --message 'Build Successful second-server '  ..."

  • (restart Jenkins)

  • Create a job that activates on Gerrit trigger event on the first server.

  • Create a job that activates on Gerrit trigger event on the second server.

  • Create a new patch set in Gerrit so that Gerrit trigger event activates.

This will then result in following 3 messages appearing in Gerrit:

```
Jussi Judin 14:55 Patch Set 5:
Build Started first-server http://localhost.localdomain:8090/job/gerrit-test-first/5/ (1/2)

```

 

 

```
Jussi Judin 14:55 Patch Set 5:
Build Started second-server http://localhost.localdomain:8090/job/gerrit-test-second/5/ (2/2)

```

 

 

```
Jussi Judin 14:55 Patch Set 5: Verified+1
Build Successful first-server
http://localhost.localdomain:8090/job/gerrit-test-first/5/ : SUCCESS
http://localhost.localdomain:8090/job/gerrit-test-second/5/ : SUCCESS
```

 

Basically build started messages go to different server instances and their verification messages are properly modified. The final verification success status, however, groups all jobs from different Gerrit server instances into one message that then sets whatever labels are configured only for the first server. The second server does not see any action besides build started messages.

The main purpose of using this functionality is to enable different jobs setting different labels on a Gerrit instance and not having to use different Jenkins instances for that.

---
Originally reported by ejusjud, imported from: Gerrit trigger does not send results back to a correct server configuration


  • assignee: rsandell
  • status: Open
  • priority: Minor
  • component(s): gerrit-trigger-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

When having multiple server definitions for Gerrit trigger plugin under <jenkins-url>/gerrit-trigger/ that point to the same server, Gerrit trigger plugin only sends Successful results back to the first one for all jobs that may be configured to use different server instances. Different server instances can have different configuration, especially with the SSH interface in "Gerrit Verified Commands" and different jobs should be able to use these different server instances in the same Jenkins to submit their results.

How to replicate:



  • Install Gerrit Trigger plugin

  • Create a new server in <jenkins-url>/gerrit-trigger/ with the appropriate configuration.

  • Create another Gerrit server connection to the same server with different name but change for example build successful message to "gerrit review <CHANGE>,<PATCHSET> --message 'Build Successful second-server <BUILDS_STATS>'  ..."

  • (restart Jenkins)

  • Create a job that activates on Gerrit trigger event on the first server.

  • Create a job that activates on Gerrit trigger event on the second server.

  • Create a new patch set in Gerrit so that Gerrit trigger event activates.

This will then result in following 3 messages appearing in Gerrit:



Jussi Judin 14:55 Patch Set 5:

Build Started first-server http://localhost.localdomain:8090/job/gerrit-test-first/5/ (1/2)


 
 



Jussi Judin 14:55 Patch Set 5:

Build Started second-server http://localhost.localdomain:8090/job/gerrit-test-second/5/ (2/2)


 
 



Jussi Judin 14:55 Patch Set 5: Verified+1

Build Successful first-server
http://localhost.localdomain:8090/job/gerrit-test-first/5/ : SUCCESS
http://localhost.localdomain:8090/job/gerrit-test-second/5/ : SUCCESS


 
Basically build started messages go to different server instances and their verification messages are properly modified. The final verification success status, however, groups all jobs from different Gerrit server instances into one message that then sets whatever labels are configured only for the first server. The second server does not see any action besides build started messages.

The main purpose of using this functionality is to enable different jobs setting different labels on a Gerrit instance and not having to use different Jenkins instances for that.

environment

```
Jenkins ver. 2.164.2

openjdk version "1.8.0_191"

Gerrit version 2.14.16-105-g1fbfa3d565

Gerrit trigger plugin 2.29.0
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with two Gerrit server definitions pointing to the same server, following the steps in the report. Trace how the Gerrit trigger plugin groups completed jobs and sends verification results; done means each job uses its configured server instance, including its labels and success message, rather than the first server's configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.