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

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

+16 -4
+16 -4
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 161 161 $requests = mpull($requests, null, 'getAuditorPHID'); 162 162 $actor_request = idx($requests, $actor_phid); 163 163 164 - if ($actor_request) { 165 - $actor_request 166 - ->setAuditStatus($status_resigned) 167 - ->save(); 164 + // If the actor doesn't currently have a relationship to the 165 + // commit, add one explicitly. For example, this allows members 166 + // of a project to resign from a commit and have it drop out of 167 + // their queue. 168 + 169 + if (!$actor_request) { 170 + $actor_request = id(new PhabricatorRepositoryAuditRequest()) 171 + ->setCommitPHID($object->getPHID()) 172 + ->setAuditorPHID($actor_phid); 173 + 174 + $requests[] = $actor_request; 175 + $object->attachAudits($requests); 168 176 } 177 + 178 + $actor_request 179 + ->setAuditStatus($status_resigned) 180 + ->save(); 169 181 break; 170 182 case PhabricatorAuditActionConstants::ACCEPT: 171 183 case PhabricatorAuditActionConstants::CONCERN: