Skip to content

feat(supergroups): Add assignee summary to supergroups endpoint#113856

Merged
cvxluo merged 1 commit intomasterfrom
cvxluo/add-assignee-summary-to-supergroups-endpoint
Apr 28, 2026
Merged

feat(supergroups): Add assignee summary to supergroups endpoint#113856
cvxluo merged 1 commit intomasterfrom
cvxluo/add-assignee-summary-to-supergroups-endpoint

Conversation

@cvxluo
Copy link
Copy Markdown
Contributor

@cvxluo cvxluo commented Apr 23, 2026

Add assignee information to the supergroups endpoint. On fetching supergroups from seer, we now also query GroupAssignee to construct a list of assignees for each supergroup. I don't expect this to work for extremely large supergroups, but will likely be fine for now.

@cvxluo cvxluo marked this pull request as ready for review April 23, 2026 20:55
@cvxluo cvxluo requested a review from a team as a code owner April 23, 2026 20:55
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 23, 2026
Comment thread src/sentry/seer/supergroups/endpoints/organization_supergroups_by_group.py Outdated
Comment thread src/sentry/seer/supergroups/endpoints/organization_supergroups_by_group.py Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 1 potential issue.

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 3104acd. Configure here.

Comment thread src/sentry/seer/supergroups/endpoints/organization_supergroups_by_group.py Outdated
@cvxluo cvxluo marked this pull request as draft April 23, 2026 21:19
@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from 3104acd to ed86a32 Compare April 23, 2026 21:19
@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from ed86a32 to 4f4a6d9 Compare April 23, 2026 21:28
@cvxluo cvxluo marked this pull request as ready for review April 23, 2026 21:34
@cvxluo cvxluo requested a review from yuvmen April 24, 2026 23:05
Comment on lines +113 to +117
org_group_ids = set(
Group.objects.filter(id__in=all_group_ids, project__organization=organization).values_list(
"id", flat=True
)
)
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.

might be able to combine this query into GroupAssignee?


actors = [
*user_service.get_many_by_id(ids=user_ids),
*Team.objects.filter(id__in=team_ids),
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.

i think we generally still add organization_id=organization.id to be safe in each query

@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from 4f4a6d9 to cc38b36 Compare April 27, 2026 16:55
@cvxluo cvxluo requested a review from a team as a code owner April 27, 2026 16:55
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 27, 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.

@cvxluo cvxluo marked this pull request as draft April 27, 2026 16:56
@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from cc38b36 to 89f9dbb Compare April 27, 2026 17:10
@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from 89f9dbb to df71daf Compare April 27, 2026 17:28
@cvxluo cvxluo marked this pull request as ready for review April 27, 2026 17:29
Copy link
Copy Markdown
Member

@yuvmen yuvmen left a comment

Choose a reason for hiding this comment

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

nice 👍


if not status_param:
return Response(data)
# Filter out resolved groups from the response
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.

nit - the original comment gave a but more info here - its not just resolved, we need this query after the call to make sure only matching group_ids come back right? the wording about status preivously was kinda better, unless I am missing somthing and this can only happen with "resolved"?

Comment on lines +109 to +111
def _add_assignees(
organization: Organization, supergroups: list[SupergroupDetailData]
) -> list[dict[str, Any]]:
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.

Would it be worth building the whole supergroup serialization into a serializer instead of directly into the endpoint? Maybe not in this pr, but as a general goal?

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.

yes — very tentative plan is to move some supergroup data into sentry and ref these endpoints to use sentry models. i think that will also make building a serializer for supergroups both necessary and useful in the near future

*(users_by_id[user_id] for user_id in sg_user_ids if user_id in users_by_id),
*(teams_by_id[team_id] for team_id in sg_team_ids if team_id in teams_by_id),
]
result.append({**sg, "assignees": serialize(actors, serializer=ActorSerializer())})
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.

Nit: Should we serialize all actors at once instead of per supergroup?

Co-authored-by: Claude <noreply@anthropic.com>
@cvxluo cvxluo force-pushed the cvxluo/add-assignee-summary-to-supergroups-endpoint branch from df71daf to 09603d6 Compare April 28, 2026 16:53
@cvxluo cvxluo merged commit 8ace8fe into master Apr 28, 2026
56 checks passed
@cvxluo cvxluo deleted the cvxluo/add-assignee-summary-to-supergroups-endpoint branch April 28, 2026 17:44
cleptric pushed a commit that referenced this pull request May 5, 2026
)

Add assignee information to the supergroups endpoint. On fetching
supergroups from seer, we now also query `GroupAssignee` to construct a
list of assignees for each supergroup. I don't expect this to work for
extremely large supergroups, but will likely be fine for now.

Co-authored-by: Claude <noreply@anthropic.com>
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.

4 participants