Skip to content

fix(seer): Run SCM-stream PR iteration as the org's integration - #128961

Merged
gricha merged 1 commit into
masterfrom
fix/pr-iteration-viewer-context
Oct 27, 2026
Merged

gricha merged 1 commit into
masterfrom
fix/pr-iteration-viewer-context

Conversation

@gricha

@gricha gricha commented Oct 27, 2026

Copy link
Copy Markdown
Member

Runs the GitHub PR-iteration work on the SCM stream under webhook_viewer_context(org) (INTEGRATION + org), the same context the legacy GitHub webhook handlers set.

GitHub webhooks are anonymous. Until #128931 the middleware gave them an UNKNOWN viewer context, which rode the task headers into process_pr_iteration_check_suite and trigger_pr_iteration_from_review and satisfied the ambient-context check from #126918. With UNKNOWN gone those tasks have no context, so every Seer call raises MissingViewerContextError (SENTRY-5ZE4, s4s2 only so far; DE/US get it on their next deploy).

  • Review listener: dispatches each per-org task inside that org's context, so the task inherits it through its header.
  • Check-suite task: the org isn't known until Seer finds the run, so each candidate lookup runs as that candidate's org, and the work after resolution (including the consume task it schedules) runs as the resolved org.

listeners/check_suite.py is mostly re-indentation; review with whitespace hidden.

Comment and pause tasks were already covered, because the legacy GitHub webhook dispatches them inside webhook_viewer_context.

Fixes SENTRY-5ZE4

GitHub webhooks are anonymous, so after #128931 the SCM stream listeners
dispatch PR-iteration tasks with no viewer context and every Seer call
raises MissingViewerContextError (#126918).

Fixes SENTRY-5ZE4
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 27, 2026
@gricha
gricha marked this pull request as ready for review October 27, 2026 22:05
@gricha
gricha requested a review from a team as a code owner October 27, 2026 22:05
@gricha
gricha merged commit a6e09b4 into master Oct 27, 2026
70 checks passed
@gricha
gricha deleted the fix/pr-iteration-viewer-context branch October 27, 2026 22:13
gricha added a commit that referenced this pull request Oct 28, 2026
Reverts #128931 (back to sentry-viewercontext 0.2.0 and the `UNKNOWN`
actor for anonymous requests).

Rolling it out leaves regions half-deployed: old pods send `"unknown"`
that new pods can't read, and new pods send no context where old pods
expect one. That is failing Autofix PR iteration (SENTRY-5ZE4) in US,
which is paused mid-canary, and flooding SENTRY-5Z86.

Keeps #128961 and #128970. The only conflict was the RPC test #128970
added for an unparseable `unknown` actor, which no longer applies on
0.2.0.

Seer half: getsentry/seer#9159.
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