update check-review-status to look for rejection by delegate
If the person to whom a decision has been delegated rejects it, report that the patch cannot be approved. Change-Id: I70f2ddf726f94fb6d11558510232cc5e96c4bbc5 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
@@ -138,6 +138,15 @@ def has_approved(name, review):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def has_rejected(name, review):
|
||||||
|
for vote in review['labels'].get('Code-Review', {}).get('all', []):
|
||||||
|
voter = vote.get('name', '')
|
||||||
|
value = vote.get('value', 0)
|
||||||
|
if voter == name and value == -1:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def all_changes():
|
def all_changes():
|
||||||
offset = 0
|
offset = 0
|
||||||
while True:
|
while True:
|
||||||
@@ -296,6 +305,8 @@ def get_one_status(change, delegates):
|
|||||||
can_approve = 'delegated to {}'.format(approver_name)
|
can_approve = 'delegated to {}'.format(approver_name)
|
||||||
if has_approved(approver_name, change):
|
if has_approved(approver_name, change):
|
||||||
can_approve += ', YES'
|
can_approve += ', YES'
|
||||||
|
elif has_rejected(approver_name, change):
|
||||||
|
can_approve += '\nNO - delegate voted against'
|
||||||
|
|
||||||
elif topic in ('project-update', 'new-project'):
|
elif topic in ('project-update', 'new-project'):
|
||||||
# https://governance.openstack.org/tc/reference/house-rules.html#other-project-team-updates
|
# https://governance.openstack.org/tc/reference/house-rules.html#other-project-team-updates
|
||||||
|
|||||||
Reference in New Issue
Block a user