1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Refine bucketing and display rules for voided "Accepts" in Differential

Summary:
See PHI190. This clarifies the ruleset a bit:

  - If you accepted, then the author used "Request Review" explicitly, we now show "Accepted Earlier" instead of "Accepted" in the "Reviewers" list on the main revision page. This makes it sligthly more clear why the revision is back in your review queue without picking through the transaction log.
  - Instead of moving all non-current accepts into "Ready to Review", move only voided accepts into "Ready to Review". This stops us from pulling older accepts which haven't been voided (which could have been incorrectly pulled) and correctly pulls older, voided accepts from before an update (for example: accept, then request review, then update) and generally aligns better with intent/expectation.

Test Plan:
  - Accepted, requested review.
  - Saw reviewer as "Accepted Earlier".
  - Saw review in "Ready to Review" bucket.
  - Accepted, updated (with sticky accept).
  - Saw reviewer as "Accepted Prior Diff".
  - Saw review as "Waiting on Authors".

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18764
This commit is contained in:
epriestley 2017-11-06 11:51:59 -08:00
parent 587faa6f67
commit 12e6106a59
3 changed files with 13 additions and 8 deletions

View file

@ -138,7 +138,7 @@ final class DifferentialRevisionRequiredActionResultBucket
$results = array();
foreach ($objects as $key => $object) {
if (!$this->hasReviewersWithStatus($object, $phids, $reviewing, false)) {
if (!$this->hasReviewersWithStatus($object, $phids, $reviewing, true)) {
continue;
}

View file

@ -54,7 +54,7 @@ abstract class DifferentialRevisionResultBucket
DifferentialRevision $revision,
array $phids,
array $statuses,
$current = null) {
$include_voided = null) {
foreach ($revision->getReviewers() as $reviewer) {
$reviewer_phid = $reviewer->getReviewerPHID();
@ -67,11 +67,10 @@ abstract class DifferentialRevisionResultBucket
continue;
}
if ($current !== null) {
if ($include_voided !== null) {
if ($status == DifferentialReviewerStatus::STATUS_ACCEPTED) {
$diff_phid = $revision->getActiveDiffPHID();
$is_current = $reviewer->isAccepted($diff_phid);
if ($is_current !== $current) {
$is_voided = (bool)$reviewer->getVoidedPHID();
if ($is_voided !== $include_voided) {
continue;
}
}

View file

@ -47,6 +47,7 @@ final class DifferentialReviewersView extends AphrontView {
$action_phid = $reviewer->getLastActionDiffPHID();
$is_current_action = $this->isCurrent($action_phid);
$is_voided = (bool)$reviewer->getVoidedPHID();
$comment_phid = $reviewer->getLastCommentDiffPHID();
$is_current_comment = $this->isCurrent($comment_phid);
@ -86,7 +87,7 @@ final class DifferentialReviewersView extends AphrontView {
break;
case DifferentialReviewerStatus::STATUS_ACCEPTED:
if ($is_current_action) {
if ($is_current_action && !$is_voided) {
$icon = PHUIStatusItemView::ICON_ACCEPT;
$color = 'green';
if ($authority_name !== null) {
@ -97,7 +98,12 @@ final class DifferentialReviewersView extends AphrontView {
} else {
$icon = 'fa-check-circle-o';
$color = 'bluegrey';
if ($authority_name !== null) {
if (!$is_current_action && $is_voided) {
// The reviewer accepted the revision, but later the author
// used "Request Review" to request an updated review.
$label = pht('Accepted Earlier');
} else if ($authority_name !== null) {
$label = pht('Accepted Prior Diff (by %s)', $authority_name);
} else {
$label = pht('Accepted Prior Diff');