@@ -56,7 +56,7 @@ class ReviewDecision(Enum):
56
56
"""
57
57
changes_requested = 'CHANGES_REQUESTED'
58
58
approved = 'APPROVED'
59
- unclear = 'COMMENTED '
59
+ unclear = 'UNCLEAR '
60
60
61
61
class Priority (Enum ):
62
62
r"""
@@ -319,12 +319,15 @@ def get_review_decision(self):
319
319
return None
320
320
321
321
if self ._review_decision is not None :
322
+ if self ._review_decision == ReviewDecision .unclear :
323
+ return None
322
324
return self ._review_decision
323
325
324
326
data = self .view ('reviewDecision' )
325
327
if data :
326
328
self ._review_decision = ReviewDecision (data )
327
329
else :
330
+ # To separate a not supplied value from not cached (see https://github.com/sagemath/sage/pull/36177#issuecomment-1704022893 ff)
328
331
self ._review_decision = ReviewDecision .unclear
329
332
info ('Review decision for %s: %s' % (self ._issue , self ._review_decision .value ))
330
333
return self ._review_decision
@@ -349,9 +352,9 @@ def get_reviews(self, complete=False):
349
352
self .get_commits ()
350
353
351
354
date = self ._commit_date
352
- no_rev = ReviewDecision . unclear .value
355
+ unproper_rev = RevState . commented .value
353
356
new_revs = [rev for rev in self ._reviews if rev ['submittedAt' ] > date ]
354
- proper_new_revs = [rev for rev in new_revs if rev ['state' ] != no_rev ]
357
+ proper_new_revs = [rev for rev in new_revs if rev ['state' ] != unproper_rev ]
355
358
info ('Proper reviews after %s for %s: %s' % (date , self ._issue , proper_new_revs ))
356
359
return proper_new_revs
357
360
@@ -463,11 +466,6 @@ def approve_allowed(self):
463
466
r"""
464
467
Return if the actor has permission to approve this PR.
465
468
"""
466
- revs = self .get_reviews (complete = True )
467
- if not any (rev ['authorAssociation' ] in ('MEMBER' , 'OWNER' ) for rev in revs ):
468
- info ('PR %s can\' t be approved because of missing member review' % (self ._issue ))
469
- return False
470
-
471
469
revs = self .get_reviews ()
472
470
revs = [rev for rev in revs if rev ['author' ]['login' ] != self ._actor ]
473
471
ch_req = ReviewDecision .changes_requested
0 commit comments