Skip to content

feat(seer): Enrich Autofix overview pull requests with SCM status - #121748

Merged
NicoHinderling merged 1 commit into
masterfrom
feat/seer-autofix-overview-scm
Aug 11, 2026
Merged

feat(seer): Enrich Autofix overview pull requests with SCM status#121748
NicoHinderling merged 1 commit into
masterfrom
feat/seer-autofix-overview-scm

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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 feat(seer): Add Autofix overview endpoint #121747.

Stack

  1. feat(seer): Add Autofix overview endpoint #121747 — endpoint core
  2. This PR — SCM enrichment + endpoint wiring
  3. feat(seer): Add Autofix overview UI #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.

@NicoHinderling
NicoHinderling requested review from a team as code owners August 11, 2026 17:45
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 11, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit de7d191. Configure here.

Comment thread src/sentry/seer/endpoints/organization_seer_autofix_overview.py
Comment thread src/sentry/seer/endpoints/organization_seer_autofix_overview.py Outdated
NicoHinderling added a commit that referenced this pull request Aug 11, 2026
## 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

1. **This PR** — endpoint core
2. #121748 — SCM enrichment + endpoint wiring
3. #121749 — frontend UI

## Test Plan

- New
`tests/sentry/seer/endpoints/test_organization_seer_autofix_overview.py`
covers milestone grouping, latest-run-per-group, project scoping,
deleted-group tolerance, nested issue object, stats-period filtering,
and per-milestone capping.

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Base automatically changed from feat/seer-autofix-overview-endpoint to master August 11, 2026 18:08
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from de7d191 to 35b6a77 Compare August 11, 2026 18:11
Comment thread src/sentry/seer/endpoints/organization_seer_autofix_overview.py Outdated
@NicoHinderling
NicoHinderling marked this pull request as draft August 11, 2026 18:25
Comment thread src/sentry/integrations/github/pull_request_status.py
Comment thread src/sentry/seer/endpoints/organization_seer_autofix_overview.py
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from 59ba79f to 170ac30 Compare August 11, 2026 19:58
from sentry.models.repository import Repository

logger = logging.getLogger(__name__)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

much of the code from below as just pulled from group_pull_requests.py so it can be shared by that old usage + the seer_autofix_overview endpoint

@NicoHinderling
NicoHinderling marked this pull request as ready for review August 11, 2026 20:23
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from 170ac30 to 25bbc1b Compare August 11, 2026 20:43
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from 25bbc1b to 8c1d39e Compare August 11, 2026 21:12
Add batched pull-request checks, review status, and changed-file enrichment, and wire it into the Seer Autofix overview endpoint so each run's pull requests carry their check/review state and file diffs.

Extract the shared batch helpers (get_checks_and_review and provider resolution) out of the group pull requests endpoint into pull_request_status_batch so both consumers share one implementation. GitHub file expansion is opt-in and keyed separately in the provider cache so status-only consumers are unaffected.

Harden the enrichment against bad data: wrap the repository-provider registry lookup in try/except KeyError (a stale `integrations:` provider would otherwise 500 the endpoint), skip pull requests whose key is non-numeric before batching so one bad row can't discard an integration's whole batch, and scope repository lookups to ObjectStatus.ACTIVE.
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from 8c1d39e to cd591cf Compare August 11, 2026 21:22
@NicoHinderling
NicoHinderling merged commit 0c4c7b5 into master Aug 11, 2026
60 checks passed
@NicoHinderling
NicoHinderling deleted the feat/seer-autofix-overview-scm branch August 11, 2026 21:31
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