1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-11 16:16:14 +01:00
phorge-phorge/src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php
epriestley 9107c2e262 Deprecate the "Commit is on autoclose/permanent branch" Herald "Commit" field
Summary:
Depends on D20426. Ref T13277. The new behavior is to fire Herald only once a commit becomes reachable from a permanent ref (previously, an "Autoclose" branch).

That means that every "Commit" Herald rule implicitly has this field as a condition, and it no longer does anything.

Test Plan: Wrote a Herald rule, saw this as an option in the "Deprecated" section.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13277

Differential Revision: https://secure.phabricator.com/D20427
2019-04-18 05:32:45 -07:00

32 lines
778 B
PHP

<?php
final class DiffusionCommitAutocloseHeraldField
extends DiffusionCommitHeraldField {
const FIELDCONST = 'diffusion.commit.autoclose';
public function getFieldGroupKey() {
return HeraldDeprecatedFieldGroup::FIELDGROUPKEY;
}
public function getHeraldFieldName() {
// Herald no longer triggers until a commit is reachable from a permanent
// ref, so this condition is always true by definition.
return pht('Commit Autocloses (Deprecated)');
}
public function getHeraldFieldValue($object) {
return true;
}
public function getHeraldFieldConditions() {
return array(
HeraldAdapter::CONDITION_UNCONDITIONALLY,
);
}
public function getHeraldFieldValueType($condition) {
return new HeraldEmptyFieldValue();
}
}