My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 288: require additional approvals based on type of change
25 people starred this issue and may be notified of changes. Back to list
Status:  Submitted
Owner:  ----
Closed:  Oct 2012

Blocked on:
issue 287
issue 971

Blocking:
issue 112
issue 308


Sign in to add a comment
 
Reported by caniszc...@gmail.com, Sep 30, 2009
In many cases, there are people who require some level of workflow when accepting changes.

For example, in the Eclipse.org project community, we have rules that a patch greater than 250 
lines needs to go under IP review first. Having the ability to automatically flag a change with some 
type of workflow to put it in a state of needing further approval, would be awesome.

I hope this is enough explanation.
Feb 18, 2010
#1 docw...@gmail.com
Another example workflow:

Changes to certain branches need review by two different groups of people: A technical 
person and a manager person.
Feb 18, 2010
#2 sop@google.com
re: comment #1, you can probably do this in Gerrit 2.1.2 when
it gets released.  It has per-branch permissions.
Feb 18, 2010
#3 docw...@gmail.com
Cool!
Apr 24, 2010
#4 sop@google.com
(No comment was entered for this change.)
Summary: require additional approvals based on type of change
Status: Accepted
Jun 15, 2010
#5 sop@google.com
We're going to implement this using tags/labels on a change.
Blockedon: 287
Jun 6, 2011
#6 sop@google.com
(No comment was entered for this change.)
Blockedon: 971
Oct 23, 2012
#7 JBjo...@gmail.com
This can be done with the prolog-rule engine if https://gerrit-review.googlesource.com/#/c/38690/ gets approved.

Example prolog rules.pl:
% SQL required:
% INSERT INTO approval_categories VALUES('IP-Approved','I',2,'MaxWithBlock','Y','IPAP');
% INSERT INTO approval_category_values VALUES('IP-Approval failed','IPAP',-1);
% INSERT INTO approval_category_values VALUES('No score','IPAP',0);
% INSERT INTO approval_category_values VALUES('IP-Approval completed','IPAP',1);
% This rules.pl requires IP-Approved to be set for every change that has more then 250 'Insertions'.

submit_rule(S) :-
	gerrit:default_submit(X),
	X =.. [submit | Ls],
	require_IP(Ls, R),
	S =.. [submit | R].

require_IP(S,R) :-
	gerrit:commit_stats(Files,Insertions,Deletions),
	Insertions < 250,
	gerrit:remove_label(S,label('IP-Approved',_),R), !.
require_IP(S,S).
Oct 23, 2012
#8 sop@google.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.6
Sign in to add a comment

Powered by Google Project Hosting