diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -37,6 +37,24 @@ $proto_doc_name = pht('User Guide: Prototype Applications'); $applications_app_href = '/applications/'; + $silent_description = $this->deformat(pht(<<newOption('phabricator.base-uri', 'string', null) ->setLocked(true) @@ -232,21 +250,7 @@ pht('Run Normally'), )) ->setSummary(pht('Stop Phabricator from sending any email, etc.')) - ->setDescription( - pht( - 'This option allows you to stop Phabricator from sending '. - 'any data to external services. Among other things, it will '. - 'disable email, SMS, repository mirroring, and HTTP hooks.'. - "\n\n". - 'This option is intended to allow a Phabricator instance to '. - 'be exported, copied, imported, and run in a test environment '. - 'without impacting users. For example, if you are migrating '. - 'to new hardware, you could perform a test migration first, '. - 'make sure things work, and then do a production cutover '. - 'later with higher confidence and less disruption. Without '. - 'this flag, users would receive duplicate email during the '. - 'time the test instance and old production instance were '. - 'both in operation.')), + ->setDescription($silent_description), ); } diff --git a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php --- a/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterBuildStepImplementation.php @@ -295,6 +295,18 @@ ->append($body); } + protected function logSilencedCall( + HarbormasterBuild $build, + HarbormasterBuildTarget $build_target, + $label) { + + $build_target + ->newLog($label, 'silenced') + ->append( + pht( + 'Declining to make service call because `phabricator.silent` is '. + 'enabled in configuration.')); + } /* -( Automatic Targets )-------------------------------------------------- */ diff --git a/src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php --- a/src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterBuildkiteBuildStepImplementation.php @@ -72,6 +72,11 @@ HarbormasterBuildTarget $build_target) { $viewer = PhabricatorUser::getOmnipotentUser(); + if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { + $this->logSilencedCall($build, $build_target, pht('Buildkite')); + throw new HarbormasterBuildFailureException(); + } + $buildable = $build->getBuildable(); $object = $buildable->getBuildableObject(); diff --git a/src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php --- a/src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php @@ -84,6 +84,11 @@ HarbormasterBuildTarget $build_target) { $viewer = PhabricatorUser::getOmnipotentUser(); + if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { + $this->logSilencedCall($build, $build_target, pht('CircleCI')); + throw new HarbormasterBuildFailureException(); + } + $buildable = $build->getBuildable(); $object = $buildable->getBuildableObject(); diff --git a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php --- a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php @@ -43,6 +43,12 @@ HarbormasterBuildTarget $build_target) { $viewer = PhabricatorUser::getOmnipotentUser(); + + if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { + $this->logSilencedCall($build, $build_target, pht('HTTP Request')); + throw new HarbormasterBuildFailureException(); + } + $settings = $this->getSettings(); $variables = $build_target->getVariables();