Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/herald/HeraldCommitAdapter.php
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | if ($object instanceof PhabricatorProject) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function getTriggerObjectPHIDs() { | public function getTriggerObjectPHIDs() { | ||||
| $project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; | $project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; | ||||
| return array_merge( | $repository_phid = $this->getRepository()->getPHID(); | ||||
| array( | $commit_phid = $this->getObject()->getPHID(); | ||||
| $this->getRepository()->getPHID(), | |||||
| $this->getPHID(), | $phids = array(); | ||||
| ), | $phids[] = $commit_phid; | ||||
| $this->loadEdgePHIDs($project_type)); | $phids[] = $repository_phid; | ||||
| // NOTE: This is projects for the repository, not for the commit. When | |||||
| // Herald evalutes, commits normally can not have any project tags yet. | |||||
| $repository_project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | |||||
| $repository_phid, | |||||
| $project_type); | |||||
| foreach ($repository_project_phids as $phid) { | |||||
| $phids[] = $phid; | |||||
| } | |||||
| $phids = array_unique($phids); | |||||
| $phids = array_values($phids); | |||||
| return $phids; | |||||
| } | } | ||||
| public function explainValidTriggerObjects() { | public function explainValidTriggerObjects() { | ||||
| return pht('This rule can trigger for **repositories** and **projects**.'); | return pht('This rule can trigger for **repositories** and **projects**.'); | ||||
| } | } | ||||
| public function getHeraldName() { | public function getHeraldName() { | ||||
| return $this->commit->getMonogram(); | return $this->commit->getMonogram(); | ||||
| ▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines | |||||