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]).
Hello,
I have below config in rules.pl under "All-Projects" for Non-author-code review. Now, I need exception for specific project where author can review code. Is there any solution to implement this scenario ? Any submit_rule we can use in child project which can over-ride submit_filter ?
All-projects rules.pl :
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]).
Thanks,
Ritesh
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Edwin for your help!!
Appreciated your prompt response!!
Yes, I can do that. But problem is I have 100+ projects which are already using "All-projects" as parent and need "non-author-code-review". So If I add another level in project hierarchy, then I will need to change parent for 100+ projects.
Hello,
I have below config in rules.pl under "All-Projects" for Non-author-code review. Now, I need exception for specific project where author can review code. Is there any solution to implement this scenario ? Any submit_rule we can use in child project which can over-ride submit_filter ?
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]).
Thanks,
Ritesh
--
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]).
Hello Zivkov,
Thanks for your help!
Actually I'm not much familiar with prolog. Could you please help me to prepare rules.pl ? Would it look like as shown below ?
Hi Zivkov, below rules.pl is not working.
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]).
================================== End rules.pl ==========================================