1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Herald - make dry runs work for "apply once" rules after they have been applied

Summary: Fixes T3719

Test Plan: https://secure.phabricator.com/T3719#comment-7

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T3719

Differential Revision: https://secure.phabricator.com/D6968
This commit is contained in:
Bob Trahan 2013-09-13 11:38:49 -07:00
parent 85424e7472
commit c41c593388

View file

@ -57,11 +57,13 @@ final class HeraldEngine {
foreach ($rules as $id => $rule) { foreach ($rules as $id => $rule) {
$this->stack = array(); $this->stack = array();
try { try {
if (($rule->getRepetitionPolicy() == if (!$this->getDryRun() &&
($rule->getRepetitionPolicy() ==
HeraldRepetitionPolicyConfig::FIRST) && HeraldRepetitionPolicyConfig::FIRST) &&
$rule->getRuleApplied($object->getPHID())) { $rule->getRuleApplied($object->getPHID())) {
// This rule is only supposed to be applied a single time, and it's // This is not a dry run, and this rule is only supposed to be
// aleady been applied, so this is an automatic failure. // applied a single time, and it's already been applied...
// That means automatic failure.
$xscript = id(new HeraldRuleTranscript()) $xscript = id(new HeraldRuleTranscript())
->setRuleID($id) ->setRuleID($id)
->setResult(false) ->setResult(false)