mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-26 22:48:19 +01:00
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
This commit is contained in:
parent
eaf6ca3b64
commit
ec82ad2d16
1 changed files with 15 additions and 3 deletions
|
@ -160,12 +160,19 @@ final class PhabricatorAuditEditor
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->getIsHeraldEditor()) {
|
||||||
|
$audit_requested = $xaction->getMetadataValue('auditStatus');
|
||||||
|
$audit_reason_map = $xaction->getMetadataValue('auditReasonMap');
|
||||||
|
$audit_reason = $audit_reason_map[$phid];
|
||||||
|
} else {
|
||||||
$audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED;
|
$audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED;
|
||||||
|
$audit_reason = $this->getAuditReasons($phid);
|
||||||
|
}
|
||||||
$requests[] = id (new PhabricatorRepositoryAuditRequest())
|
$requests[] = id (new PhabricatorRepositoryAuditRequest())
|
||||||
->setCommitPHID($object->getPHID())
|
->setCommitPHID($object->getPHID())
|
||||||
->setAuditorPHID($phid)
|
->setAuditorPHID($phid)
|
||||||
->setAuditStatus($audit_requested)
|
->setAuditStatus($audit_requested)
|
||||||
->setAuditReasons($this->getAuditReasons($phid))
|
->setAuditReasons($audit_reason)
|
||||||
->save();
|
->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,7 +856,12 @@ final class PhabricatorAuditEditor
|
||||||
if ($audit_phids) {
|
if ($audit_phids) {
|
||||||
$xactions[] = id(new PhabricatorAuditTransaction())
|
$xactions[] = id(new PhabricatorAuditTransaction())
|
||||||
->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS)
|
->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS)
|
||||||
->setNewValue(array_fuse(array_keys($audit_phids)));
|
->setNewValue(array_fuse(array_keys($audit_phids)))
|
||||||
|
->setMetadataValue(
|
||||||
|
'auditStatus',
|
||||||
|
PhabricatorAuditStatusConstants::AUDIT_REQUIRED)
|
||||||
|
->setMetadataValue(
|
||||||
|
'auditReasonMap', $this->auditReasonMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cc_phids = $adapter->getAddCCMap();
|
$cc_phids = $adapter->getAddCCMap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue