Issue 1958: Excluding author from peer reviewer list in gerrit
Status:  New
Owner: ----
Reported by buddi.sa...@gmail.com, Jun 11, 2013
Hi All,

I have a requirement for my project to provide the self-review option for team lead and manager and exclude all other team members from self-review of their own changes of that project. And here i need one can able to review other's changes.

I tried to implement this feature with the code given below. Once i added the code and to the project and push, I am unable to see the "Publish and Submit" button even i am an Administrator.

Here is the code i have placed in rules.pl

submit_rule(submit(CR, V)) :-
  base(CR, V),
  CR = label(_, ok(Reviewer)),
  gerrit:commit_author(Author),
  Author \= Reviewer,
  !.
submit_rule(submit(CR, V, N)) :-
  base(CR, V),
  N = label('Non-Author-Code-Review', need(_)).
base(CR, V) :-
  gerrit:max_with_block(-2, 2, 'Code-Review', CR),
  gerrit:max_with_block(-1, 1, 'Verified', V).

from https://gerrit-review.googlesource.com/Documentation/prolog-cookbook.html#_example_8_make_change_submittable_only_if_tt_code_review_2_tt_is_given_by_a_non_author

Can some one suggest me how i can implement this?

Regards,
Samba.
May 7, 2015
#1 frank.st...@gmail.com
I know its old, but heck somebody might need this solution.

I think it will work if you add this rule on top
submit_rule(X) :- gerrit:default_submit(X).

That will apply the default rules first, on which your specific rules layered on.