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

Tailor the "no reviewers on this revision" warnings to handle the case where all reviewers have resigned

Summary:
Ref T13216. See PHI985. We currently use a banner to warn you when a revision has no reviewers or only disabled users, but since the changes to track "Resign" more explicilty we'll no longer warn you if everyone has resigned.

(Previously, they'd no longer be reviewers, so you'd end up with the "no reviewers are assigned" warning if everyone resigned.)

This can still interact slightly oddly with some states (e.g., only a package or project reviewer) but I'd like to wait for T731 to tighten those cases up, and they're more advanced/unusual.

Test Plan:
{F6026832}

{F6026833}

{F6026834}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

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

+20 -5
+20 -5
src/applications/differential/customfield/DifferentialReviewersField.php
··· 72 72 return array(); 73 73 } 74 74 75 + $all_resigned = true; 76 + $all_disabled = true; 77 + $any_reviewers = false; 78 + 75 79 foreach ($this->getValue() as $reviewer) { 76 - if (!$handles[$reviewer->getReviewerPHID()]->isDisabled()) { 77 - return array(); 80 + $reviewer_phid = $reviewer->getReviewerPHID(); 81 + 82 + $any_reviewers = true; 83 + 84 + if (!$handles[$reviewer_phid]->isDisabled()) { 85 + $all_disabled = false; 86 + } 87 + 88 + if (!$reviewer->isResigned()) { 89 + $all_resigned = false; 78 90 } 79 91 } 80 92 81 93 $warnings = array(); 82 - if ($this->getValue()) { 94 + if (!$any_reviewers) { 95 + $warnings[] = pht( 96 + 'This revision needs review, but there are no reviewers specified.'); 97 + } else if ($all_disabled) { 83 98 $warnings[] = pht( 84 99 'This revision needs review, but all specified reviewers are '. 85 100 'disabled or inactive.'); 86 - } else { 101 + } else if ($all_resigned) { 87 102 $warnings[] = pht( 88 - 'This revision needs review, but there are no reviewers specified.'); 103 + 'This revision needs review, but all reviewers have resigned.'); 89 104 } 90 105 91 106 return $warnings;