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

Ignore "Auditors: author" when inferring auditors from commit messages

Summary:
Fixes T12406. When importing commits, we automatically add auditors if the message lists "Auditors: username".

If the list of auditors includes the commit author, this edit fails because you can't audit your own commits (previously, you sometimes could and/or we didn't validate).

Instead, just ignore "Auditors: author".

Test Plan:
- Made a commit with "Auditors: epriestley".
- Pushed it.
- Saw the HeraldWorker get stuck with the error in T12406.
- Applied the change; worker now succeeded.

Reviewers: chad

Reviewed By: chad

Subscribers: alexmv

Maniphest Tasks: T12406

Differential Revision: https://secure.phabricator.com/D17507

+12
+12
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 306 306 307 307 $field_key = DifferentialAuditorsCommitMessageField::FIELDKEY; 308 308 $phids = idx($result, $field_key, null); 309 + 310 + if (!$phids) { 311 + return array(); 312 + } 313 + 314 + // If a commit lists its author as an auditor, just pretend it does not. 315 + foreach ($phids as $key => $phid) { 316 + if ($phid == $commit->getAuthorPHID()) { 317 + unset($phids[$key]); 318 + } 319 + } 320 + 309 321 if (!$phids) { 310 322 return array(); 311 323 }