Merge "update check-review-status to look for rejection by delegate"

This commit is contained in:
Zuul 2018-12-13 13:46:47 +00:00 committed by Gerrit Code Review
commit 0862559639
1 changed files with 11 additions and 0 deletions

View File

@ -138,6 +138,15 @@ def has_approved(name, review):
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():
offset = 0
while True:
@ -296,6 +305,8 @@ def get_one_status(change, delegates):
can_approve = 'delegated to {}'.format(approver_name)
if has_approved(approver_name, change):
can_approve += ', YES'
elif has_rejected(approver_name, change):
can_approve += '\nNO - delegate voted against'
elif topic in ('project-update', 'new-project'):
# https://governance.openstack.org/tc/reference/house-rules.html#other-project-team-updates