ref(seer): use get_group_list helper in supergroups-by-group endpoint#116474
Merged
Conversation
…point Replace direct Group.objects.filter calls with the existing get_group_list helper from sentry.api.helpers.group_index.update, which takes an already-access-checked project list from self.get_projects(). This aligns the endpoint with the canonical pattern used elsewhere in the codebase. Also adds @cell_silo_test to the test class (matching the endpoint's @cell_silo_endpoint) and expands coverage with a closed-membership org scenario.
…port from __init__ get_group_list is a read-only lookup helper with no mutations — it doesn't belong in the heavy update.py module. Moving it to a minimal lookup.py avoids a circular-import risk (update.py ← index.py ← __init__.py ← update.py) and gives the function a permanent, officially-exported home via group_index.__init__.__all__. Callers should now import from sentry.api.helpers.group_index directly.
8e88076 to
c8119c2
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c8119c2. Configure here.
cvxluo
approved these changes
May 29, 2026
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
OrganizationSupergroupsByGroupEndpointwas using inlineGroup.objects.filtercalls to validate and filter group IDs. This refactors it to use the existingget_group_listhelper fromsentry.api.helpers.group_index, which is the canonical pattern for this kind of scoped group lookup (seeapi/helpers/group_index/update.pyline 275 for the existing usage).get_group_listpreviously lived ingroup_index/update.py— a large mutation-focused module with heavy dependencies. Since the function is a pure read with minimal dependencies (Group,Project,Sequence), it has been extracted into a newgroup_index/lookup.py. This avoids a circular-import risk (update.py←index.py←__init__.py←update.py) and gives the function a proper home as a first-class export of the package via__init__.__all__.update.pynow importsget_group_listfrom.lookup; no behaviour change for existing callers.Test coverage for the endpoint has been expanded and
@cell_silo_testhas been added to the test class to match the endpoint's@cell_silo_endpointdecorator.Refs AIML-2879