@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

After "Request Review", move revisions with voided "Accepts" into "Ready to Review", not "Waiting on Other Reviewers"

Summary:
Depends on D18756. Fixes T12539. See PHI190. Currently, when this occurs:

- Alice accepts.
- Bailey requests review.
- Alice views her dashboard.

...the revision appears in "Waiting on Other Reviewers" (regardless of whether other reviewers actually exist or not).

Instead, ignore these voided/non-current accepts and let the revisions appear in "Ready to Review", which is more natural.

Test Plan: Went through the steps above. On `master`, saw revision in "Waiting on Other Reviewers". After patch, saw it in "Ready to Review".

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12539

Differential Revision: https://secure.phabricator.com/D18757

+21 -2
+9 -1
src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php
··· 123 123 $reviewing = array( 124 124 DifferentialReviewerStatus::STATUS_ADDED, 125 125 DifferentialReviewerStatus::STATUS_COMMENTED, 126 + 127 + // If an author has used "Request Review" to put an accepted revision 128 + // back into the "Needs Review" state, include "Accepted" reviewers 129 + // whose reviews have been voided in the "Should Review" bucket. 130 + 131 + // If we don't do this, they end up in "Waiting on Other Reviewers", 132 + // even if there are no other reviewers. 133 + DifferentialReviewerStatus::STATUS_ACCEPTED, 126 134 ); 127 135 $reviewing = array_fuse($reviewing); 128 136 ··· 130 138 131 139 $results = array(); 132 140 foreach ($objects as $key => $object) { 133 - if (!$this->hasReviewersWithStatus($object, $phids, $reviewing)) { 141 + if (!$this->hasReviewersWithStatus($object, $phids, $reviewing, false)) { 134 142 continue; 135 143 } 136 144
+12 -1
src/applications/differential/query/DifferentialRevisionResultBucket.php
··· 53 53 protected function hasReviewersWithStatus( 54 54 DifferentialRevision $revision, 55 55 array $phids, 56 - array $statuses) { 56 + array $statuses, 57 + $current = null) { 57 58 58 59 foreach ($revision->getReviewers() as $reviewer) { 59 60 $reviewer_phid = $reviewer->getReviewerPHID(); ··· 64 65 $status = $reviewer->getReviewerStatus(); 65 66 if (empty($statuses[$status])) { 66 67 continue; 68 + } 69 + 70 + if ($current !== null) { 71 + if ($status == DifferentialReviewerStatus::STATUS_ACCEPTED) { 72 + $diff_phid = $revision->getActiveDiffPHID(); 73 + $is_current = $reviewer->isAccepted($diff_phid); 74 + if ($is_current !== $current) { 75 + continue; 76 + } 77 + } 67 78 } 68 79 69 80 return true;