1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Remove "metamta.*.subject-prefix" options

Summary:
In ~2012, the first of these options was added because someone who hates dogs and works at Asana also hated `[Differential]` in the subject line. The use case there was actually //removing// the text, not changing it, but I made the prefix editable since it seemed like slightly less of a one-off.

These options are among the dumbest and most useless config options we have and very rarely used, see T11760. A very small number of instances have configured one of these options.

Newer applications stopped providing these options and no one has complained.

You can get the same effect with `translation.override`. Although I'm not sure we'll keep that around forever, it's a reasonable replacement today. I'll call out an example in the changelog to help installs that want to preserve this option.

If we did want to provide this, it should just be in {nav Applications > Settings} for each application, but I think it's wildly-low-value and "hack via translations" or "local patch" are entirely reasonable if you really want to change these strings.

Test Plan: Grepped for `subject-prefix`.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19993
This commit is contained in:
epriestley 2019-01-17 11:52:03 -08:00
parent ff220acae6
commit c125ab7a42
29 changed files with 34 additions and 239 deletions

View file

@ -341,7 +341,6 @@ phutil_register_library_map(array(
'ConduitWildParameterType' => 'applications/conduit/parametertype/ConduitWildParameterType.php',
'ConpherenceColumnViewController' => 'applications/conpherence/controller/ConpherenceColumnViewController.php',
'ConpherenceConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceConduitAPIMethod.php',
'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php',
'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php',
'ConpherenceController' => 'applications/conpherence/controller/ConpherenceController.php',
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
@ -3333,7 +3332,6 @@ phutil_register_library_map(array(
'PhabricatorLDAPAuthProvider' => 'applications/auth/provider/PhabricatorLDAPAuthProvider.php',
'PhabricatorLabelProfileMenuItem' => 'applications/search/menuitem/PhabricatorLabelProfileMenuItem.php',
'PhabricatorLegalpadApplication' => 'applications/legalpad/application/PhabricatorLegalpadApplication.php',
'PhabricatorLegalpadConfigOptions' => 'applications/legalpad/config/PhabricatorLegalpadConfigOptions.php',
'PhabricatorLegalpadDocumentPHIDType' => 'applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php',
'PhabricatorLegalpadSignaturePolicyRule' => 'applications/legalpad/policyrule/PhabricatorLegalpadSignaturePolicyRule.php',
'PhabricatorLibraryTestCase' => '__tests__/PhabricatorLibraryTestCase.php',
@ -3362,7 +3360,6 @@ phutil_register_library_map(array(
'PhabricatorMacroAudioBehaviorTransaction' => 'applications/macro/xaction/PhabricatorMacroAudioBehaviorTransaction.php',
'PhabricatorMacroAudioController' => 'applications/macro/controller/PhabricatorMacroAudioController.php',
'PhabricatorMacroAudioTransaction' => 'applications/macro/xaction/PhabricatorMacroAudioTransaction.php',
'PhabricatorMacroConfigOptions' => 'applications/macro/config/PhabricatorMacroConfigOptions.php',
'PhabricatorMacroController' => 'applications/macro/controller/PhabricatorMacroController.php',
'PhabricatorMacroDatasource' => 'applications/macro/typeahead/PhabricatorMacroDatasource.php',
'PhabricatorMacroDisableController' => 'applications/macro/controller/PhabricatorMacroDisableController.php',
@ -3766,7 +3763,6 @@ phutil_register_library_map(array(
'PhabricatorPaste' => 'applications/paste/storage/PhabricatorPaste.php',
'PhabricatorPasteApplication' => 'applications/paste/application/PhabricatorPasteApplication.php',
'PhabricatorPasteArchiveController' => 'applications/paste/controller/PhabricatorPasteArchiveController.php',
'PhabricatorPasteConfigOptions' => 'applications/paste/config/PhabricatorPasteConfigOptions.php',
'PhabricatorPasteContentSearchEngineAttachment' => 'applications/paste/engineextension/PhabricatorPasteContentSearchEngineAttachment.php',
'PhabricatorPasteContentTransaction' => 'applications/paste/xaction/PhabricatorPasteContentTransaction.php',
'PhabricatorPasteController' => 'applications/paste/controller/PhabricatorPasteController.php',
@ -3851,7 +3847,6 @@ phutil_register_library_map(array(
'PhabricatorPhamePostPHIDType' => 'applications/phame/phid/PhabricatorPhamePostPHIDType.php',
'PhabricatorPhluxApplication' => 'applications/phlux/application/PhabricatorPhluxApplication.php',
'PhabricatorPholioApplication' => 'applications/pholio/application/PhabricatorPholioApplication.php',
'PhabricatorPholioConfigOptions' => 'applications/pholio/config/PhabricatorPholioConfigOptions.php',
'PhabricatorPholioMockTestDataGenerator' => 'applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php',
'PhabricatorPhoneNumber' => 'applications/metamta/message/PhabricatorPhoneNumber.php',
'PhabricatorPhortuneApplication' => 'applications/phortune/application/PhabricatorPhortuneApplication.php',
@ -3862,7 +3857,6 @@ phutil_register_library_map(array(
'PhabricatorPhragmentApplication' => 'applications/phragment/application/PhabricatorPhragmentApplication.php',
'PhabricatorPhrequentApplication' => 'applications/phrequent/application/PhabricatorPhrequentApplication.php',
'PhabricatorPhrictionApplication' => 'applications/phriction/application/PhabricatorPhrictionApplication.php',
'PhabricatorPhrictionConfigOptions' => 'applications/phriction/config/PhabricatorPhrictionConfigOptions.php',
'PhabricatorPhurlApplication' => 'applications/phurl/application/PhabricatorPhurlApplication.php',
'PhabricatorPhurlConfigOptions' => 'applications/config/option/PhabricatorPhurlConfigOptions.php',
'PhabricatorPhurlController' => 'applications/phurl/controller/PhabricatorPhurlController.php',
@ -5743,7 +5737,6 @@ phutil_register_library_map(array(
'ConduitWildParameterType' => 'ConduitParameterType',
'ConpherenceColumnViewController' => 'ConpherenceController',
'ConpherenceConduitAPIMethod' => 'ConduitAPIMethod',
'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions',
'ConpherenceConstants' => 'Phobject',
'ConpherenceController' => 'PhabricatorController',
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
@ -9172,7 +9165,6 @@ phutil_register_library_map(array(
'PhabricatorLDAPAuthProvider' => 'PhabricatorAuthProvider',
'PhabricatorLabelProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorLegalpadApplication' => 'PhabricatorApplication',
'PhabricatorLegalpadConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorLegalpadDocumentPHIDType' => 'PhabricatorPHIDType',
'PhabricatorLegalpadSignaturePolicyRule' => 'PhabricatorPolicyRule',
'PhabricatorLibraryTestCase' => 'PhutilLibraryTestCase',
@ -9201,7 +9193,6 @@ phutil_register_library_map(array(
'PhabricatorMacroAudioBehaviorTransaction' => 'PhabricatorMacroTransactionType',
'PhabricatorMacroAudioController' => 'PhabricatorMacroController',
'PhabricatorMacroAudioTransaction' => 'PhabricatorMacroTransactionType',
'PhabricatorMacroConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorMacroController' => 'PhabricatorController',
'PhabricatorMacroDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorMacroDisableController' => 'PhabricatorMacroController',
@ -9688,7 +9679,6 @@ phutil_register_library_map(array(
),
'PhabricatorPasteApplication' => 'PhabricatorApplication',
'PhabricatorPasteArchiveController' => 'PhabricatorPasteController',
'PhabricatorPasteConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPasteContentSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment',
'PhabricatorPasteContentTransaction' => 'PhabricatorPasteTransactionType',
'PhabricatorPasteController' => 'PhabricatorController',
@ -9773,7 +9763,6 @@ phutil_register_library_map(array(
'PhabricatorPhamePostPHIDType' => 'PhabricatorPHIDType',
'PhabricatorPhluxApplication' => 'PhabricatorApplication',
'PhabricatorPholioApplication' => 'PhabricatorApplication',
'PhabricatorPholioConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPholioMockTestDataGenerator' => 'PhabricatorTestDataGenerator',
'PhabricatorPhoneNumber' => 'Phobject',
'PhabricatorPhortuneApplication' => 'PhabricatorApplication',
@ -9784,7 +9773,6 @@ phutil_register_library_map(array(
'PhabricatorPhragmentApplication' => 'PhabricatorApplication',
'PhabricatorPhrequentApplication' => 'PhabricatorApplication',
'PhabricatorPhrictionApplication' => 'PhabricatorApplication',
'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPhurlApplication' => 'PhabricatorApplication',
'PhabricatorPhurlConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPhurlController' => 'PhabricatorController',

View file

@ -437,7 +437,7 @@ final class PhabricatorAuditEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.diffusion.subject-prefix');
return pht('[Diffusion]');
}
protected function getMailThreadID(PhabricatorLiskDAO $object) {

View file

@ -203,6 +203,11 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck {
$mailers_reason = pht(
'Inbound and outbound mail is now configured with "cluster.mailers".');
$prefix_reason = pht(
'Per-application mail subject prefix customization is no longer '.
'directly supported. Prefixes and other strings may be customized with '.
'"translation.override".');
$ancient_config += array(
'phid.external-loaders' =>
pht(
@ -398,6 +403,19 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck {
'phabricator.allow-email-users' => pht(
'Public email is now accepted if the associated address has a '.
'default author, and rejected otherwise.'),
'metamta.conpherence.subject-prefix' => $prefix_reason,
'metamta.differential.subject-prefix' => $prefix_reason,
'metamta.diffusion.subject-prefix' => $prefix_reason,
'metamta.files.subject-prefix' => $prefix_reason,
'metamta.legalpad.subject-prefix' => $prefix_reason,
'metamta.macro.subject-prefix' => $prefix_reason,
'metamta.maniphest.subject-prefix' => $prefix_reason,
'metamta.package.subject-prefix' => $prefix_reason,
'metamta.paste.subject-prefix' => $prefix_reason,
'metamta.pholio.subject-prefix' => $prefix_reason,
'metamta.phriction.subject-prefix' => $prefix_reason,
);
return $ancient_config;

View file

@ -1,32 +0,0 @@
<?php
final class ConpherenceConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Conpherence');
}
public function getDescription() {
return pht('Configure Conpherence messaging.');
}
public function getIcon() {
return 'fa-comments';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(
'metamta.conpherence.subject-prefix',
'string',
'[Conpherence]')
->setDescription(pht('Subject prefix for Conpherence mail.')),
);
}
}

View file

@ -239,7 +239,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.conpherence.subject-prefix');
return pht('[Conpherence]');
}
protected function supportsSearch() {

View file

@ -228,11 +228,6 @@ EOHELP
"\n\n".
'This sort of workflow is very unusual. Very few installs should '.
'need to change this option.')),
$this->newOption(
'metamta.differential.subject-prefix',
'string',
'[Differential]')
->setDescription(pht('Subject prefix for Differential mail.')),
$this->newOption(
'metamta.differential.attach-patches',
'bool',

View file

@ -81,8 +81,7 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher
}
private function getTitlePrefix(DifferentialRevision $revision) {
$prefix_key = 'metamta.differential.subject-prefix';
return PhabricatorEnv::getEnvConfig($prefix_key);
return pht('[Differential]');
}
}

View file

@ -563,7 +563,7 @@ final class DifferentialTransactionEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.differential.subject-prefix');
return pht('[Differential]');
}
protected function getMailThreadID(PhabricatorLiskDAO $object) {

View file

@ -69,8 +69,7 @@ final class DifferentialCreateMailReceiver
}
}
$subject_prefix =
PhabricatorEnv::getEnvConfig('metamta.differential.subject-prefix');
$subject_prefix = pht('[Differential]');
if (count($diffs)) {
$subject = pht(
'You successfully created %d diff(s).',

View file

@ -37,11 +37,6 @@ final class PhabricatorDiffusionConfigOptions
}
return array(
$this->newOption(
'metamta.diffusion.subject-prefix',
'string',
'[Diffusion]')
->setDescription(pht('Subject prefix for Diffusion mail.')),
$this->newOption(
'metamta.diffusion.attach-patches',
'bool',

View file

@ -172,8 +172,7 @@ final class DiffusionDoorkeeperCommitFeedStoryPublisher
}
private function getTitlePrefix(PhabricatorRepositoryCommit $commit) {
$prefix_key = 'metamta.diffusion.subject-prefix';
return PhabricatorEnv::getEnvConfig($prefix_key);
return pht('[Diffusion]');
}
}

View file

@ -197,11 +197,6 @@ final class PhabricatorFilesConfigOptions
"Set this to a valid Amazon S3 bucket to store files there. You ".
"must also configure S3 access keys in the 'Amazon Web Services' ".
"group.")),
$this->newOption(
'metamta.files.subject-prefix',
'string',
'[File]')
->setDescription(pht('Subject prefix for Files email.')),
$this->newOption('files.enable-imagemagick', 'bool', false)
->setBoolOptions(
array(

View file

@ -27,7 +27,7 @@ final class PhabricatorFileEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.files.subject-prefix');
return pht('[File]');
}
protected function getMailTo(PhabricatorLiskDAO $object) {

View file

@ -33,8 +33,7 @@ final class FileCreateMailReceiver
} else {
$subject = pht('You successfully uploaded a file.');
}
$subject_prefix =
PhabricatorEnv::getEnvConfig('metamta.files.subject-prefix');
$subject_prefix = pht('[File]');
$file_uris = array();
foreach ($attachment_phids as $phid) {

View file

@ -1,32 +0,0 @@
<?php
final class PhabricatorLegalpadConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Legalpad');
}
public function getDescription() {
return pht('Configure Legalpad.');
}
public function getIcon() {
return 'fa-gavel';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(
'metamta.legalpad.subject-prefix',
'string',
'[Legalpad]')
->setDescription(pht('Subject prefix for Legalpad email.')),
);
}
}

View file

@ -166,7 +166,7 @@ final class LegalpadDocumentEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.legalpad.subject-prefix');
return pht('[Legalpad]');
}

View file

@ -1,29 +0,0 @@
<?php
final class PhabricatorMacroConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Macro');
}
public function getDescription() {
return pht('Configure Macro.');
}
public function getIcon() {
return 'fa-file-image-o';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('metamta.macro.subject-prefix', 'string', '[Macro]')
->setDescription(pht('Subject prefix for Macro email.')),
);
}
}

View file

@ -57,7 +57,7 @@ final class PhabricatorMacroEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.macro.subject-prefix');
return pht('[Macro]');
}
protected function shouldPublishFeedStory(

View file

@ -459,11 +459,6 @@ EOTEXT
'%s configuration option. The default value (`90`) '.
'corresponds to the default "Needs Triage" priority.',
'maniphest.priorities')),
$this->newOption(
'metamta.maniphest.subject-prefix',
'string',
'[Maniphest]')
->setDescription(pht('Subject prefix for Maniphest mail.')),
$this->newOption('maniphest.points', $points_type, array())
->setSummary(pht('Configure point values for tasks.'))
->setDescription($points_description)

View file

@ -155,7 +155,7 @@ final class ManiphestTransactionEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.maniphest.subject-prefix');
return pht('[Maniphest]');
}
protected function getMailThreadID(PhabricatorLiskDAO $object) {

View file

@ -36,8 +36,6 @@ final class PhabricatorOwnersConfigOptions
$fields_example = id(new PhutilJSON())->encodeFormatted($fields_example);
return array(
$this->newOption('metamta.package.subject-prefix', 'string', '[Package]')
->setDescription(pht('Subject prefix for Owners email.')),
$this->newOption('owners.fields', $custom_field_type, $default_fields)
->setCustomData($field_base_class)
->setDescription(pht('Select and reorder package fields.')),

View file

@ -27,7 +27,7 @@ final class PhabricatorOwnersPackageTransactionEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.package.subject-prefix');
return pht('[Package]');
}
protected function getMailTo(PhabricatorLiskDAO $object) {

View file

@ -1,32 +0,0 @@
<?php
final class PhabricatorPasteConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Paste');
}
public function getDescription() {
return pht('Configure Paste.');
}
public function getIcon() {
return 'fa-paste';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(
'metamta.paste.subject-prefix',
'string',
'[Paste]')
->setDescription(pht('Subject prefix for Paste email.')),
);
}
}

View file

@ -41,7 +41,7 @@ final class PhabricatorPasteEditor
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.paste.subject-prefix');
return pht('[Paste]');
}
protected function getMailTo(PhabricatorLiskDAO $object) {

View file

@ -44,8 +44,7 @@ final class PasteCreateMailReceiver
return;
}
$subject_prefix =
PhabricatorEnv::getEnvConfig('metamta.paste.subject-prefix');
$subject_prefix = pht('[Paste]');
$subject = pht('You successfully created a paste.');
$paste_uri = PhabricatorEnv::getProductionURI($paste->getURI());
$body = new PhabricatorMetaMTAMailBody();

View file

@ -1,29 +0,0 @@
<?php
final class PhabricatorPholioConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Pholio');
}
public function getDescription() {
return pht('Configure Pholio.');
}
public function getIcon() {
return 'fa-camera-retro';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption('metamta.pholio.subject-prefix', 'string', '[Pholio]')
->setDescription(pht('Subject prefix for Pholio email.')),
);
}
}

View file

@ -139,7 +139,7 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
}
protected function getMailSubjectPrefix() {
return PhabricatorEnv::getEnvConfig('metamta.pholio.subject-prefix');
return pht('[Pholio]');
}
public function getMailTagsMap() {

View file

@ -1,30 +0,0 @@
<?php
final class PhabricatorPhrictionConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Phriction');
}
public function getDescription() {
return pht('Options related to Phriction (wiki).');
}
public function getIcon() {
return 'fa-book';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
return array(
$this->newOption(
'metamta.phriction.subject-prefix', 'string', '[Phriction]')
->setDescription(pht('Subject prefix for Phriction email.')),
);
}
}

View file

@ -99,7 +99,7 @@ final class PhabricatorRepositoryPushMailWorker
$body->addTextSection(pht('REFERENCES'), implode("\n", $ref_lines));
}
$prefix = PhabricatorEnv::getEnvConfig('metamta.diffusion.subject-prefix');
$prefix = pht('[Diffusion]');
$parts = array();
if ($commit_count) {