how to not clear verification votes on commit message change

766 views
Skip to first unread message

euphxenos

unread,
Dec 13, 2017, 5:25:19 PM12/13/17
to Repo and Gerrit Discussion
We're using the Jenkins Gerrit Trigger plugin with Gerrit 2.14.1.  In the configuration for a Jenkins job, in the Gerrit Trigger section, I have it set to Trigger On Patchset Created.  In that section, I've turned on the option to "Exclude No Code Change".  This has the effect of not re-running our lengthy verification process when someone creates a new patchset in their review with just a commit message change (and no code changes).  This is good.  However, when this happens, the votes on the verification label get cleared.  So the review had a verification +1 for patchset 2, someone updates the commit message, which creates patchset 3, and now the review has no verification +1 and no automated verification process will run to give it the verification +1 it needs before it can get submitted.

How can I get Gerrit to not clear the votes when all that changed is a commit message?


thanks,
--Andrew

Matthias Sohn

unread,
Dec 13, 2017, 7:37:41 PM12/13/17
to euphxenos, Repo and Gerrit Discussion
On Wed, Dec 13, 2017 at 11:25 PM, euphxenos <euph...@gmail.com> wrote:
We're using the Jenkins Gerrit Trigger plugin with Gerrit 2.14.1.  In the configuration for a Jenkins job, in the Gerrit Trigger section, I have it set to Trigger On Patchset Created.  In that section, I've turned on the option to "Exclude No Code Change".  This has the effect of not re-running our lengthy verification process when someone creates a new patchset in their review with just a commit message change (and no code changes).  This is good.  However, when this happens, the votes on the verification label get cleared.  So the review had a verification +1 for patchset 2, someone updates the commit message, which creates patchset 3, and now the review has no verification +1 and no automated verification process will run to give it the verification +1 it needs before it can get submitted.

How can I get Gerrit to not clear the votes when all that changed is a commit message?

see the label.Label-Name.copy options described here
which can be configured in the project.config file versioned in the refs/meta/config branch of a Gerrit project or
any of its parent projects it's inheriting permissions and configuration from.

For JGit we use the following configuration:

[label "Code-Review"]
        function = MaxWithBlock
abbreviation = R
copyMinScore = true
copyAllScoresOnTrivialRebase = true
value = -2 Do not submit
value = -1 I would prefer that you didn't submit this
value =  0 No score
value = +1 Looks good to me, but someone else must approve
value = +2 Looks good to me, approved
defaultValue = 0

-Matthias

euphxenos

unread,
Dec 13, 2017, 8:13:46 PM12/13/17
to Repo and Gerrit Discussion
Thanks!  I'm pretty sure copyAllScoresIfNoCodeChange is what I'm looking for; I'll give it a try.


--Andrew

euphxenos

unread,
Dec 14, 2017, 5:18:10 PM12/14/17
to Repo and Gerrit Discussion
Well that's strange.  In All-Projects, I already have this:

[label "Verified"]
function = MaxWithBlock
value = -1 Fails
value =  0 No score
value = +1 Verified
copyAllScoresIfNoCodeChange = true
defaultValue = 0

The project that I'm looking at inherits its labels from All-Projects without defining any labels of its own.  Shouldn't this mean that it already has copyAllScoresIfNoCodeChange set to true in the child project, or is there something that would prevent that setting from getting inherited?


thanks,
--Andrew

Matthew Webber

unread,
Dec 15, 2017, 4:14:19 AM12/15/17
to Repo and Gerrit Discussion
I would try adding "copyAllScoresOnTrivialRebase = true" as well, before you do any other experiments.
Reply all
Reply to author
Forward
0 new messages