Skip to content

feat(issues): Add a same_supergroup type to the related issues endpoint - #131946

Merged
Christinarlong merged 4 commits into
masterfrom
unified-similarity-api-same-supergroup-type
Nov 20, 2026
Merged

Christinarlong merged 4 commits into
masterfrom
unified-similarity-api-same-supergroup-type

Conversation

@Christinarlong

@Christinarlong Christinarlong commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Expose supergroups behind a flag in the related endpoint

AI Overview

What?

GET /organizations/{org}/issues/{id}/related/?type=same_supergroup returns the other issues in this issue's Seer supergroup, in any project the caller can read, most recently seen first, up to limit:

{
  "data": [{"issue": {"shortId": "CHECKOUT-4F", "...": "..."}, "relations": [{"type": "same_supergroup"}]}],
  "meta": {"types": [{
    "type": "same_supergroup", "status": "ok",
    "supergroup": {"id": "4821", "title": "Postgres connection pool exhaustion in checkout workers"}
  }]}
}

not_applicable when the flags are off, for non-error issues, and for issues Seer hasn't put in a supergroup (no stack trace, or created before clustering was on).

Why?

Seer already groups new error issues whose root causes describe the same failure, across projects, but nothing reads those groups since the supergroups UI was removed in #124667. Returning them from /related/ lets agents and the Similar Issues drawer see issues that share a root cause without a separate call. The title says what the group shares, which the source issue alone doesn't.

Rollout and failure modes

  • Behind a new flag: organizations:related-issues-supergroups (exposed to the frontend for a drawer section later). The type also requires organizations:supergroups-lightweight-rca-clustering-write, so it only runs where Seer builds supergroups. Until both are on, it returns not_applicable without calling Seer.
  • One Seer call per request that asks for it, with a 1s timeout. A Seer error or timeout gives unavailable, and a 503 only when it's the only type requested.
  • The latency of Seer's lookup is unknown (it has no callers today). It shows up in the existing Seer request spans once flagged orgs use it.

Notes

  • Follows same_trace.py: a lookup, then the readable-projects filter and a most-recently-seen sort on Group. The lookup reuses get_supergroups_by_group_ids(), which gains a timeout argument (default unchanged).
  • Seer returns every issue in the supergroup, including ones in projects the caller can't read, so the type keeps only readable projects (the same leak fix(supergroups): Strip inaccessible groups from by-group response #129217 fixed in the by-group endpoint). A test covers it.
  • meta.supergroup carries only the ID and title. Seer's summary, error type and code area are left out for now.

🤖 Generated with Claude Code

/related/?type=same_supergroup returns the other issues in the issue's Seer supergroup that the caller can read, most recently seen first, with the supergroup's ID and title in meta. It's behind the new organizations:related-issues-supergroups flag and also needs the clustering flag, so it returns not_applicable until both are on.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 20, 2026
Christinarlong and others added 2 commits November 20, 2026 09:48
…t JSON

A non-JSON body from Seer raised orjson.JSONDecodeError out of the endpoint, failing every requested type with a 500.
@github-actions

Copy link
Copy Markdown
Contributor

decision-model-linter

api

src/sentry/apidocs/examples/issue_examples.py

  • warn returnsNumericIdAsInteger = INTRODUCED (0.72): API responses should return numeric IDs as strings, for example str(obj.id). This change adds one returned as an integer. If the field already existed, don't change its type, because callers expect a number.

decision-model-linter: 30 calls on 6 files, 72,037 input tokens, $0.003, model typesafe/jev-1.13-20260917

@Christinarlong
Christinarlong marked this pull request as ready for review November 20, 2026 21:07
@Christinarlong
Christinarlong requested review from a team as code owners November 20, 2026 21:07

@cvxluo cvxluo 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.

the original plan was to surface supergroups to users (and agents) as 'issue groups', but this is fine as well for now

@Christinarlong

Copy link
Copy Markdown
Contributor Author

the original plan was to surface supergroups to users (and agents) as 'issue groups', but this is fine as well for now

Yeah I think we can always rename p easily

@Christinarlong
Christinarlong merged commit 18139cf into master Nov 20, 2026
109 checks passed
@Christinarlong
Christinarlong deleted the unified-similarity-api-same-supergroup-type branch November 20, 2026 22:38

This branch was successfully deployed

1 active deployment
Preview — 453154f5 Deployed Nov 20, 2026 by vercel[bot]
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