How to add rules.pl for all projects?

28 views
Skip to first unread message

Anand Shah

unread,
Apr 6, 2018, 2:46:54 AM4/6/18
to Repo and Gerrit Discussion
Hi,

     My current scenario is, all hotfix check-ins flow from mainline to hotfix branches.
On mainline, they have +2 and +1 requirement but when they are cherry-picked do not enforce +2 requirement.

To do so, I added 'rules.pl' under 'All-Projects' ---> branch 'refs/meta/config'

My rules.pl contains following

submit_rule(S) :-

    gerrit:default_submit(X),

    X =.. [submit | Ls],

    remove_verified_category(Ls, R),

    S =.. [submit | R].

remove_verified_category([], []).

remove_verified_category([label('Code-Review', _) | T], R) :- gerrit:change_branch(B), regex_matches('refs/heads/XYZ/hotfix/*', B), remove_verified_category(T, R), !.

remove_verified_category([H|T], [H|R]) :- remove_verified_category(T, R).



Though having this rules.pl under 'All-Projects' , cherry picking to hotfix branches still requires +2 ('Code-Review').

My question is , How can I write a global rules.pl for all the branches for all the projects?
Also, having new rules.pl will require restart of gerrit to take effect?

Appreciate any help with this.

Thanks,
Anand

Edwin Kempin

unread,
Apr 9, 2018, 2:22:21 AM4/9/18
to anands...@gmail.com, Repo and Gerrit Discussion
On Fri, Apr 6, 2018 at 8:46 AM Anand Shah <anands...@gmail.com> wrote:
Hi,

     My current scenario is, all hotfix check-ins flow from mainline to hotfix branches.
On mainline, they have +2 and +1 requirement but when they are cherry-picked do not enforce +2 requirement.

To do so, I added 'rules.pl' under 'All-Projects' ---> branch 'refs/meta/config'

My rules.pl contains following

submit_rule(S) :-

    gerrit:default_submit(X),

    X =.. [submit | Ls],

    remove_verified_category(Ls, R),

    S =.. [submit | R].

remove_verified_category([], []).

remove_verified_category([label('Code-Review', _) | T], R) :- gerrit:change_branch(B), regex_matches('refs/heads/XYZ/hotfix/*', B), remove_verified_category(T, R), !.

remove_verified_category([H|T], [H|R]) :- remove_verified_category(T, R).



Though having this rules.pl under 'All-Projects' , cherry picking to hotfix branches still requires +2 ('Code-Review').

My question is , How can I write a global rules.pl for all the branches for all the projects?

 
Also, having new rules.pl will require restart of gerrit to take effect?
No.
 

Appreciate any help with this.

Thanks,
Anand

--
--
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.
Reply all
Reply to author
Forward
0 new messages