From f4d8b7ff5df8ee819de6b18a3d479e6100b24a71 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 12 Feb 2019 13:40:05 -0500 Subject: [PATCH] apply 7 day rule to formal-vote items Ensure that the charter rule that formal-vote items stay open at least 7 days is applied. This change interprets that rule to mean that if the majority votes in favor of a change within the 7 day period, the 3 day waiting period will include any of the remaining 7 days. So if the majority is reached on day 1, the patch must stay open 7 days and if the majority is reached on day 7 the patch must stay open an additional 3 days. Change-Id: I48841570ff19b779b2e35de8218a8f56b408df92 Signed-off-by: Doug Hellmann --- tools/check_review_status.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/check_review_status.py b/tools/check_review_status.py index 9e881bc3f..a8d4a95bf 100755 --- a/tools/check_review_status.py +++ b/tools/check_review_status.py @@ -215,10 +215,17 @@ def get_one_status(change, delegates): # At least 5 positive votes and more positive than negative # votes. votes_to_approve = (votes[1] >= 5 and votes[1] > votes[-1]) - - # Wait at least 3 days after reaching majority. reached_majority = when_majority(change, 5) - if reached_majority: + + parts.append('last change on {}'.format(latest_created.date())) + + # At least 7 days old. + if age < datetime.timedelta(8): + time_to_approve = False + parts.append('has not been open 7 days') + earliest = str(latest_created.date() + datetime.timedelta(8)) + elif reached_majority: + # Wait at least 3 days after reaching majority. earliest = str(reached_majority.date() + datetime.timedelta(4)) since_majority = now.date() - reached_majority.date() time_to_approve = since_majority > datetime.timedelta(3)