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

Audit / Herald - make audits added via herald "required"

Summary: as opposed to "requested". Also re-jigger how the "reason" works so the herald editor can get more specific data rather than a generic message. Fixes T6345 along with companion diff D10726.

Test Plan: made a herald rule to add auditors to a commit and saw it work!

Reviewers: epriestley, chad

Reviewed By: chad

Subscribers: Korvin, epriestley

Maniphest Tasks: T6345

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

+15 -3
+15 -3
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 160 160 continue; 161 161 } 162 162 163 - $audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED; 163 + if ($this->getIsHeraldEditor()) { 164 + $audit_requested = $xaction->getMetadataValue('auditStatus'); 165 + $audit_reason_map = $xaction->getMetadataValue('auditReasonMap'); 166 + $audit_reason = $audit_reason_map[$phid]; 167 + } else { 168 + $audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED; 169 + $audit_reason = $this->getAuditReasons($phid); 170 + } 164 171 $requests[] = id (new PhabricatorRepositoryAuditRequest()) 165 172 ->setCommitPHID($object->getPHID()) 166 173 ->setAuditorPHID($phid) 167 174 ->setAuditStatus($audit_requested) 168 - ->setAuditReasons($this->getAuditReasons($phid)) 175 + ->setAuditReasons($audit_reason) 169 176 ->save(); 170 177 } 171 178 ··· 849 856 if ($audit_phids) { 850 857 $xactions[] = id(new PhabricatorAuditTransaction()) 851 858 ->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS) 852 - ->setNewValue(array_fuse(array_keys($audit_phids))); 859 + ->setNewValue(array_fuse(array_keys($audit_phids))) 860 + ->setMetadataValue( 861 + 'auditStatus', 862 + PhabricatorAuditStatusConstants::AUDIT_REQUIRED) 863 + ->setMetadataValue( 864 + 'auditReasonMap', $this->auditReasonMap); 853 865 } 854 866 855 867 $cc_phids = $adapter->getAddCCMap();