mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
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:
parent
86dbf1d17d
commit
725e2fa410
1 changed files with 16 additions and 4 deletions
|
@ -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
|
||||||
$actor_request
|
// commit, add one explicitly. For example, this allows members
|
||||||
->setAuditStatus($status_resigned)
|
// of a project to resign from a commit and have it drop out of
|
||||||
->save();
|
// their queue.
|
||||||
|
|
||||||
|
if (!$actor_request) {
|
||||||
|
$actor_request = id(new PhabricatorRepositoryAuditRequest())
|
||||||
|
->setCommitPHID($object->getPHID())
|
||||||
|
->setAuditorPHID($actor_phid);
|
||||||
|
|
||||||
|
$requests[] = $actor_request;
|
||||||
|
$object->attachAudits($requests);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$actor_request
|
||||||
|
->setAuditStatus($status_resigned)
|
||||||
|
->save();
|
||||||
break;
|
break;
|
||||||
case PhabricatorAuditActionConstants::ACCEPT:
|
case PhabricatorAuditActionConstants::ACCEPT:
|
||||||
case PhabricatorAuditActionConstants::CONCERN:
|
case PhabricatorAuditActionConstants::CONCERN:
|
||||||
|
|
Loading…
Reference in a new issue