Differential D8509 Diff 20200 src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php
Show All 27 Lines | private function applyHeraldRules( | ||||
// Don't take any actions on an importing repository. Principally, this | // Don't take any actions on an importing repository. Principally, this | ||||
// avoids generating thousands of audits or emails when you import an | // avoids generating thousands of audits or emails when you import an | ||||
// established repository on an existing install. | // established repository on an existing install. | ||||
if ($repository->isImporting()) { | if ($repository->isImporting()) { | ||||
return; | return; | ||||
} | } | ||||
if ($repository->getDetail('herald-disabled')) { | |||||
return; | |||||
} | |||||
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( | $data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( | ||||
'commitID = %d', | 'commitID = %d', | ||||
$commit->getID()); | $commit->getID()); | ||||
if (!$data) { | if (!$data) { | ||||
throw new PhabricatorWorkerPermanentFailureException( | throw new PhabricatorWorkerPermanentFailureException( | ||||
pht( | pht( | ||||
'Unable to load commit data. The data for this task is invalid '. | 'Unable to load commit data. The data for this task is invalid '. | ||||
Show All 26 Lines | private function applyHeraldRules( | ||||
HarbormasterBuildable::applyBuildPlans( | HarbormasterBuildable::applyBuildPlans( | ||||
$commit->getPHID(), | $commit->getPHID(), | ||||
$repository->getPHID(), | $repository->getPHID(), | ||||
$adapter->getBuildPlans()); | $adapter->getBuildPlans()); | ||||
$explicit_auditors = $this->createAuditsFromCommitMessage($commit, $data); | $explicit_auditors = $this->createAuditsFromCommitMessage($commit, $data); | ||||
if ($repository->getDetail('herald-disabled')) { | |||||
// This just means "disable email"; audits are (mostly) idempotent. | |||||
return; | |||||
} | |||||
$this->publishFeedStory($repository, $commit, $data); | $this->publishFeedStory($repository, $commit, $data); | ||||
$herald_targets = $adapter->getEmailPHIDs(); | $herald_targets = $adapter->getEmailPHIDs(); | ||||
$email_phids = array_unique( | $email_phids = array_unique( | ||||
array_merge( | array_merge( | ||||
$explicit_auditors, | $explicit_auditors, | ||||
array_keys($cc_phids), | array_keys($cc_phids), | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |