feat(webhook): detect event type from payload.action field - #59676
Closed
TimCrooker wants to merge 1 commit into
Closed
feat(webhook): detect event type from payload.action field#59676TimCrooker wants to merge 1 commit into
TimCrooker wants to merge 1 commit into
Conversation
The webhook event type detection chain currently checks headers
(X-GitHub-Event, X-GitLab-Event) and payload fields (event_type,
type), but does not check payload.action — the field used by Sentry,
PagerDuty, and many other services to discriminate events.
This adds payload.get("action", "") to the fallback chain so that
webhooks from services that use 'action' as the event discriminator
are correctly routed through event-type filters rather than falling
through to 'unknown'.
Contributor
|
Thanks for this PR — webhook payload filtering has now landed on main via #60944 (salvage of @evelynburger's #57544), which generalizes this: route-level payload filters ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The webhook event type detection chain currently checks
X-GitHub-Event,X-GitLab-Event,payload.event_type, andpayload.type— but does not checkpayload.action, the field used by Sentry, PagerDuty, and many other services to discriminate events.Change
Adds
payload.get("action", "")to the fallback chain so services that useactionas the event discriminator are correctly routed.Testing
Tested with live Sentry webhook events through a Hermes gateway instance. Before this change, Sentry
error.createdevents were classified asunknownand ignored by event-type filters. After this change, they are correctly identified aserror.createdand routed to the appropriate agent run.Compatibility
actionfield is checked after all existing fields, so GitHub (X-GitHub-Event), GitLab (X-GitLab-Event), and services usingevent_type/typeare unaffected.