mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 09:48:39 +01:00
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
This commit is contained in:
parent
55532b3f74
commit
2636d84d0c
7 changed files with 10 additions and 57 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
UPDATE {$NAMESPACE}_repository.repository_auditrequest
|
||||||
|
SET auditStatus = 'accepted' WHERE auditStatus = 'closed';
|
||||||
|
|
||||||
|
DELETE FROM {$NAMESPACE}_repository.repository_auditrequest
|
||||||
|
WHERE auditStatus IN ('', 'cc', 'audit-not-required');
|
|
@ -2,27 +2,19 @@
|
||||||
|
|
||||||
final class PhabricatorAuditStatusConstants extends Phobject {
|
final class PhabricatorAuditStatusConstants extends Phobject {
|
||||||
|
|
||||||
const NONE = '';
|
|
||||||
const AUDIT_NOT_REQUIRED = 'audit-not-required';
|
|
||||||
const AUDIT_REQUIRED = 'audit-required';
|
const AUDIT_REQUIRED = 'audit-required';
|
||||||
const CONCERNED = 'concerned';
|
const CONCERNED = 'concerned';
|
||||||
const ACCEPTED = 'accepted';
|
const ACCEPTED = 'accepted';
|
||||||
const AUDIT_REQUESTED = 'requested';
|
const AUDIT_REQUESTED = 'requested';
|
||||||
const RESIGNED = 'resigned';
|
const RESIGNED = 'resigned';
|
||||||
const CLOSED = 'closed';
|
|
||||||
const CC = 'cc';
|
|
||||||
|
|
||||||
public static function getStatusNameMap() {
|
public static function getStatusNameMap() {
|
||||||
$map = array(
|
$map = array(
|
||||||
self::NONE => pht('Not Applicable'),
|
|
||||||
self::AUDIT_NOT_REQUIRED => pht('Audit Not Required'),
|
|
||||||
self::AUDIT_REQUIRED => pht('Audit Required'),
|
self::AUDIT_REQUIRED => pht('Audit Required'),
|
||||||
self::CONCERNED => pht('Concern Raised'),
|
self::CONCERNED => pht('Concern Raised'),
|
||||||
self::ACCEPTED => pht('Accepted'),
|
self::ACCEPTED => pht('Accepted'),
|
||||||
self::AUDIT_REQUESTED => pht('Audit Requested'),
|
self::AUDIT_REQUESTED => pht('Audit Requested'),
|
||||||
self::RESIGNED => pht('Resigned'),
|
self::RESIGNED => pht('Resigned'),
|
||||||
self::CLOSED => pht('Closed'),
|
|
||||||
self::CC => pht("Was CC'd"),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $map;
|
return $map;
|
||||||
|
@ -51,12 +43,6 @@ final class PhabricatorAuditStatusConstants extends Phobject {
|
||||||
case self::ACCEPTED:
|
case self::ACCEPTED:
|
||||||
$color = 'green';
|
$color = 'green';
|
||||||
break;
|
break;
|
||||||
case self::AUDIT_NOT_REQUIRED:
|
|
||||||
$color = 'blue';
|
|
||||||
break;
|
|
||||||
case self::CLOSED:
|
|
||||||
$color = 'dark';
|
|
||||||
break;
|
|
||||||
case self::RESIGNED:
|
case self::RESIGNED:
|
||||||
$color = 'grey';
|
$color = 'grey';
|
||||||
break;
|
break;
|
||||||
|
@ -69,9 +55,6 @@ final class PhabricatorAuditStatusConstants extends Phobject {
|
||||||
|
|
||||||
public static function getStatusIcon($code) {
|
public static function getStatusIcon($code) {
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case self::AUDIT_NOT_REQUIRED:
|
|
||||||
$icon = PHUIStatusItemView::ICON_OPEN;
|
|
||||||
break;
|
|
||||||
case self::AUDIT_REQUIRED:
|
case self::AUDIT_REQUIRED:
|
||||||
case self::AUDIT_REQUESTED:
|
case self::AUDIT_REQUESTED:
|
||||||
$icon = PHUIStatusItemView::ICON_WARNING;
|
$icon = PHUIStatusItemView::ICON_WARNING;
|
||||||
|
@ -80,7 +63,6 @@ final class PhabricatorAuditStatusConstants extends Phobject {
|
||||||
$icon = PHUIStatusItemView::ICON_REJECT;
|
$icon = PHUIStatusItemView::ICON_REJECT;
|
||||||
break;
|
break;
|
||||||
case self::ACCEPTED:
|
case self::ACCEPTED:
|
||||||
case self::CLOSED:
|
|
||||||
$icon = PHUIStatusItemView::ICON_ACCEPT;
|
$icon = PHUIStatusItemView::ICON_ACCEPT;
|
||||||
break;
|
break;
|
||||||
case self::RESIGNED:
|
case self::RESIGNED:
|
||||||
|
|
|
@ -179,7 +179,6 @@ final class PhabricatorAuditEditor
|
||||||
$object->attachAudits($commit->getAudits());
|
$object->attachAudits($commit->getAudits());
|
||||||
|
|
||||||
$status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
|
$status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
|
||||||
$status_closed = PhabricatorAuditStatusConstants::CLOSED;
|
|
||||||
$status_resigned = PhabricatorAuditStatusConstants::RESIGNED;
|
$status_resigned = PhabricatorAuditStatusConstants::RESIGNED;
|
||||||
$status_accepted = PhabricatorAuditStatusConstants::ACCEPTED;
|
$status_accepted = PhabricatorAuditStatusConstants::ACCEPTED;
|
||||||
$status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
|
$status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
|
||||||
|
@ -491,12 +490,6 @@ final class PhabricatorAuditEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($object->getAudits() as $audit) {
|
foreach ($object->getAudits() as $audit) {
|
||||||
if (!$audit->isInteresting()) {
|
|
||||||
// Don't send mail to uninteresting auditors, like packages which
|
|
||||||
// own this code but which audits have not triggered for.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$audit->isResigned()) {
|
if (!$audit->isResigned()) {
|
||||||
$phids[] = $audit->getAuditorPHID();
|
$phids[] = $audit->getAuditorPHID();
|
||||||
}
|
}
|
||||||
|
|
|
@ -598,10 +598,6 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
$other_requests = array();
|
$other_requests = array();
|
||||||
|
|
||||||
foreach ($audit_requests as $audit_request) {
|
foreach ($audit_requests as $audit_request) {
|
||||||
if (!$audit_request->isInteresting()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($audit_request->isUser()) {
|
if ($audit_request->isUser()) {
|
||||||
$user_requests[] = $audit_request;
|
$user_requests[] = $audit_request;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -38,10 +38,8 @@ abstract class DiffusionAuditorsHeraldAction
|
||||||
|
|
||||||
$current = array();
|
$current = array();
|
||||||
foreach ($auditors as $auditor) {
|
foreach ($auditors as $auditor) {
|
||||||
if ($auditor->isInteresting()) {
|
|
||||||
$current[] = $auditor->getAuditorPHID();
|
$current[] = $auditor->getAuditorPHID();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$allowed_types = array(
|
$allowed_types = array(
|
||||||
PhabricatorPeopleUserPHIDType::TYPECONST,
|
PhabricatorPeopleUserPHIDType::TYPECONST,
|
||||||
|
|
|
@ -22,9 +22,11 @@ final class DiffusionCommitAuditorsHeraldField
|
||||||
|
|
||||||
$phids = array();
|
$phids = array();
|
||||||
foreach ($audits as $audit) {
|
foreach ($audits as $audit) {
|
||||||
if ($audit->isActiveAudit()) {
|
if ($audit->isResigned()) {
|
||||||
$phids[] = $audit->getAuditorPHID();
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$phids[] = $audit->getAuditorPHID();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $phids;
|
return $phids;
|
||||||
|
|
|
@ -49,29 +49,6 @@ final class PhabricatorRepositoryAuditRequest
|
||||||
return $this->assertAttached($this->commit);
|
return $this->assertAttached($this->commit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isActiveAudit() {
|
|
||||||
switch ($this->getAuditStatus()) {
|
|
||||||
case PhabricatorAuditStatusConstants::NONE:
|
|
||||||
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
|
|
||||||
case PhabricatorAuditStatusConstants::RESIGNED:
|
|
||||||
case PhabricatorAuditStatusConstants::CLOSED:
|
|
||||||
case PhabricatorAuditStatusConstants::CC:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isInteresting() {
|
|
||||||
switch ($this->getAuditStatus()) {
|
|
||||||
case PhabricatorAuditStatusConstants::NONE:
|
|
||||||
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isResigned() {
|
public function isResigned() {
|
||||||
switch ($this->getAuditStatus()) {
|
switch ($this->getAuditStatus()) {
|
||||||
case PhabricatorAuditStatusConstants::RESIGNED:
|
case PhabricatorAuditStatusConstants::RESIGNED:
|
||||||
|
|
Loading…
Add table
Reference in a new issue