mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 18:08:26 +01:00
Make the "Add Auditors" Herald rules use modern transactions
Summary: Ref T10978. Convert "Add Auditors" rules in Herald to modern modular transactions. Here and in D17262 (and in the next change), I've removed "audit reasons". There are several reasons for this: - They're pretty hacky. - They store English-language (well, usually) text in the database, which can't be translated. - I think they may not be necessary. When they were written, Herald did not apply transactions, so it was less clear when Herald was doing something. In modern code, it does, so Herald auditors are clear. The owenrs/package rules are now more clear, too. I'd like to see evidence that confusion still exists before rebuilding this feature in a modern, translatable way, since I think we may not need it at all. Test Plan: Ran `bin/repository reparse --herald <commit>` to re-run Herald rules. Saw rules add auditors appropriately. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10978 Differential Revision: https://secure.phabricator.com/D17263
This commit is contained in:
parent
bc41c3f5a5
commit
4b248e3545
1 changed files with 5 additions and 12 deletions
|
@ -39,19 +39,12 @@ abstract class DiffusionAuditorsHeraldAction
|
||||||
|
|
||||||
$phids = array_fuse(array_keys($targets));
|
$phids = array_fuse(array_keys($targets));
|
||||||
|
|
||||||
// TODO: Convert this to be translatable, structured data eventually.
|
|
||||||
$reason_map = array();
|
|
||||||
foreach ($phids as $phid) {
|
|
||||||
$reason_map[$phid][] = pht('%s Triggered Audit', $rule->getMonogram());
|
|
||||||
}
|
|
||||||
|
|
||||||
$xaction = $adapter->newTransaction()
|
$xaction = $adapter->newTransaction()
|
||||||
->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS)
|
->setTransactionType(DiffusionCommitAuditorsTransaction::TRANSACTIONTYPE)
|
||||||
->setNewValue($phids)
|
->setNewValue(
|
||||||
->setMetadataValue(
|
array(
|
||||||
'auditStatus',
|
'+' => $phids,
|
||||||
PhabricatorAuditStatusConstants::AUDIT_REQUIRED)
|
));
|
||||||
->setMetadataValue('auditReasonMap', $reason_map);
|
|
||||||
|
|
||||||
$adapter->queueTransaction($xaction);
|
$adapter->queueTransaction($xaction);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue