From d12740116fded95dc0064a1e474fd11623ae91a3 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 12 Sep 2016 23:05:49 +0000 Subject: [PATCH] Be more careful checking the change submitted date While rare, it _is_ possible for changes to be in a merged state in Gerrit while lacking a submitted datestamp. For example, https://review.openstack.org/274113 was merged in a strange way that left it with no record of merge submission. We had fallback error handling in owners.py to report this condition, but neglected an exception path in the previous implementation which would cause the script to bail early rather than falling through to that error handler. Now it should use the submitted date if one is present, and report an explicit warning (including change and owner IDs) for any where it is not. Change-Id: I1a40959fdd14dfef720c32e3c87ff5bbde7432df --- tools/owners.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/owners.py b/tools/owners.py index c1603142e1..5e3ccb96e8 100644 --- a/tools/owners.py +++ b/tools/owners.py @@ -125,7 +125,7 @@ def normalize_project(project): def date_merged(change, after=None, before=None): """Determine the date and time a specific change merged""" - date = change['submitted'] + date = change.get('submitted', None) if not date: # Something's terribly wrong with any changes matching this now