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

In the Herald test console, don't consider transactions that Herald rules applied

Summary:
Depends on D20546. Ref T13283. Currently, if you do something (transactions "A", "B") and Herald does some things in response (transaction "C"), Herald acts only on the things you did ("A", "B") since the thing it did ("C") didn't exist yet, until it ran.

However, if you use the test console to test rules against the object we'll pick up all three transactions since they're all part of the same group. This isn't ideal.

To fix this, skip transactions which Herald applied, since it obviously didn't consider them when it was evaluating.

Test Plan:
- Created a revision, in the presence of a Herald rule that adds reviewers.
- Then, ran the revision through the test console.
- Before: saw the "Herald added reviewers: ..." transaction in the transaction group Herald evaluated.
- After: saw only authentic human transactions.

{F6464064}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13283

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

+10
+10
src/applications/herald/controller/HeraldTestConsoleController.php
··· 271 271 $recent_id = null; 272 272 $hard_limit = 1000; 273 273 foreach ($xactions as $xaction) { 274 + 275 + // If this transaction has Herald transcript metadata, it was applied by 276 + // Herald. Exclude it from the list because the Herald rule engine always 277 + // runs before Herald transactions apply, so there's no way that real 278 + // rules would have seen this transaction. 279 + $transcript_id = $xaction->getMetadataValue('herald:transcriptID'); 280 + if ($transcript_id !== null) { 281 + continue; 282 + } 283 + 274 284 $group_id = $xaction->getTransactionGroupID(); 275 285 276 286 // If this is the first transaction, save the group ID: we want to