Page MenuHomePhabricator

D15940.diff
No OneTemporary

D15940.diff

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -159,7 +159,17 @@
$requests = mpull($requests, null, 'getAuditorPHID');
foreach ($add as $phid) {
if (isset($requests[$phid])) {
- continue;
+ $request = $requests[$phid];
+
+ // Only update an existing request if the current status is not
+ // an interesting status.
+ if ($request->isInteresting()) {
+ continue;
+ }
+ } else {
+ $request = id(new PhabricatorRepositoryAuditRequest())
+ ->setCommitPHID($object->getPHID())
+ ->setAuditorPHID($phid);
}
if ($this->getIsHeraldEditor()) {
@@ -170,12 +180,13 @@
$audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED;
$audit_reason = $this->getAuditReasons($phid);
}
- $requests[] = id(new PhabricatorRepositoryAuditRequest())
- ->setCommitPHID($object->getPHID())
- ->setAuditorPHID($phid)
+
+ $request
->setAuditStatus($audit_requested)
->setAuditReasons($audit_reason)
->save();
+
+ $requests[$phid] = $request;
}
$object->attachAudits($requests);
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -455,7 +455,12 @@
if ($audit_requests) {
$user_requests = array();
$other_requests = array();
+
foreach ($audit_requests as $audit_request) {
+ if (!$audit_request->isInteresting()) {
+ continue;
+ }
+
if ($audit_request->isUser()) {
$user_requests[] = $audit_request;
} else {
@@ -471,7 +476,7 @@
if ($other_requests) {
$view->addProperty(
- pht('Project/Package Auditors'),
+ pht('Group Auditors'),
$this->renderAuditStatusView($other_requests));
}
}
diff --git a/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php b/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php
--- a/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php
+++ b/src/applications/diffusion/herald/DiffusionAuditorsHeraldAction.php
@@ -18,8 +18,13 @@
$object = $adapter->getObject();
$auditors = $object->getAudits();
- $auditors = mpull($auditors, null, 'getAuditorPHID');
- $current = array_keys($auditors);
+
+ $current = array();
+ foreach ($auditors as $auditor) {
+ if ($auditor->isInteresting()) {
+ $current[] = $auditor->getAuditorPHID();
+ }
+ }
$allowed_types = array(
PhabricatorPeopleUserPHIDType::TYPECONST,
diff --git a/src/applications/repository/storage/PhabricatorRepositoryAuditRequest.php b/src/applications/repository/storage/PhabricatorRepositoryAuditRequest.php
--- a/src/applications/repository/storage/PhabricatorRepositoryAuditRequest.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryAuditRequest.php
@@ -49,6 +49,16 @@
return $this->assertAttached($this->commit);
}
+ public function isInteresting() {
+ switch ($this->getAuditStatus()) {
+ case PhabricatorAuditStatusConstants::NONE:
+ case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
+ return false;
+ }
+
+ return true;
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 11:01 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384862
Default Alt Text
D15940.diff (3 KB)

Event Timeline