commit c6fd04316af2b7c49d3a50f8984fbbc5c64fdb95 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Thu Dec 3 10:33:21 2015 +0100
Signal when a review was approved more than 60 days ago
Fixes https://github.com/fedora-infra/packagedb-cli/issues/65
pkgdb2client/utils.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) --- diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py index d69d2cd..5d47765 100644 --- a/pkgdb2client/utils.py +++ b/pkgdb2client/utils.py @@ -275,6 +275,15 @@ def check_package_creation(info, bugid, pkgdbclient): messages["bad"].append( 'Review not approved by the assignee of ' 'the ticket {0}'.format(flag_setter)) + update_dt = flag.get('modification_date') + if update_dt: + dt = datetime.datetime.strptime( + update_dt.value, '%Y%m%dT%H:%M:%S') + delta = datetime.datetime.utcnow().date() - dt.date() + if delta.days > 60: + messages["bad"].append( + 'Review was approved more than 60 days ago, ' + 'on {0}.'.format(dt.strftime('%Y-%m-%d %H:%M:%S'))) else: messages["bad"].append( 'Review not approved, flag set to: {0}'.format(
packagedb-cli-commits@lists.stg.fedorahosted.org