diff --git a/tools/check_review_status.py b/tools/check_review_status.py index e9eff4b9c..b8b822d4c 100755 --- a/tools/check_review_status.py +++ b/tools/check_review_status.py @@ -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