mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Allow Herald to be disabled while importing a repository so we don't send a
billion zillion emails.
This commit is contained in:
parent
d6d8598d68
commit
40083bfa0e
4 changed files with 42 additions and 1 deletions
|
@ -240,6 +240,14 @@ class PhabricatorRepositoryEditController
|
|||
'default-owners-path',
|
||||
'/'));
|
||||
|
||||
$repository->setDetail(
|
||||
'herald-disabled',
|
||||
$request->getInt('herald-disabled', 0));
|
||||
|
||||
if ($is_svn) {
|
||||
$repository->setUUID($request->getStr('uuid'));
|
||||
}
|
||||
|
||||
$repository->setDetail(
|
||||
'detail-parser',
|
||||
$request->getStr(
|
||||
|
@ -375,6 +383,21 @@ class PhabricatorRepositoryEditController
|
|||
'/'))
|
||||
->setCaption('Default path in Owners tool.'));
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setName('herald-disabled')
|
||||
->setLabel('Herald Enabled')
|
||||
->setValue($repository->getDetail('herald-disabled', 0))
|
||||
->setOptions(
|
||||
array(
|
||||
0 => 'Enabled - Send Email',
|
||||
1 => 'Disabled - Do Not Send Email',
|
||||
))
|
||||
->setCaption(
|
||||
'You can temporarily disable Herald notifications when reparsing '.
|
||||
'a repository or importing a new repository.'));
|
||||
|
||||
$parsers = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('PhabricatorRepositoryCommitMessageDetailParser')
|
||||
->selectSymbolsWithoutLoading();
|
||||
|
@ -395,7 +418,19 @@ class PhabricatorRepositoryEditController
|
|||
->setValue(
|
||||
$repository->getDetail(
|
||||
'detail-parser',
|
||||
'PhabricatorRepositoryDefaultCommitMessageDetailParser')))
|
||||
'PhabricatorRepositoryDefaultCommitMessageDetailParser')));
|
||||
|
||||
if ($is_svn) {
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setName('uuid')
|
||||
->setLabel('UUID')
|
||||
->setValue($repository->getUUID())
|
||||
->setCaption('Repository UUID from <tt>svn info</tt>.'));
|
||||
}
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Save'));
|
||||
|
|
|
@ -16,6 +16,7 @@ phutil_require_module('phabricator', 'applications/repository/storage/repository
|
|||
phutil_require_module('phabricator', 'infrastructure/env');
|
||||
phutil_require_module('phabricator', 'view/control/table');
|
||||
phutil_require_module('phabricator', 'view/form/base');
|
||||
phutil_require_module('phabricator', 'view/form/control/select');
|
||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||
phutil_require_module('phabricator', 'view/form/control/text');
|
||||
phutil_require_module('phabricator', 'view/form/error');
|
||||
|
|
|
@ -27,6 +27,7 @@ class PhabricatorRepository extends PhabricatorRepositoryDAO {
|
|||
protected $phid;
|
||||
protected $name;
|
||||
protected $callsign;
|
||||
protected $uuid;
|
||||
|
||||
protected $versionControlSystem;
|
||||
protected $details = array();
|
||||
|
|
|
@ -23,6 +23,10 @@ class PhabricatorRepositoryCommitHeraldWorker
|
|||
PhabricatorRepository $repository,
|
||||
PhabricatorRepositoryCommit $commit) {
|
||||
|
||||
if ($repository->getDetail('herald-disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere(
|
||||
'commitID = %d',
|
||||
$commit->getID());
|
||||
|
|
Loading…
Reference in a new issue