feat(seer): Make Autofix overview enrichment opt-in via expand - #122105
Open
NicoHinderling wants to merge 3 commits into
Open
feat(seer): Make Autofix overview enrichment opt-in via expand#122105NicoHinderling wants to merge 3 commits into
NicoHinderling wants to merge 3 commits into
Conversation
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
force-pushed
the
feat/seer-autofix-overview-lazy-enrichment
branch
from
August 14, 2026 22:40
e51083a to
a480dd8
Compare
NicoHinderling
marked this pull request as ready for review
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
force-pushed
the
feat/seer-autofix-overview-lazy-enrichment
branch
from
August 15, 2026 04:37
316560f to
c259710
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Autofix overview endpoint's default response now touches only Postgres. The two expensive enrichments are opt-in via repeatable
expandquery params:expand=scmInfoadds pull-requestchecksStatus/reviewStatus/files[](GitHub GraphQL), andexpand=issueStatsadds issuecount/userCount/lastSeen(Snuba). Without a token, those fields are still present but default tonull/[], 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).
issueStatsis gated by adding"stats"to the existingStreamGroupSerializerSnubacollapse set — this keeps every Postgres field (priority, owners, assignee, level) while short-circuiting only the Snuba seen-stats query;scmInfogates the batchedget_checks_and_reviewcall, mirroring the existinggroup_pull_requestsendpoint.Basic pull-request fields (number, url, merge status) stay in the default because they are pure Postgres. Pull-request file
changeTypeis passed through as GitHub's raw value; the frontend owns how it's rendered.Follow-up from review: corrects the
IssuePayload.countannotation tostr | None, matching the string the serializer actually emits (str(times_seen)).Worth a look: the collapse-based Snuba gating in
get(), and theinclude_scm_infothreading through_pull_requests_by_seer_run_id.