Repository navigation
feat(integrations): Set ViewerContext on webhook handlers - #112284
Merged
Merged
Conversation
gricha
marked this pull request as ready for review
April 6, 2026 22:24
gricha
force-pushed
the
gricha/feat/webhook-viewer-context
branch
from
April 6, 2026 22:35
355b655 to
715d0ce
Compare
gricha
force-pushed
the
gricha/feat/webhook-viewer-context
branch
from
April 7, 2026 01:32
715d0ce to
4227003
Compare
Add webhook_viewer_context() helper that wraps webhook per-org processing in a viewer_context_scope with actor_type=INTEGRATION. Gated behind the viewer-context.enabled option. Wired into GitHub, GitLab, Bitbucket, Bitbucket Server, and Cursor webhook handlers at the point where organization_id is known. Remaining integrations (Slack, Jira Server, MS Teams, Vercel) resolve the org deeper in the stack and need separate work. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gricha
force-pushed
the
gricha/feat/webhook-viewer-context
branch
from
April 7, 2026 16:51
4227003 to
fdef6fd
Compare
JoshFerge
approved these changes
Apr 7, 2026
george-sentry
pushed a commit
that referenced
this pull request
Apr 9, 2026
Add `webhook_viewer_context(org_id)` helper that wraps webhook per-org processing in `viewer_context_scope` with `actor_type=INTEGRATION`. Gated behind the `viewer-context.enabled` option so it rolls out with the rest of the ViewerContext infrastructure. Wired into 5 webhook handlers at the point where `organization_id` is known: - **GitHub** — inside per-repo loop in `GitHubWebhook.__call__` - **GitLab** — inside per-install loop in `GitlabWebhookEndpoint.post` - **Bitbucket** — wrapping handler call (org from URL param) - **Bitbucket Server** — wrapping handler call (org from URL param) - **Cursor** — wrapping `_process_webhook` (org from URL param) Remaining integrations (Slack, Jira Server, MS Teams, Vercel) resolve the organization deeper in the stack and need separate work — they're tracked but not in scope here. Part of the [ViewerContext RFC](https://www.notion.so/sentry/RFC-Unified-ViewerContext-via-ContextVar-32f8b10e4b5d81988625cb5787035e02). --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add
webhook_viewer_context(org_id)helper that wraps webhook per-org processing inviewer_context_scopewithactor_type=INTEGRATION. Gated behind theviewer-context.enabledoption so it rolls out with the rest of the ViewerContext infrastructure.Wired into 5 webhook handlers at the point where
organization_idis known:GitHubWebhook.__call__GitlabWebhookEndpoint.post_process_webhook(org from URL param)Remaining integrations (Slack, Jira Server, MS Teams, Vercel) resolve the organization deeper in the stack and need separate work — they're tracked but not in scope here.
Part of the ViewerContext RFC.