Skip to content

fix(code-review): Disable direct-to-seer ghe on-prem flow#105985

Merged
armenzg merged 2 commits intomasterfrom
sshin/disable-ghe
Jan 9, 2026
Merged

fix(code-review): Disable direct-to-seer ghe on-prem flow#105985
armenzg merged 2 commits intomasterfrom
sshin/disable-ghe

Conversation

@suejung-sentry
Copy link
Copy Markdown
Contributor

@suejung-sentry suejung-sentry commented Jan 9, 2026

GitHub Enterprise on-prem webhooks are currently flowing through our new stuff for the overwatch migration project (getting filtered out, but still getting further than we want, so add this additional check upstream).

inheritance chain

GitHubEnterprisePullRequestEventWebhook
    ├── GitHubEnterpriseWebhook (mixin - provides provider="github_enterprise")
    └── PullRequestEventWebhook (from github/webhook.py)
            └── GitHubWebhook (base class)
                    └── WEBHOOK_EVENT_PROCESSORS = (
                            _handle_pr_webhook_for_autofix_processor,
                            code_review_handle_webhook_event,  ← This is what got called and caused sentry issue SENTRY-5GEH
                        )

I saw an unexpected sentry issue with this PR because we assumed the github_event was GitHubWebhookType here, but actually it's of type string for github enterprise on-prem inherited provider code here. So technically the type hint was wrong in the case of ghe on-prem.

When we go to support GitHub Enterprise on-prem provider we can make any necessary adjustments there and anywhere else needed to fully support that flow end-to-end.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 9, 2026
Copy link
Copy Markdown
Member

@armenzg armenzg left a comment

Choose a reason for hiding this comment

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

Well done!

@armenzg armenzg merged commit a3f13e9 into master Jan 9, 2026
66 checks passed
@armenzg armenzg deleted the sshin/disable-ghe branch January 9, 2026 12:57
suejung-sentry pushed a commit that referenced this pull request Jan 9, 2026
(Note a previous
[version](#105587) of this was
[reverted](4dd9584).
This is the un-revert-the-revert PR that avoids the sentry
[issue](https://sentry.sentry.io/issues/7173671530/?project=1&query=%21error.type%3AThreadLeakAssertionError%20code_review%20is%3Aunresolved&referrer=issue-stream)
that arose by waiting for this
[fix](#105985) to disable ghe
on-prem to go in first.)
___________

Unifies the metrics structure for what we can use across all our code
review metrics handlers.

Updates check_run, issue_comment, and task scheduling to emit the
handler-stage funnel metrics:
* `sentry.seer.code_review.webhook.received`
* `sentry.seer.code_review.webhook.filtered` (tagged with `reason`:
CodeReviewFilteredReason)
* `sentry.seer.code_review.webhook.enqueued`
* `sentry.seer.code_review.webhook.error` (tagged with `error_type`:
CodeReviewErrorType)

Ensures all handler metrics share common tags:
* `github_event`, `github_event_action` (so we can track like
pull_request.opened vs. issue_comment.created)

Task execution metrics stay as-is in webhooks/task.py
(`sentry.seer.code_review.task.error`,
`sentry.seer.code_review.task.e2e_latency`)

Closes
[CW-105](https://linear.app/getsentry/issue/CW-105/standardize-webhook-metrics-and-helpers-for-code-review)

I plan to add these Datadog dashboards

```
# Total Webhooks Received (24h)
sum:sentry.seer.code_review.webhook.received{*}.as_count()

# Enqueue Rate
(sum:sentry.seer.code_review.webhook.enqueued{*}.as_count() /
 sum:sentry.seer.code_review.webhook.received{*}.as_count()) * 100

# Avg E2E Latency (ms)
avg:sentry.seer.code_review.task.e2e_latency{*}

# Error Count (24h)
sum:sentry.seer.code_review.webhook.error{*}.as_count() +
sum:sentry.seer.code_review.task.error{*}.as_count()

```

```
Processing Funnel (Top List or Funnel Chart)
sum:sentry.seer.code_review.webhook.received{*} by {github_event,github_event_action}.as_count()
sum:sentry.seer.code_review.webhook.enqueued{*} by {github_event,github_event_action}.as_count()
sum:sentry.seer.code_review.task.completed{*} by {github_event,github_event_action}.as_count()
```

```
Volume by Event Type and Action (Timeseries)
# By event type
sum:sentry.seer.code_review.webhook.received{*} by {github_event}.as_count()

# By specific action (e.g., check_run rerequests)
sum:sentry.seer.code_review.webhook.received{github_event:check_run,github_event_action:rerequested}.as_count()

# By issue_comment created
sum:sentry.seer.code_review.webhook.received{github_event:issue_comment,github_event_action:created}.as_count()

```

```
E2E Latency Distribution (Heatmap)
avg:sentry.seer.code_review.task.e2e_latency{*}

Latency Percentiles (Timeseries)
p50:sentry.seer.code_review.task.e2e_latency{*}
p95:sentry.seer.code_review.task.e2e_latency{*}
p99:sentry.seer.code_review.task.e2e_latency{*}

Handler Errors by Type (Top List)
sum:sentry.seer.code_review.webhook.error{*} by {error_type}.as_count()

Task Errors by Exception Type (Top List)
sum:sentry.seer.code_review.task.error{*} by {error_status}.as_count()

Filter Reasons (Pie Chart)
sum:sentry.seer.code_review.webhook.filtered{*} by {reason}.as_count()
```

this is also a draft
[doc](https://www.notion.so/sentry/Code-Review-Observability-2dc8b10e4b5d80ef87e6c8a28cd820a7?source=copy_link)
started that I can update once we're stabilized
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants