Issue 757: Summing of review scores (aka "can 1+1 please == 2?")
Status:  Released
Owner: ----
Closed:  Oct 2012

Blocked on:
issue 971
Reported by 5meo...@gmail.com, Oct 19, 2010
According to this discussion:

http://groups.google.com/group/repo-discuss/browse_thread/thread/3d6e494b76f1684b

Gerrit doesn't support summing scores "yet". The suggestion there is that this is something that's being considered.

I'd like this to be a formal request for such a feature. The workflow would be pretty straightforward:

- most users don't get to vote more than +1
- +2 is required for submit
- someone submits a patchset and votes it up themselves (total is now +1)
  - ad absurdum: someone else votes -1, total is now 0
  - etc: someone yet else votes +1, total is now +1 again
- someone else reviews and votes it up (total is now +2)
- either:
  - the code is automatically merged using the already chosen strategy, or
  - the submit button is enabled as soon as the intended +2 is going to be achieved (ie as soon as the second reviewer chooses the +1 radiobutton), or
  - the submitter is notified that a submit is now possible and must manually click submit, or
  - anyone able to submit would be notified and could manually submit

As a workaround, I've hacked up something using hook scripts which permits an auto-user to vote-up-and-submit when a gsql query which sums the values of a particular patch_set_id against a change_id for a CRVW category is > 2, but I don't recommend that for everyone.
Apr 1, 2011
#1 boris-c...@gmx.com
I had a very similar requirement, but did not get it working with a hook (and I didn't like the hook-solution).

So I implemented my own CategoryFunction, that can be used for a workflow of this kind. I'll attach the patch, you can also get the change from github [1]. I didn't want to push this to review.source.android.com for review because this is still a hack in my book (because you have to use gsql to activate it and you cannot configure the sum which is the threshold), but maybe easier for to use like it was for me.

[1] https://github.com/Boris-de/gerrit/commit/3f54b2dc3539983b002802bc8e4e548a9c2497ad
SumWithBlock.patch
3.2 KB   View   Download
May 20, 2011
Project Member #2 nas...@grainawi.org
This will be a site/project level customization supported through a workflow engine.
Status: Accepted
Blockedon: 971
Mar 21, 2012
#3 tim...@gmail.com
I wrote a trigger for this:

* $QUORUM says how many +1 votes triggers a +2
* $PLEBIANS says which votes contribute to the total: Just +1s or both -1s and +1s.
* $AUTO_SUBMIT_ON_QUORACY says whether to auto-submit if this script sets +2
* $AND_IGNORE_UPLOADER says whether to ignore the original submitter's votes.

Make sure your gerrit user has a '.ssh/known_hosts' entry for the gerrit server/port itself.
comment-added
3.6 KB   View   Download
Oct 24, 2012
#4 JBjo...@gmail.com
Added documentation how to implement this in gerrit 2.5 using prolog rules.
https://gerrit-review.googlesource.com/#/c/38760/

Oct 25, 2012
Project Member #5 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.5
Oct 31, 2012
Project Member #6 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Released