As of Gerrit 3.4.0, old patchset comments (labels) are accumulated.

274 views
Skip to first unread message

Jack Cherng

unread,
May 25, 2022, 2:52:55 PM5/25/22
to Repo and Gerrit Discussion
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. 

Snipaste_2022-05-25_21-03-34.png

In v3.3.9, the result is expected.
image-2022-05-25-19-14-29-848.png

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.

Snipaste_2022-05-25_21-09-10.png

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.

  1. Setup the "Verified" label for "All-Projects"
    [label "Verified"]
        function = MaxWithBlock
        value = -1 Failed
        value = 0 No score
        value = +1 Verified

  2. Create a new repo named "test/test" and clone it to local
  3. Make a change (patchset 1 and 2) for code review
  4. 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
  5. Add Verified +1 to patchset 1
    $ ssh -p 29418 admin@localhost gerrit review --verified 1 1,1
  6. 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.



Reply all
Reply to author
Forward
0 new messages