3 final class DiffusionCommitWrongBuildsHeraldField
4 extends DiffusionCommitHeraldField
{
6 const FIELDCONST
= 'diffusion.commit.builds.wrong';
8 public function getHeraldFieldName() {
9 return pht('Revision has build warning');
12 public function getFieldGroupKey() {
13 return HeraldRelatedFieldGroup
::FIELDGROUPKEY
;
16 public function getHeraldFieldValue($object) {
17 $adapter = $this->getAdapter();
18 $viewer = $adapter->getViewer();
20 $revision = $adapter->loadDifferentialRevision();
25 if ($revision->isPublished()) {
26 $wrong_builds = DifferentialRevision
::PROPERTY_WRONG_BUILDS
;
27 return !$revision->getProperty($wrong_builds, false);
30 // Reload the revision to pick up active diffs.
31 $revision = id(new DifferentialRevisionQuery())
33 ->withPHIDs(array($revision->getPHID()))
34 ->needActiveDiffs(true)
37 $concerning = DifferentialDiffExtractionEngine
::loadConcerningBuilds(
42 return (bool)$concerning;
45 protected function getHeraldFieldStandardType() {
46 return self
::STANDARD_BOOL
;