We're already using the prolog submit rule straight out of Gerrit's prolog submit rules cookbook (example 8) to require a non-author code review for submits. We're getting ready to make our verification process much more stringent, so we'd like to make verification optional to give people a transitional period where they can still see whether or not their changes are passing or failing verification in Gerrit's UI, but without preventing them from submitting (part of what we need to do is to shake out the problems in the new verification process). It differs from example 10 in the cookbook because we want to keep the Verified label in the UI, not drop it completely. What I've come up with so far is this:
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),
label('Verified', may(_)).
This is almost exactly example 8 without using gerrit:default_submit, except I've changed the last line to use may(_) on the Verified label. The problem I'm having with this is that while it does make Verified optional and keep it in the UI (I can submit a change with a +2 review, regardless of the state of the verified label), now the Non Author Code Review label isn't working properly. When a non-author gives a review, that column is no longer checked in the UI. We're using Gerrit 2.12. What am I doing wrong?