问题
I'm not familiar with prolog language. I've used the example number 8 of the prolog cookbook.
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
Which code is :
submit_filter(In,Out) :-
In =.. [submit | Ls],
add_non_author_approval(Ls, R),
Out =.. [submit | R].
add_non_author_approval(S1, S2) :-
gerrit:commit_author(A),
gerrit:commit_label(label('Code-Review', 2), R),
R \= A, !,
S2 = [label('Non-Author-Code-Review', ok(R)) | S1].
add_non_author_approval(S1, [label('Non-Author-Code-Review', need(_)) | S1]).
This is the rule forcing a non author code review the code before submit.
It's working as intended, but I wanted users from admin group to bypass this rule(If they are author and the +2 reviewer the submit should always be enable).
Any kind of help is appreciated.
来源:https://stackoverflow.com/questions/57622412/bypass-rule-for-administration-group-in-rules-pl-in-gerrit-configuration