Skip to content

ref(control): Baseline the GitHub own-repo-PR check drop to on - #121954

Merged
vaind merged 1 commit into
masterfrom
ivandlugos/cw-1838-baseline-drop-checks-without-own-repo-pr
Aug 24, 2026
Merged

vaind merged 1 commit into
masterfrom
ivandlugos/cw-1838-baseline-drop-checks-without-own-repo-pr

Conversation

@vaind

@vaind vaind commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Moves the rolled-out value of hybridcloud.webhookpayload.github_drop_checks_without_own_repo_pr into the registered default, so the automator can drop its temporary control-silo override (options#9218).

Baseline, not removal: the option stays registered and the parser keeps reading it, so setting it false is still the revert and needs no deploy.

Why

The drop (#121719) shipped off behind an option because its predicate reads payload shape rather than a header — if it were wrong, real check activity would silently stop being recorded. Two days on the control silo say it is right. Same-clock 11:58–12:55Z windows, which avoids attributing the European CI ramp to the change:

Signal 08-13 vs 08-12 08-13 vs 08-11 (pre-toggle)
check.activity_recorded check_run +2.2% metric did not exist
check.activity_recorded check_suite +1.8% metric did not exist
forwarded_event check_run has_own_repo_pr:true +3.3% +5.4%
forwarded_event check_suite has_own_repo_pr:true +2.3% +0.8%
deliver_webhooks.saved provider:github +0.7% −18.3%

The self-normalizing test — recorded activity over forwarded events, which cancels out traffic volume — never stepped at the cutover: check_run held 0.72–0.88 and check_suite 0.73–0.92 across 30 hours spanning the toggle. has_own_repo_pr:false has emitted nothing since 11:57Z on 08-12, one minute before these windows open. Net effect: roughly 18% fewer GitHub webhookpayload rows/day — about 14% of all rows, since GitHub is not the only provider writing them.

Blast radius

Control silo only. IntegrationControlMiddleware._should_operate returns early unless SiloMode is CONTROL, so region, single-tenant, and self-hosted deployments never reach this parser whatever the default says. The control silo already runs true via the automator, so no live behavior changes here — only where the value comes from.

Tests

Six tests depended on the old default:

  • The two ..._is_forwarded_by_default tests become ..._is_dropped_by_default, each gaining an explicit option: False counterpart covering the kill switch.
  • Three forwarded_event metric tests asserting has_own_repo_pr:"false" now pin the option off — with the drop on, that tag is unreachable.
  • test_forwards_check_run_completed / test_forwards_check_suite_completed now carry an own-repo PR, so they exercise the mailbox routing that production actually takes.

tests/sentry/middleware/integrations/ passes, 174 tests.

Merge order

Deploy this to all regions before merging options#9218. The other order drops the control-silo value while the deployed default is still false, reverting the drop for the length of the gap.

🤖 Generated with Claude Code

@vaind
vaind requested a review from a team as a code owner August 13, 2026 13:36
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

CW-1838

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 13, 2026
@vaind
vaind requested review from a team and joseph-sentry August 13, 2026 18:24
The drop shipped off behind an option so a wrong predicate could be stopped
without a deploy. Two days on the control silo say the predicate is right:
check activity recorded held flat day over day (+2.2% check_run, +1.8%
check_suite at the same clock), the downstream/upstream ratio never stepped
at the cutover, and forwarding of checks that do carry an own-repo PR kept
growing with traffic. It reclaimed ~8.1M webhookpayload rows a day.

Carrying the rolled-out value in the registered default lets the automator
drop its temporary control-silo override, which is the thing that has to be
kept in sync by hand. The option stays registered and the call site keeps
reading it, so setting it false is still the one-step revert.

Only the control silo is affected: IntegrationControlMiddleware._should_operate
returns early unless SiloMode is CONTROL, so region and monolith deployments
never reach this parser regardless of the default.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@vaind
vaind force-pushed the ivandlugos/cw-1838-baseline-drop-checks-without-own-repo-pr branch from 9b4b99a to c9cd2d7 Compare August 13, 2026 18:35
@vaind
vaind merged commit e900c34 into master Aug 24, 2026
92 of 93 checks passed
@vaind
vaind deleted the ivandlugos/cw-1838-baseline-drop-checks-without-own-repo-pr branch August 24, 2026 12:34
vaind added a commit that referenced this pull request Aug 27, 2026
…lined

The own-repo-PR predicate held its rollout override at `true` for a fortnight
with `sentry.pr_metrics.check.activity_recorded` flat, which was the bar the
rollout set for itself. #121954 moved that value into the registered default and
sentry-options-automator#9218 removed the override, so the option has only ever
been able to read `true` since. Collapsing the call site is what retires the
switch; leaving the read in place would keep a branch nothing can reach.

Drops the `has_own_repo_pr` tag on `github.webhook.forwarded_event` with it.
Both action-filtered event types list `completed` in `own_repo_pr_actions`, so a
payload that would tag `false` is now dropped before the forward and the tag is
a constant. Emitting it cost a second `references_own_repo_pull_request` scan
per completed check on the control parser's hot path.

The tests that pinned the disabled path go too: the two kill-switch cases, the
three asserting the `false` tag, and two `_by_default` cases that became exact
duplicates of the `_with_no_pull_requests` drop tests once the option was gone.
vaind added a commit that referenced this pull request Sep 1, 2026
…lined

The own-repo-PR predicate held its rollout override at `true` for a fortnight
with `sentry.pr_metrics.check.activity_recorded` flat, which was the bar the
rollout set for itself. #121954 moved that value into the registered default and
sentry-options-automator#9218 removed the override, so the option has only ever
been able to read `true` since. Collapsing the call site is what retires the
switch; leaving the read in place would keep a branch nothing can reach.

Drops the `has_own_repo_pr` tag on `github.webhook.forwarded_event` with it.
Both action-filtered event types list `completed` in `own_repo_pr_actions`, so a
payload that would tag `false` is now dropped before the forward and the tag is
a constant. Emitting it cost a second `references_own_repo_pull_request` scan
per completed check on the control parser's hot path.

The tests that pinned the disabled path go too: the two kill-switch cases, the
three asserting the `false` tag, and two `_by_default` cases that became exact
duplicates of the `_with_no_pull_requests` drop tests once the option was gone.
vaind added a commit that referenced this pull request Sep 1, 2026
…lined (#122581)

Step 3 of the option-removal order for
`hybridcloud.webhookpayload.github_drop_checks_without_own_repo_pr`: the
call site and the registration.

The earlier steps are already out — #121954 moved the rolled-out value
into the registered default (`False` → `True`), and
[sentry-options-automator#9218](getsentry/sentry-options-automator#9218)
removed the control-silo override that had held `true` since 2026-08-12.
`options.get(...)` has only been able to return `true` since, so the
branch behind it is unreachable.

**Merge gate:** the automator run for
[sentry-options-automator#9218](getsentry/sentry-options-automator#9218)
needs to be green before this lands. It ran while the option was still
registered, which is what lets `configoptions sync` unset the row —
removing the registration first would strand it.

### What changed

- `github.py` — dropped the `options.get(...)` conjunct, so the
own-repo-PR drop is unconditional for the actions in
`own_repo_pr_actions`.
- `defaults.py` — removed the `register(...)`.
- Dropped the `has_own_repo_pr` tag from
`github.webhook.forwarded_event`. Both action-filtered event types list
`completed` in `own_repo_pr_actions`, so any payload that would have
tagged `false` is now dropped before the forward — the tag could only
ever read `true`, and emitting it costs a second
`references_own_repo_pull_request` scan on the control parser's hot
path. If you group that counter by `has_own_repo_pr`: the split goes
away, the counter does not.
- Tests — removed the kill-switch cases, the ones asserting the dropped
tag, and two `_by_default` cases that became exact duplicates of their
`_with_no_pull_requests` counterparts.

### Testing

`tests/sentry/middleware/integrations/parsers/test_github.py` — 62
passing. `prek` and mypy clean.

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
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