Submit filter for OWNERS plugin 2.14.8

26 views
Skip to first unread message

Sharath Gupta

unread,
May 23, 2018, 6:53:24 PM5/23/18
to Repo and Gerrit Discussion
Hi folks

I am trying to enable OWNERS on 2.14.8. When I tried to add submit_rule below on a particular project, it seems to work fine. But when I try to add a submit_filter to All-Projects I dont see the owners functionality working.

Here is the submit_rule I added to a particular repo and worked fine.

submit_rule(S) :-

    gerrit:default_submit(D),

    D =.. [submit | Ds],

    findall(U, gerrit:commit_label(label('Code-Review', 1), U), Approvers),

    gerrit_owners:add_owner_approval(Approvers, Ds, A), 

    S =.. [submit | A]. 


I wanted this to be applied to all projects which inherited All-Projects. So, I added the below submit_filter to All-Projects. But I dont see the OWNERS code review getting mandated. I am able to submit my change in the repo which inherits All-Projects without owner's approval defined in OWNERS file of that repo.


submit_filter(In, Out) :-

    In =.. [submit | Ls],

    findall(U, gerrit:commit_label(label('Code-Review', 1), U), Approvers),

    gerrit_owners:add_owner_approval(Approvers, Ls, A),

    Out =.. [submit | A].


Please help me if I am doing anything wrong with the submit_filter here.


Thanks in advance


-Sharath

Reply all
Reply to author
Forward
0 new messages