Skip to content

ref(seer): Remove legacy PR-created attribution/linking from process_autofix_updates (CW-1719 phase 2)#120584

Draft
vaind wants to merge 1 commit into
ivan/cw-1719-notify-seer-pr-createdfrom
ivan/cw-1719-remove-legacy-pr-attribution
Draft

ref(seer): Remove legacy PR-created attribution/linking from process_autofix_updates (CW-1719 phase 2)#120584
vaind wants to merge 1 commit into
ivan/cw-1719-notify-seer-pr-createdfrom
ivan/cw-1719-remove-legacy-pr-attribution

Conversation

@vaind

@vaind vaind commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Draft / do not merge yet. Stacked on #120583. This is the Phase-2 cleanup and is only safe to land after #120583 is deployed and Seer's PR writer is calling the new notify_seer_pr_created RPC. Until then, keep this draft.

What

Removes the redundant PR attribution + run↔PR link write from the autofix completion-hook path (process_autofix_updates, the SEER_PR_CREATED branch).

Once the run-anchored notify_seer_pr_created RPC (#120583) records attribution and linking for every PR Seer creates — including PRs from group-less runs that the completion hook silently skipped — this second write is pure duplication (idempotent, but dead weight).

Diff

  • Delete the attribute_seer_created_pull_requests(...) and link_seer_run_pull_requests(...) calls (and their now-unused imports) from process_autofix_updates.
  • Kept, untouched: the Activity creation for SEER_PR_CREATED, the entrypoint fan-out via on_autofix_update, all other event-type handling, and the GitHub-webhook backstop in src/sentry/seer/autofix/webhooks.py.
  • The four process_autofix_updates attribution/link tests (..._records_pr_attribution, ..._pr_attribution_disabled, ..._links_pull_requests, ..._link_killswitch) and their shared payload helper are removed — that behavior now lives in the NotifySeerPrCreatedTest suite added by feat(seer): Run-anchored notify_seer_pr_created RPC for PR attribution (CW-1719) #120583. The test_create_seer_activity_pr_created_with_pull_requests Activity test is kept.

Why it's safe

Attribution and linking are idempotent and best-effort, so during the rolling deploy window both writers can coexist harmlessly (the second is a no-op). This PR only removes the second writer after the first is proven live — hence the draft gate.

Tests run vs deferred

Deferred to CI: the full backend suite.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

CW-1719

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 24, 2026
@vaind
vaind force-pushed the ivan/cw-1719-notify-seer-pr-created branch from 958f2d7 to e2da0b8 Compare July 25, 2026 11:05
…autofix_updates

The SEER_PR_CREATED branch of process_autofix_updates records PR attribution
and the run<->PR link only when a run has a group_id, so PRs from group-less
runs were never attributed or linked. The new notify_seer_pr_created RPC now
records both for every PR Seer creates, run-anchored and issue-optional, which
makes this write redundant.

Drop the attribution/link calls from the completion-hook path (and their now
unused imports). Everything else stays: the Activity creation and the
entrypoint fan-out for SEER_PR_CREATED are untouched, as is the GitHub-webhook
backstop. The obsolete process_autofix_updates attribution/link tests move to
the notify_seer_pr_created suite; the Activity test is kept.

This is safe only once the notify_seer_pr_created receiver is deployed and
Seer's writer calls it, so this PR must stay draft until then.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vaind
vaind force-pushed the ivan/cw-1719-remove-legacy-pr-attribution branch from e7ceb82 to 866f9dd Compare July 25, 2026 11:06
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.

1 participant