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
This commit is contained in:
Jeremy Stanley 2016-09-12 23:05:49 +00:00
parent a21afdb0b0
commit d12740116f

View File

@ -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