Skip to content

feat(seer): Make Autofix overview enrichment opt-in via expand - #122105

Open
NicoHinderling wants to merge 3 commits into
masterfrom
feat/seer-autofix-overview-lazy-enrichment
Open

feat(seer): Make Autofix overview enrichment opt-in via expand#122105
NicoHinderling wants to merge 3 commits into
masterfrom
feat/seer-autofix-overview-lazy-enrichment

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The Autofix overview endpoint's default response now touches only Postgres. The two expensive enrichments are opt-in via repeatable expand query params: expand=scmInfo adds pull-request checksStatus/reviewStatus/files[] (GitHub GraphQL), and expand=issueStats adds issue count/userCount/lastSeen (Snuba). Without a token, those fields are still present but default to null/[], so the response shape never changes.

This lets the overview page paint instantly from cheap Postgres data and fill in the richer SCM and issue-stats fields progressively (the frontend two-request load is companion work). issueStats is gated by adding "stats" to the existing StreamGroupSerializerSnuba collapse set — this keeps every Postgres field (priority, owners, assignee, level) while short-circuiting only the Snuba seen-stats query; scmInfo gates the batched get_checks_and_review call, mirroring the existing group_pull_requests endpoint.

Basic pull-request fields (number, url, merge status) stay in the default because they are pure Postgres. Pull-request file changeType is passed through as GitHub's raw value; the frontend owns how it's rendered.

Follow-up from review: corrects the IssuePayload.count annotation to str | None, matching the string the serializer actually emits (str(times_seen)).

Worth a look: the collapse-based Snuba gating in get(), and the include_scm_info threading through _pull_requests_by_seer_run_id.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 14, 2026
Make the two expensive enrichments on the Autofix overview endpoint opt-in
via repeatable `expand` query params, so the default response touches only
Postgres. `expand=scmInfo` adds pull-request checks/review/files (GitHub);
`expand=issueStats` adds issue count/userCount/lastSeen (Snuba). Absent a
token those fields are still present but default to null/[], so the response
shape never changes.

issueStats is gated by adding "stats" to the StreamGroupSerializerSnuba
collapse set, which short-circuits only the Snuba seen-stats query while
keeping every Postgres field. scmInfo gates the batched get_checks_and_review
call, mirroring the group_pull_requests endpoint.
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-lazy-enrichment branch from e51083a to a480dd8 Compare August 14, 2026 22:40
@NicoHinderling
NicoHinderling marked this pull request as ready for review August 15, 2026 02:36
@NicoHinderling
NicoHinderling requested review from a team as code owners August 15, 2026 02:36
The overview serializer emits str(times_seen), but IssuePayload typed
count as int. Match the annotation to the value actually returned.
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-lazy-enrichment branch from 316560f to c259710 Compare August 15, 2026 04:37
@NicoHinderling
NicoHinderling enabled auto-merge (squash) August 15, 2026 04:53
- Drop test_issue_stats_absent_collapses_stats: a whitebox restatement of
  test_issue_stats_absent_issues_no_snuba_query, which already proves the
  behavior (zero seen-stats queries) that the collapse kwarg produces.
- Fold the "default path skips the SCM provider" assertion into
  test_run_includes_pull_requests and drop test_scm_info_absent_skips_
  provider_fetch, whose remaining assertions duplicated it.
- Drop the weaker "in issue" membership assertions now covered by the
  is-None assertions in the issueStats test.
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