I am trying to upgrade Gerrit of my company but I meet an issue (breaking change?) which I don't know how to fix after upgrading Gerrit >= 3.4.0 (I also tried the latest 3.6.0). I scanned through the
3.4 changelog quickly with "comment" or "patchset" but didn't seem to find a related item. Any suggestion is appreciated.
# Description
Adding labels on a old patchset will get "accumulated comment for labels" as shown in the following screenshot.
In v3.3.9, the result is expected.
Furthermore, Gerrit now allows adding the same label to the same patchset multiple times, results in the following screenshot. While in previous version, Gerrit just does nothing.
The issue they cause is that in a Jenkins job (with gerrit-trigger), now the received "GERRIT_EVENT_COMMENT_TEXT" is "Patch Set 1: Verified+1 Code-Review+1" and I can't tell which label (Verified or Code-Review) triggers this job.
# Reproduction
I use docker image ( $ docker run -ti -p 8080:8080 -p 29418:29418 gerritcodereview/gerrit:3.4.0 ) with following steps.
- Setup the "Verified" label for "All-Projects"
[label "Verified"]
function = MaxWithBlock
value = -1 Failed
value = 0 No score
value = +1 Verified
- Create a new repo named "test/test" and clone it to local
- Make a change (patchset 1 and 2) for code review
- Assuming the change number is 1, add Code-Review +1 to patchset 1
$ ssh -p 29418 admin@localhost gerrit review --code-review 1 1,1 - Add Verified +1 to patchset 1
$ ssh -p 29418 admin@localhost gerrit review --verified 1 1,1
- We can even add the same label again and again. Gerrit will give duplicate comments.
$ ssh -p 29418 admin@localhost gerrit review --verified 1 1,1
$ ssh -p 29418 admin@localhost gerrit review --verified 1 1,1
# Retionale
You may be curious about why I add a label on a old patchset. The Jenkins server can be so heavily loaded that when it executes the job, a new patchset has been pushed for reviewing. So then the job is done, it will add a label to a old patchset.