From e26cd3ffe0f9d656535c85a66085f21ab4e612ec Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 8 Jun 2017 05:38:42 -0700 Subject: [PATCH] Give "x committed " feed stories an explicitly higher action strength than other transactions Summary: Fixes T12811. The issue here //appears// to be that both the "alice committed rXYZabc" and "Herald added projects..." actions have the same (default) strength and end up applying in arbitrary order, and probably got shuffled around as this transitioned to Modular transactions. Give "alice committed rXYZabc" an explicitly higher action strength. Test Plan: - Wrote an "Always, add project X" Herald rule for commits. - Ran `bin/repository reparse --herald ...`. - Saw an "alice committed rXYZabc" story instead of a "Herald added projects: X" story. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12811 Differential Revision: https://secure.phabricator.com/D18104 --- .../audit/storage/PhabricatorAuditTransaction.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php index d09bdb76ce..ad96edb3a4 100644 --- a/src/applications/audit/storage/PhabricatorAuditTransaction.php +++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php @@ -49,6 +49,17 @@ final class PhabricatorAuditTransaction return $blocks; } + public function getActionStrength() { + $type = $this->getTransactionType(); + + switch ($type) { + case self::TYPE_COMMIT: + return 3.0; + } + + return parent::getActionStrength(); + } + public function getRequiredHandlePHIDs() { $phids = parent::getRequiredHandlePHIDs();