From a2453706abf1f3b60a679f427fbff612c84aeeaf Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 14 Feb 2018 11:09:57 -0800 Subject: [PATCH] When "phabricator.silent" is enabled, don't call webhooks Summary: Ref T13078. The `phabricator.silent` configuration flag should disable webhook calls, since this is consistent with the documented and desired behavior. Test Plan: Enabled `phabricator.silent`, made test hook calls, saw them fail with a "silent" failure reason. Maniphest Tasks: T13078 Differential Revision: https://secure.phabricator.com/D19084 --- src/applications/herald/worker/HeraldWebhookWorker.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/applications/herald/worker/HeraldWebhookWorker.php b/src/applications/herald/worker/HeraldWebhookWorker.php index 837ec0bb23..150f98fd50 100644 --- a/src/applications/herald/worker/HeraldWebhookWorker.php +++ b/src/applications/herald/worker/HeraldWebhookWorker.php @@ -32,6 +32,13 @@ final class HeraldWebhookWorker $status)); } + // If we're in silent mode, permanently fail the webhook request and then + // return to complete this task. + if (PhabricatorEnv::getEnvConfig('phabricator.silent')) { + $this->failRequest($request, 'hook', 'silent'); + return; + } + $hook = $request->getWebhook(); if ($hook->isDisabled()) {