feat(seer): Add Autofix overview endpoint - #121747
Conversation
Add the Seer Autofix overview endpoint, which groups an organization's autofix runs by their furthest-reached milestone and returns each run's root cause, proposed fix, and issue details. Pull-request (SCM) enrichment — checks, review status, and changed files — is stubbed out behind NOTE markers and lands in a follow-up PR.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 59ced16. Configure here.
| for run in runs_by_id.values(): | ||
| if run.group_id not in latest_per_group: | ||
| latest_per_group[run.group_id] = run | ||
| return latest_per_group |
There was a problem hiding this comment.
Superseded run treated as latest
Medium Severity
_latest_run_per_group only considers runs that already have milestone rows, so a newer autofix run that has not reached root cause yet is invisible. The previous run is still returned as the group's latest, so the overview can show stale root cause or fix data after a re-run starts.
Reviewed by Cursor Bugbot for commit 59ced16. Configure here.
There was a problem hiding this comment.
not a real concern... we are only concerned with runs that have milestones
…21748) ## Summary Second of three stacked PRs for the Autofix overview feature. **Stacked on #121747 — review/merge that first.** Adds pull-request SCM enrichment and wires it into the Autofix overview endpoint: - New `pull_request_status_batch` module extracts the shared batch helpers (`get_checks_and_review` + provider resolution) out of the group pull requests endpoint so both consumers share one implementation. - Adds batched checks, review status, and changed-file enrichment. GitHub file expansion is opt-in and keyed separately in the provider cache, so existing status-only consumers are unaffected. - Re-enables the pull-request serialization in the overview endpoint that was stubbed behind `NOTE:` markers in #121747. ## Stack 1. #121747 — endpoint core 2. **This PR** — SCM enrichment + endpoint wiring 3. #121749 — frontend UI ## Test Plan - Overview endpoint tests now cover pull requests, checks/review status, changed files, merged-PR fetch skipping, and provider-failure degradation. - `test_group_pull_requests`, `test_client`, and `test_pull_request_status` updated for the extracted batch module and file expansion.


Summary
First of three stacked PRs splitting the Autofix overview feature.
Adds the Seer Autofix overview endpoint (
GET /organizations/{org}/seer/autofix-overview/), which groups an organization's autofix runs by their furthest-reached milestone and returns each run's root cause, proposed fix, and issue details.Pull-request (SCM) enrichment — checks, review status, and changed files — is intentionally stubbed out behind
NOTE:markers in this PR and re-enabled in the next PR in the stack, so this one stays a self-contained backend change.Stack
Test Plan
tests/sentry/seer/endpoints/test_organization_seer_autofix_overview.pycovers milestone grouping, latest-run-per-group, project scoping, deleted-group tolerance, nested issue object, stats-period filtering, and per-milestone capping.