Revert "Expect new types of approval records from Gerrit"
This reverts commit a68a104695
.
Type of all mark records is translated to old Gerrit format (CRVW, APRV)
Change-Id: Id92ba40d94aed78f13cdeee83b7dc2958eb1805c
This commit is contained in:
@@ -322,6 +322,10 @@ class RecordProcessor(object):
|
||||
mark['review_id'] = review['id']
|
||||
mark['patch'] = int(patch['number'])
|
||||
|
||||
# map type from new Gerrit to old
|
||||
mark['type'] = {'Approved': 'APRV', 'Code-Review': 'CRVW',
|
||||
'Verified': 'VRIF'}.get(mark['type'], mark['type'])
|
||||
|
||||
self._update_record_and_user(mark)
|
||||
return mark
|
||||
|
||||
@@ -349,7 +353,8 @@ class RecordProcessor(object):
|
||||
continue # not reviewed by anyone
|
||||
|
||||
for approval in patch['approvals']:
|
||||
if approval['type'] not in ('Code-Review', 'Approved'):
|
||||
if approval['type'] not in ('CRVW', 'APRV',
|
||||
'Code-Review', 'Approved'):
|
||||
continue # keep only Code-Review and Approved
|
||||
if ('email' not in approval['by'] or
|
||||
'username' not in approval['by']):
|
||||
@@ -677,8 +682,7 @@ class RecordProcessor(object):
|
||||
lambda: {'patch_number': 0, 'marks': []})
|
||||
|
||||
for record in self.runtime_storage_inst.get_all_records():
|
||||
if ((record['record_type'] == 'mark') and
|
||||
(record['type'] == 'Code-Review')):
|
||||
if record['record_type'] == 'mark' and record['type'] == 'CRVW':
|
||||
review_id = record['review_id']
|
||||
patch_number = record['patch']
|
||||
|
||||
|
Reference in New Issue
Block a user