mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Differential - make diffs you authored + are reviewer for show up in appropos boxes
Summary: Fixes T2328. Note the audit part is fixed now. Test Plan: Tried to reproduce the audit issue by raising my own commit as a problem; it showed up before code changes! Made a diff with my self as author and reviewer; it showed up as expected Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T2328 Differential Revision: https://secure.phabricator.com/D8755
This commit is contained in:
parent
499f66963d
commit
f86ab666f6
1 changed files with 12 additions and 3 deletions
|
@ -1030,11 +1030,11 @@ final class DifferentialRevisionQuery
|
|||
|
||||
$viewer = $this->getViewer();
|
||||
$viewer_phid = $viewer->getPHID();
|
||||
$allow_key = 'differential.allow-self-accept';
|
||||
$allow_self = PhabricatorEnv::getEnvConfig($allow_key);
|
||||
|
||||
// Figure out which of these reviewers the viewer has authority to act as.
|
||||
if ($this->needReviewerAuthority && $viewer_phid) {
|
||||
$allow_key = 'differential.allow-self-accept';
|
||||
$allow_self = PhabricatorEnv::getEnvConfig($allow_key);
|
||||
$authority = $this->loadReviewerAuthority(
|
||||
$revisions,
|
||||
$edges,
|
||||
|
@ -1072,7 +1072,6 @@ final class DifferentialRevisionQuery
|
|||
}
|
||||
|
||||
|
||||
|
||||
public static function splitResponsible(array $revisions, array $user_phids) {
|
||||
$blocking = array();
|
||||
$active = array();
|
||||
|
@ -1087,6 +1086,11 @@ final class DifferentialRevisionQuery
|
|||
$filter_is_author = in_array($revision->getAuthorPHID(), $user_phids);
|
||||
if (!$revision->getReviewers()) {
|
||||
$needs_review = false;
|
||||
$author_is_reviewer = false;
|
||||
} else {
|
||||
$author_is_reviewer = in_array(
|
||||
$revision->getAuthorPHID(),
|
||||
$revision->getReviewers());
|
||||
}
|
||||
|
||||
// If exactly one of "needs review" and "the user is the author" is
|
||||
|
@ -1098,6 +1102,11 @@ final class DifferentialRevisionQuery
|
|||
} else {
|
||||
$active[] = $revision;
|
||||
}
|
||||
// User is author **and** reviewer. An exotic but configurable workflow.
|
||||
// User needs to act on it double.
|
||||
} else if ($needs_review && $author_is_reviewer) {
|
||||
array_unshift($blocking, $revision);
|
||||
$active[] = $revision;
|
||||
} else {
|
||||
$waiting[] = $revision;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue