Write a "resign" audit relationship even if actor has no relationship
Summary: Ref T4896. I got this logic slightly wrong when porting it over: we always want to write this relationship, to allow members of a project with an audit request against a commit to resign and get it out of their queue. Test Plan: - Resigned from a commit with an existing relationship. - Resigned from a commit with no existing relationship, saw one added. Reviewers: btrahan, joshuaspence, mbishopim3 Reviewed By: mbishopim3 Subscribers: epriestley Maniphest Tasks: T4896 Differential Revision: https://secure.phabricator.com/D10137
This commit is contained in:
@@ -161,11 +161,23 @@ final class PhabricatorAuditEditor
|
|||||||
$requests = mpull($requests, null, 'getAuditorPHID');
|
$requests = mpull($requests, null, 'getAuditorPHID');
|
||||||
$actor_request = idx($requests, $actor_phid);
|
$actor_request = idx($requests, $actor_phid);
|
||||||
|
|
||||||
if ($actor_request) {
|
// If the actor doesn't currently have a relationship to the
|
||||||
|
// commit, add one explicitly. For example, this allows members
|
||||||
|
// of a project to resign from a commit and have it drop out of
|
||||||
|
// their queue.
|
||||||
|
|
||||||
|
if (!$actor_request) {
|
||||||
|
$actor_request = id(new PhabricatorRepositoryAuditRequest())
|
||||||
|
->setCommitPHID($object->getPHID())
|
||||||
|
->setAuditorPHID($actor_phid);
|
||||||
|
|
||||||
|
$requests[] = $actor_request;
|
||||||
|
$object->attachAudits($requests);
|
||||||
|
}
|
||||||
|
|
||||||
$actor_request
|
$actor_request
|
||||||
->setAuditStatus($status_resigned)
|
->setAuditStatus($status_resigned)
|
||||||
->save();
|
->save();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PhabricatorAuditActionConstants::ACCEPT:
|
case PhabricatorAuditActionConstants::ACCEPT:
|
||||||
case PhabricatorAuditActionConstants::CONCERN:
|
case PhabricatorAuditActionConstants::CONCERN:
|
||||||
|
|||||||
Reference in New Issue
Block a user