jenkinsci / jenkinsci/gerrit-trigger-plugin

[JENKINS-15268] "comment added" is triggered on patch merge

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

Description

Whenever a change is merged in a repository, a CommentAdded event is triggered as well which will trigger a build if the verdict is honored.

Given a repository requiring verified+1 / codereview +2 to merge a change

Setup a job triggering on "Comment Added", Verdict: "Code-Review", Value: 2

In Gerrit, a privileged user press the submit button, set +1/+2 and merge the change. End result: two CommentAdded events are triggered.

Here is a session log for a job named GerritTriggerTesting and change 24533 patchset 1:

Sep 21, 2012 12:57:24 PM com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger schedule

INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1

Sep 21, 2012 12:57:24 PM com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger schedule

INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted

INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true].

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted

INFO: MemoryStatus:

null

Sep 21, 2012 12:57:27 PM hudson.model.Run execute

INFO: GerritTriggerTesting #238 main build action completed: FAILURE

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onCompleted

INFO: Completed. Build: GerritTriggerTesting #238 Cause: GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted

INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true].

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted

INFO: MemoryStatus:

null

Sep 21, 2012 12:57:27 PM hudson.model.Run execute

INFO: GerritTriggerTesting #238 main build action completed: FAILURE

Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onCompleted

INFO: Completed. Build: GerritTriggerTesting #238 Cause: GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true

Log abstract:

INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1

INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1

INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true].

INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@​63dc5002 silent: true].

---
Originally reported by hashar, imported from: "comment added" is triggered on patch merge


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

Raw content of original issue

Whenever a change is merged in a repository, a CommentAdded event is triggered as well which will trigger a build if the verdict is honored.

Given a repository requiring verified+1 / codereview +2 to merge a change
Setup a job triggering on "Comment Added", Verdict: "Code-Review", Value: 2

In Gerrit, a privileged user press the submit button, set +1/+2 and merge the change. End result: two CommentAdded events are triggered.

Here is a session log for a job named GerritTriggerTesting and change 24533 patchset 1:

Sep 21, 2012 12:57:24 PM com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger schedule
INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1
Sep 21, 2012 12:57:24 PM com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger schedule
INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true].
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: MemoryStatus:
null
Sep 21, 2012 12:57:27 PM hudson.model.Run execute
INFO: GerritTriggerTesting #238 main build action completed: FAILURE
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onCompleted
INFO: Completed. Build: GerritTriggerTesting #238 Cause: GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true].
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onStarted
INFO: MemoryStatus:
null
Sep 21, 2012 12:57:27 PM hudson.model.Run execute
INFO: GerritTriggerTesting #238 main build action completed: FAILURE
Sep 21, 2012 12:57:27 PM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ToGerritRunListener onCompleted
INFO: Completed. Build: GerritTriggerTesting #238 Cause: GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true

Log abstract:

INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1
INFO: Project GerritTriggerTesting Build Scheduled: true By event: 24533/1
INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true].
INFO: Gerrit build GerritTriggerTesting #238 Started for cause: [GerritCause: com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.CommentAdded@63dc5002 silent: true].

  • environment: Gerrit Trigger 2.6.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the duplicate CommentAdded events with Gerrit Trigger 2.6.0 using the described Code-Review +2 configuration and merge flow. Trace the CommentAdded event into GerritTrigger.schedule and compare the two scheduling paths. Done means a patch merge does not trigger an unintended duplicate build while ordinary comment-added behavior remains intact.

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.