Skip to content

feat(seer): Add Autofix overview UI - #121749

Draft
NicoHinderling wants to merge 1 commit into
masterfrom
feat/seer-autofix-overview-frontend
Draft

feat(seer): Add Autofix overview UI#121749
NicoHinderling wants to merge 1 commit into
masterfrom
feat/seer-autofix-overview-frontend

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The Autofix overview2 page and issue card. Each card shows the run's issue, root cause, proposed fix, and pull requests — with check status, review status, and changed files from the endpoint's SCM enrichment.

The page loads progressively: a cheap Postgres-only request paints the cards immediately, then an expand=scmInfo&expand=issueStats request replaces the data with the enriched payload, with shimmer placeholders in the enriched slots until it resolves. If the enriched request fails, those slots degrade to empty rather than shimmering forever.

Stacked on the backend enrichment work (PR #122105 — land that first). Because this PR currently targets master, its diff includes the backend commits until #122105 merges.

Review feedback folded in

  • Data queries are gated behind the seer-night-shift-ui feature so orgs without access issue no requests (query owner moved into a child mounted beneath <Feature>, mirroring v1).
  • The card selects the newest actionable (open/draft) pull request instead of the oldest link, matching the backend's enrichment scope.
  • Changed files render as summary rows with correct add/delete/rename semantics instead of empty expandable diffs.
  • changeType is a precise typed union; the unused-export Knip failure is resolved; the invisible environment filter was removed.
  • Two pre-existing bugs are also fixed: cards no longer render their title twice, and the vitals tooltip reports the correct time window on non-default periods.

Test Plan

  • overview2/index.spec.tsx covers the page and card: the access gate (zero requests when disabled), the two-request progressive load and shimmer, pull-request selection across mixed open/closed states, and changed-file semantics (including null/added/deleted).
  • pnpm run typecheck, pnpm run lint:js, and pnpm run knip pass.

</Text>
<Text size="sm" variant="muted" ellipsis title={run.title}>
{run.title}
</Text>

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.

Duplicate issue title on cards

Medium Severity

Every card always renders run.title twice—once as the primary link and again as the muted subline. The original overview only shows that muted line when a distinct headline exists; overview2 has no separate headline, so the subline is always a duplicate of the same issue title.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 23a34b4. Configure here.

>
<PageFiltersContainer
skipInitializeUrlParams
defaultSelection={{datetime: {period: '14d', start: null, end: null, utc: null}}}

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.

Wrong stats period in tooltips

Low Severity

The page defaults to a 14d selection and passes that into periodWindowLabel, but that helper only knows 24h/7d/30d/90d and falls back to the 90d copy. Event and user count tooltips therefore claim “in the last 90 days” while counts come from the 14-day window.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 23a34b4. Configure here.

Comment thread static/app/views/seerWorkflows/overview2/issueCard.tsx 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>
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from de7d191 to 35b6a77 Compare August 11, 2026 18:11
@NicoHinderling
NicoHinderling requested review from a team as code owners August 11, 2026 18:11
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from 23a34b4 to 5c7b971 Compare August 11, 2026 18:11
Comment thread static/app/views/seerWorkflows/overview2/index.tsx Outdated

@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 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

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 5c7b971. Configure here.

'%s affected users %s',
userCount.toLocaleString(),
periodWindowLabel(statsPeriod)
)}

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.

Wrong event count period labels

Medium Severity

Event and user count tooltips call periodWindowLabel with DatePageFilter periods such as the page default 14d. That helper only knows 24h/7d/30d/90d and falls back to “in the last 90 days,” so tooltips disagree with the stats window actually queried.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5c7b971. Configure here.

target_file: file.path,
type: DiffFileType.MODIFIED,
hunks: [],
};

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.

PR file change type ignored

Low Severity

toFilePatch always sets DiffFileType.MODIFIED and never maps file.changeType from the overview payload. Deleted files therefore skip FileDiffViewer’s delete treatment when expanded, even though the endpoint and card types carry changeType.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5c7b971. Configure here.

Comment on lines +26 to +42
function issueFixture(overrides: Record<string, unknown> = {}) {
return {
count: '0',
userCount: 0,
lastSeen: '2026-07-14T08:00:00Z',
level: 'error',
substatus: 'ongoing',
priority: 'high',
priorityLockedAt: null,
issueType: 'error',
issueCategory: 'error',
assignedTo: null,
owners: [],
project: {id: '2', slug: 'project-slug', platform: 'python'},
...overrides,
};
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we have fixtures for things like issues

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.

apologies, this PR is entirely vibed and i didnt mean for it to be opened for review yet, sorry for the noise!

issue: issueFixture({project: {id: '3', slug: 'project-slug', platform: 'python'}}),
};

function mockOverview(runsByMilestone: Record<string, unknown[]>) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

feels like we're escaping the type system here

@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-scm branch from 8c1d39e to cd591cf Compare August 11, 2026 21:22
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from 1df095e to 96a7209 Compare August 11, 2026 21:22
@sentry

sentry Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 473 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

NicoHinderling added a commit that referenced this pull request Aug 11, 2026
…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.
Base automatically changed from feat/seer-autofix-overview-scm to master August 11, 2026 21:31
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from 96a7209 to c08d22d Compare August 11, 2026 21:32
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from c08d22d to 3c1d04e Compare August 14, 2026 22:50
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.36% 94.37% 🟢 +0.01%
Typed 134,751 134,888 🟢 +137
Untyped 8,048 8,049 🔴 +1
🔍 1 new type safety issue introduced

Type assertions (as) (1 new)

File Line Detail
static/app/views/seerWorkflows/overview2/periods.ts 19 as keyof typeof WINDOW_LABELSstatsPeriod as keyof typeof WINDOW_LABELS

This is informational only and does not block the PR.

@NicoHinderling

Copy link
Copy Markdown
Contributor Author

@sentry review
@cursor review

@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from e5ae9de to 40f09c7 Compare August 15, 2026 14:23
@NicoHinderling
NicoHinderling changed the base branch from master to feat/seer-autofix-overview-sort August 15, 2026 14:24
Base automatically changed from feat/seer-autofix-overview-sort to master August 15, 2026 22:16
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from 92831a7 to b248daf Compare August 16, 2026 02:34
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-frontend branch from b248daf to 512fa99 Compare August 16, 2026 03:02
Add the overview2 page that groups a project's autofix runs by the
furthest milestone each reached. Runs load progressively with shimmer
placeholders, can be sorted, and each linked pull request expands to
show its changed files with on-demand diff hunks fetched from the
pull-request-files endpoint.
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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants