From 9025eb4aca229ddd8bd1aae245ef0cedb48695ec Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 16 Nov 2023 13:26:57 -0500 Subject: [PATCH] fix(hybridcloud) Remove limit on project key query used in sdk wizard (#60103) Limiting these results can create user confusion as they aren't able to find the project/dsn they are interested in. We'll need to revisit this in the future as unbounded API requests will eventually timeout. --- src/sentry/services/hybrid_cloud/project_key/impl.py | 4 ++-- src/sentry/services/hybrid_cloud/project_key/service.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sentry/services/hybrid_cloud/project_key/impl.py b/src/sentry/services/hybrid_cloud/project_key/impl.py index 01a5a4bc41b8f8..cc060c471587c2 100644 --- a/src/sentry/services/hybrid_cloud/project_key/impl.py +++ b/src/sentry/services/hybrid_cloud/project_key/impl.py @@ -54,11 +54,11 @@ def get_project_keys_by_region( region_name: str, project_ids: List[str], role: ProjectKeyRole, - limit: int = 100, ) -> List[RpcProjectKey]: + # TODO: This query is unbounded and will need to be addressed in the future. project_keys = ProjectKey.objects.filter( project__in=project_ids, roles=F("roles").bitor(role.as_orm_role()), status=ProjectKeyStatus.ACTIVE, - ).order_by("-date_added")[:limit] + ).order_by("-date_added") return [serialize_project_key(pk) for pk in project_keys] diff --git a/src/sentry/services/hybrid_cloud/project_key/service.py b/src/sentry/services/hybrid_cloud/project_key/service.py index 0bbfc62de8085f..9672c33e47bd3e 100644 --- a/src/sentry/services/hybrid_cloud/project_key/service.py +++ b/src/sentry/services/hybrid_cloud/project_key/service.py @@ -51,7 +51,6 @@ def get_project_keys_by_region( region_name: str, project_ids: List[str], role: ProjectKeyRole, - limit: int = 100, ) -> List[RpcProjectKey]: pass