Hi,
with the following
rules.pl:
submit_rule(S) :-
gerrit:default_submit(X),
X =.. [submit | Ls],
add_non_author_approval(Ls, R1),
trivjenkins(R1,R),
S =.. [submit | R].
add_non_author_approval(S1, S2) :-
gerrit:commit_author(A), gerrit:commit_label(label('Code-Review', 2), R),
A == R
, !,
S2 = [label('Non-Author-Code-Review', ok(R)) | S1].
add_non_author_approval(S1, [label('Non-Author-Code-Review', need(_)) | S1]).
trivjenkins(S1,S2):-
gerrit:commit_label(label('Verified', 1), user(1000000)),
gerrit:commit_stats(B1,B2,B3),
(B2 < 5 ;gerrit:commit_message_matches('^\\[TRIVIAL\\]')), !,
S2 = [label('TrivialJenkins', ok(user(1000000)))].
trivjenkins(S1, [label('TrivialJenkins', may(_)) | S1]).
I get the desired behaviour of being able to submit trivial changes without non-author code review (well, for testing I actually require author-review) if user 1000000 (me in this case) approves the change.
But in the web interface, once the Verified label is set, I only the that TrivialJenkins has been given, but I can not revoke the Verified or Code-Review label anymore (see screenshot).
Any ideas what I am doing wrong here?
Björn