@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Prevent "Call webhooks" Herald action from appearing in UI for adapters which can't fire it

Summary:
See <https://discourse.phabricator-community.org/t/herald-webhook-is-not-called-but-herald-transcript-tells-me-the-opposite/1098>.

The "Commit Hook" events don't operate on objects and don't use TransactionEditors. They can't call webhooks in a normal way and currently don't call webhooks at all. Stop offering these actions in the UI.

The "Outbound Mail" event also fires oddly and likely doesn't make much sense to hook anyway.

Test Plan: Verified that these events no longer offer "Call webhooks", while normal events still do.

Differential Revision: https://secure.phabricator.com/D19061

+17
+4
src/applications/diffusion/herald/HeraldPreCommitAdapter.php
··· 87 87 $this->hookEngine->getRepository()->getProjectPHIDs()); 88 88 } 89 89 90 + public function supportsWebhooks() { 91 + return false; 92 + } 93 + 90 94 }
+4
src/applications/herald/action/HeraldCallWebhookAction.php
··· 14 14 } 15 15 16 16 public function supportsObject($object) { 17 + if (!$this->getAdapter()->supportsWebhooks()) { 18 + return false; 19 + } 20 + 17 21 return true; 18 22 } 19 23
+5
src/applications/herald/adapter/HeraldAdapter.php
··· 1211 1211 /* -( Webhooks )----------------------------------------------------------- */ 1212 1212 1213 1213 1214 + public function supportsWebhooks() { 1215 + return true; 1216 + } 1217 + 1218 + 1214 1219 final public function queueWebhook($webhook_phid, $rule_phid) { 1215 1220 $this->webhookMap[$webhook_phid][] = $rule_phid; 1216 1221 return $this;
+4
src/applications/metamta/herald/PhabricatorMailOutboundMailHeraldAdapter.php
··· 64 64 return pht('Mail %d', $this->getObject()->getID()); 65 65 } 66 66 67 + public function supportsWebhooks() { 68 + return false; 69 + } 70 + 67 71 }