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].
|