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

Disable Herald more aggressively when it's turned off for a repository

Summary:
Currently, disabling Herald only disables feed, notifications and email. Historically, audits didn't really create external effects so it made sense for Herald to only partially disable itself.

With the advent of Harbormaster/Build Plans, it makes more sense for Herald to just stop doing anything. When this option is disabled, stop all audit/build/publish/feed/email actions for the repository.

Test Plan: Ran `scripts/repository/reparse.php --herald`, etc.

Reviewers: dctrwatson, btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Differential Revision: https://secure.phabricator.com/D8509
This commit is contained in:
epriestley 2014-03-12 18:16:50 -07:00
parent 8a409aa40f
commit d27cd5fb99
3 changed files with 10 additions and 6 deletions

View file

@ -75,7 +75,8 @@ final class DiffusionRepositoryEditActionsController
"Normally, Phabricator publishes notifications when it discovers ".
"new commits. You can disable publishing for this repository by ".
"turning off **Notify/Publish**. This will disable notifications, ".
"feed, and Herald for this repository.".
"feed, and Herald (including audits and build plans) for this ".
"repository.".
"\n\n".
"When Phabricator discovers a new commit, it can automatically ".
"close associated revisions and tasks. If you don't want ".

View file

@ -33,6 +33,10 @@ final class PhabricatorRepositoryCommitHeraldWorker
return;
}
if ($repository->getDetail('herald-disabled')) {
return;
}
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere(
'commitID = %d',
$commit->getID());
@ -75,11 +79,6 @@ final class PhabricatorRepositoryCommitHeraldWorker
$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);
$herald_targets = $adapter->getEmailPHIDs();

View file

@ -7,6 +7,10 @@ final class PhabricatorRepositoryCommitOwnersWorker
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
if ($repository->getDetail('herald-disabled')) {
return;
}
$affected_paths = PhabricatorOwnerPathQuery::loadAffectedPaths(
$repository,
$commit,