feat: Action filtering for webhook apps
Problem
See https://github.com/PostHog/posthog/issues/21721 and https://github.com/PostHog/product-internal/issues/599
Needs https://github.com/PostHog/posthog/pull/22253
We want to replace the existing action webhooks with something a little more fit-for-purpose. To do this we need to:
- Support filtering plugins by actions as a config option on the plugin
- Allow webhook plugins to take care of templating the event into valid webhook content (e.g. for a slack webhook)
This PR attempts to solve problem 1
Changes
- [x] Refactors the ActionMatcher into the hub to be used by both webhook firing and composeWebhook processing
- [x] Moves reloading and pubsub into the ActionManager class as it feels more part of it.
- [x] Filters
composeWebhoookplugins by the relevant action matcher if necessary - [x] Adds option to the (legacy) UI behind a flag
- [x] Add tests for filtering logic
- [x] Ensure actions can not be deleted if they have connected plugins
đ Stay up-to-date with PostHog coding conventions for a smoother review.
Follow up
- Create issue about the
experiments/utils.pyTODO
Does this work well for both Cloud and self-hosted?
How did you test this code?
Size Change: +50 B (0%)
Total Size: 1.03 MB
âšī¸ View Unchanged
| Filename | Size | Change |
|---|---|---|
frontend/dist/toolbar.js |
1.03 MB | +50 B (0%) |
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
-
chromium: 0 added, 1 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
-
chromium: 0 added, 1 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label â otherwise this will be closed in another week.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
12 snapshot changes in total. 0 added, 12 modified, 0 deleted:
-
chromium: 0 added, 12 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
-
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
-
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
-
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1) -
webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.