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

Remove very old Audit status constants and AuditRequest data

Summary:
Ref T13631. See that task for discussion.

- "NONE": Probably never used?
- "CC": Obsoleted by subscribers.
- "AUDIT_NOT_REQUIRED": For Owners packages, obsoleted by edges.
- "CLOSED": For "Close Audit", obsoleted by "Request Verification".

Test Plan:
- Grepped for constants, browsed Diffusion.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13631

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

+10 -57
+5
resources/sql/autopatches/20210309.auditors.01.status.sql
··· 1 + UPDATE {$NAMESPACE}_repository.repository_auditrequest 2 + SET auditStatus = 'accepted' WHERE auditStatus = 'closed'; 3 + 4 + DELETE FROM {$NAMESPACE}_repository.repository_auditrequest 5 + WHERE auditStatus IN ('', 'cc', 'audit-not-required');
-18
src/applications/audit/constants/PhabricatorAuditStatusConstants.php
··· 2 2 3 3 final class PhabricatorAuditStatusConstants extends Phobject { 4 4 5 - const NONE = ''; 6 - const AUDIT_NOT_REQUIRED = 'audit-not-required'; 7 5 const AUDIT_REQUIRED = 'audit-required'; 8 6 const CONCERNED = 'concerned'; 9 7 const ACCEPTED = 'accepted'; 10 8 const AUDIT_REQUESTED = 'requested'; 11 9 const RESIGNED = 'resigned'; 12 - const CLOSED = 'closed'; 13 - const CC = 'cc'; 14 10 15 11 public static function getStatusNameMap() { 16 12 $map = array( 17 - self::NONE => pht('Not Applicable'), 18 - self::AUDIT_NOT_REQUIRED => pht('Audit Not Required'), 19 13 self::AUDIT_REQUIRED => pht('Audit Required'), 20 14 self::CONCERNED => pht('Concern Raised'), 21 15 self::ACCEPTED => pht('Accepted'), 22 16 self::AUDIT_REQUESTED => pht('Audit Requested'), 23 17 self::RESIGNED => pht('Resigned'), 24 - self::CLOSED => pht('Closed'), 25 - self::CC => pht("Was CC'd"), 26 18 ); 27 19 28 20 return $map; ··· 51 43 case self::ACCEPTED: 52 44 $color = 'green'; 53 45 break; 54 - case self::AUDIT_NOT_REQUIRED: 55 - $color = 'blue'; 56 - break; 57 - case self::CLOSED: 58 - $color = 'dark'; 59 - break; 60 46 case self::RESIGNED: 61 47 $color = 'grey'; 62 48 break; ··· 69 55 70 56 public static function getStatusIcon($code) { 71 57 switch ($code) { 72 - case self::AUDIT_NOT_REQUIRED: 73 - $icon = PHUIStatusItemView::ICON_OPEN; 74 - break; 75 58 case self::AUDIT_REQUIRED: 76 59 case self::AUDIT_REQUESTED: 77 60 $icon = PHUIStatusItemView::ICON_WARNING; ··· 80 63 $icon = PHUIStatusItemView::ICON_REJECT; 81 64 break; 82 65 case self::ACCEPTED: 83 - case self::CLOSED: 84 66 $icon = PHUIStatusItemView::ICON_ACCEPT; 85 67 break; 86 68 case self::RESIGNED:
-7
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 179 179 $object->attachAudits($commit->getAudits()); 180 180 181 181 $status_concerned = PhabricatorAuditStatusConstants::CONCERNED; 182 - $status_closed = PhabricatorAuditStatusConstants::CLOSED; 183 182 $status_resigned = PhabricatorAuditStatusConstants::RESIGNED; 184 183 $status_accepted = PhabricatorAuditStatusConstants::ACCEPTED; 185 184 $status_concerned = PhabricatorAuditStatusConstants::CONCERNED; ··· 491 490 } 492 491 493 492 foreach ($object->getAudits() as $audit) { 494 - if (!$audit->isInteresting()) { 495 - // Don't send mail to uninteresting auditors, like packages which 496 - // own this code but which audits have not triggered for. 497 - continue; 498 - } 499 - 500 493 if (!$audit->isResigned()) { 501 494 $phids[] = $audit->getAuditorPHID(); 502 495 }
-4
src/applications/diffusion/controller/DiffusionCommitController.php
··· 598 598 $other_requests = array(); 599 599 600 600 foreach ($audit_requests as $audit_request) { 601 - if (!$audit_request->isInteresting()) { 602 - continue; 603 - } 604 - 605 601 if ($audit_request->isUser()) { 606 602 $user_requests[] = $audit_request; 607 603 } else {
+1 -3
src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php
··· 38 38 39 39 $current = array(); 40 40 foreach ($auditors as $auditor) { 41 - if ($auditor->isInteresting()) { 42 - $current[] = $auditor->getAuditorPHID(); 43 - } 41 + $current[] = $auditor->getAuditorPHID(); 44 42 } 45 43 46 44 $allowed_types = array(
+4 -2
src/applications/diffusion/herald/DiffusionCommitAuditorsHeraldField.php
··· 22 22 23 23 $phids = array(); 24 24 foreach ($audits as $audit) { 25 - if ($audit->isActiveAudit()) { 26 - $phids[] = $audit->getAuditorPHID(); 25 + if ($audit->isResigned()) { 26 + continue; 27 27 } 28 + 29 + $phids[] = $audit->getAuditorPHID(); 28 30 } 29 31 30 32 return $phids;
-23
src/applications/repository/storage/PhabricatorRepositoryAuditRequest.php
··· 49 49 return $this->assertAttached($this->commit); 50 50 } 51 51 52 - public function isActiveAudit() { 53 - switch ($this->getAuditStatus()) { 54 - case PhabricatorAuditStatusConstants::NONE: 55 - case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED: 56 - case PhabricatorAuditStatusConstants::RESIGNED: 57 - case PhabricatorAuditStatusConstants::CLOSED: 58 - case PhabricatorAuditStatusConstants::CC: 59 - return false; 60 - } 61 - 62 - return true; 63 - } 64 - 65 - public function isInteresting() { 66 - switch ($this->getAuditStatus()) { 67 - case PhabricatorAuditStatusConstants::NONE: 68 - case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED: 69 - return false; 70 - } 71 - 72 - return true; 73 - } 74 - 75 52 public function isResigned() { 76 53 switch ($this->getAuditStatus()) { 77 54 case PhabricatorAuditStatusConstants::RESIGNED: