[verified] Support explicit review-only provider counters
This commit is contained in:
@@ -147,7 +147,7 @@ class ReworkReadbackAdapter:
|
||||
if (set(inline) != {'mode','field','components'}
|
||||
or inline.get('mode') not in ('per_review','per_review_or_pr_count')
|
||||
or inline.get('field') != 'review_comments'
|
||||
or inline.get('components') not in (['inline'], ['reviews','inline'])):
|
||||
or inline.get('components') not in (['inline'], ['reviews'], ['reviews','inline'])):
|
||||
raise ReadbackError('invalid inline count declaration')
|
||||
return copy.deepcopy(contract)
|
||||
|
||||
@@ -347,7 +347,9 @@ class ReworkReadbackAdapter:
|
||||
for row in collected['rows']:
|
||||
if row['id'] in inline_ids: raise ReadbackError('duplicate cross-review inline ID')
|
||||
inline_ids.add(row['id'])
|
||||
computed = inline + (len(raw['reviews']['rows']) if 'reviews' in self.provider['inline']['components'] else 0)
|
||||
parts = self.provider['inline']['components']
|
||||
computed = ((inline if 'inline' in parts else 0)
|
||||
+ (len(raw['reviews']['rows']) if 'reviews' in parts else 0))
|
||||
field = self.provider['inline']['field']
|
||||
if field not in raw['pr']:
|
||||
if (self.provider['inline']['mode'] != 'per_review' or fallback or computed != 0
|
||||
|
||||
Reference in New Issue
Block a user