feat(integrations): Propagate ViewerContext in VSTS webhook#112413
Merged
feat(integrations): Propagate ViewerContext in VSTS webhook#112413
Conversation
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>
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>
JoshFerge
approved these changes
Apr 9, 2026
JoshFerge
reviewed
Apr 9, 2026
| ProjectManagementHaltReason.SYNC_NON_SYNC_INTEGRATION_PROVIDED, | ||
| extra=logging_context, | ||
| with webhook_viewer_context(org_integration.organization_id): | ||
| installation = integration.get_installation( |
Member
There was a problem hiding this comment.
will we eventually add the installation token to the viewer context as well?
Member
Author
There was a problem hiding this comment.
We could if it's worthwhile to be able to fetch it directly from VC, but may also be too webhook-specific
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
handle_status_changewithwebhook_viewer_contextso downstream code has access to the current organization identity via the ViewerContext contextvar.viewer-context.enabledoption (no-op when disabled).