feat(supergroups): Add status filter to supergroups by-group endpoint#112216
Merged
feat(supergroups): Add status filter to supergroups by-group endpoint#112216
Conversation
Allow filtering groups by status (unresolved, resolved, etc.) via a query parameter so the frontend can request supergroup assignments for only the relevant subset of issues.
Comment on lines
+65
to
+70
| if status_param not in STATUS_QUERY_CHOICES: | ||
| return Response( | ||
| {"detail": "Invalid status parameter"}, | ||
| status=status_codes.HTTP_400_BAD_REQUEST, | ||
| ) | ||
| group_qs = group_qs.filter(status=STATUS_QUERY_CHOICES[status_param]) |
Contributor
There was a problem hiding this comment.
Bug: The endpoint incorrectly filters for status="archived" by only checking status=IGNORED and not the required substatus=UNTIL_ESCALATING, returning all ignored groups instead of just archived ones.
Severity: MEDIUM
Suggested Fix
When the status parameter is "archived", the query should be modified to filter on both status=GroupStatus.IGNORED and substatus=GroupSubStatus.UNTIL_ESCALATING. This will correctly isolate only the groups that are truly archived.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
src/sentry/seer/supergroups/endpoints/organization_supergroups_by_group.py#L65-L70
Potential issue: The endpoint accepts `status="archived"` as a valid parameter because
it exists in `STATUS_QUERY_CHOICES`. However, the implementation only filters by
`Group.status` (`GroupStatus.IGNORED`), without also filtering by `Group.substatus`
(`GroupSubStatus.UNTIL_ESCALATING`). In Sentry's data model, an "archived" group must
satisfy both conditions. As a result, if a client calls this endpoint with
`status="archived"`, it will incorrectly receive all "ignored" groups (e.g., permanently
ignored) instead of only the "archived" (until escalating) ones, leading to incorrect
data being displayed.
Did we get this right? 👍 / 👎 to inform future reviews.
cvxluo
approved these changes
Apr 3, 2026
yuvmen
approved these changes
Apr 3, 2026
scttcper
added a commit
that referenced
this pull request
Apr 7, 2026
Pass `status=unresolved` to the supergroups by-group endpoint so the backend only returns group_ids for unresolved issues. Also skip supergroups with only 1 issue in the frontend lookup so they don't show up in the list. Depends on #112216 fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists
scttcper
added a commit
that referenced
this pull request
Apr 7, 2026
The status filter from #112216 was pre-filtering group IDs sent to Seer, but Seer returns all group_ids per supergroup regardless of what was requested - so the response still contained resolved groups. Moved filtering to the response side instead. Also fixes the response key from `"supergroups"` to `"data"` to match the actual Seer response model (`GetSupergroupsByGroupIdsResponse`). The old code was referencing the wrong key so the filtering was silently a no-op. fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
george-sentry
pushed a commit
that referenced
this pull request
Apr 9, 2026
…#112216) Allow filtering groups by status (unresolved, resolved, etc.) via a query parameter so the frontend can request supergroup assignments for only the relevant subset of issues. fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists
george-sentry
pushed a commit
that referenced
this pull request
Apr 9, 2026
Pass `status=unresolved` to the supergroups by-group endpoint so the backend only returns group_ids for unresolved issues. Also skip supergroups with only 1 issue in the frontend lookup so they don't show up in the list. Depends on #112216 fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists
george-sentry
pushed a commit
that referenced
this pull request
Apr 9, 2026
The status filter from #112216 was pre-filtering group IDs sent to Seer, but Seer returns all group_ids per supergroup regardless of what was requested - so the response still contained resolved groups. Moved filtering to the response side instead. Also fixes the response key from `"supergroups"` to `"data"` to match the actual Seer response model (`GetSupergroupsByGroupIdsResponse`). The old code was referencing the wrong key so the filtering was silently a no-op. fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Allow filtering groups by status (unresolved, resolved, etc.) via a query parameter so the frontend can request supergroup assignments for only the relevant subset of issues.
fixes https://linear.app/getsentry/issue/ID-1440/hide-resolved-issues-from-counts-and-lists