1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 14:21:02 +01:00

Give "x committed <commit>" 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
This commit is contained in:
epriestley 2017-06-08 05:38:42 -07:00
parent 8ef9490f66
commit e26cd3ffe0

View file

@ -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();