Skip to content

feat(integrations): Propagate ViewerContext in VSTS webhook#112413

Merged
gricha merged 2 commits intomasterfrom
gricha/feat/webhook-vc-vsts
Apr 9, 2026
Merged

feat(integrations): Propagate ViewerContext in VSTS webhook#112413
gricha merged 2 commits intomasterfrom
gricha/feat/webhook-vc-vsts

Conversation

@gricha
Copy link
Copy Markdown
Member

@gricha gricha commented Apr 7, 2026

Summary

  • Wraps the per-org iteration in handle_status_change with webhook_viewer_context so downstream code has access to the current organization identity via the ViewerContext contextvar.
  • Gated behind the viewer-context.enabled option (no-op when disabled).
  • Part of the ViewerContext RFC rollout for webhook handlers.

Wrap the per-org iteration in handle_status_change with
webhook_viewer_context so downstream code has access to
the current organization identity via the ViewerContext contextvar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gricha gricha requested review from a team as code owners April 7, 2026 21:27
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 7, 2026
@gricha gricha marked this pull request as draft April 7, 2026 21:29
@gricha gricha changed the title feat(hybridcloud): Propagate ViewerContext in VSTS webhook feat(integrations): Propagate ViewerContext in VSTS webhook Apr 7, 2026
Verify that webhook_viewer_context sets the correct organization_id
and actor_type during status change processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gricha gricha marked this pull request as ready for review April 8, 2026 23:20
ProjectManagementHaltReason.SYNC_NON_SYNC_INTEGRATION_PROVIDED,
extra=logging_context,
with webhook_viewer_context(org_integration.organization_id):
installation = integration.get_installation(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we eventually add the installation token to the viewer context as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could if it's worthwhile to be able to fetch it directly from VC, but may also be too webhook-specific

@gricha gricha merged commit 4827f21 into master Apr 9, 2026
55 checks passed
@gricha gricha deleted the gricha/feat/webhook-vc-vsts branch April 9, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants