fix(jira): use paginated project endpoint in get_organization_config#116264
Closed
sentry-junior[bot] wants to merge 1 commit into
Closed
fix(jira): use paginated project endpoint in get_organization_config#116264sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
The settings page called get_projects_list() which hits the deprecated unpaginated GET /rest/api/2/project endpoint, returning every Jira project in a single response. For large enterprise instances this causes timeouts, leaving the configuration page with an infinite spinner. Switch to get_projects_paginated(maxResults=50) so the initial settings-page render is bounded. Projects beyond the first 50 are accessible via the existing typeahead search endpoint (JiraSearchEndpoint), which already uses the paginated API. Fixes #95257 Co-authored-by: Nick Meisenheimer <nick.meisenheimer@sentry.io>
Contributor
Backend Test FailuresFailures on
|
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.
Problem
The Jira integration settings page (e.g.
/settings/integrations/jira/{id}/) spins forever for large Jira instances. Root cause:get_organization_config()callsget_projects_list(), which hits the deprecated unpaginatedGET /rest/api/2/projectendpoint. For enterprise instances with hundreds or thousands of projects this request times out before it can return, leaving the page in an infinite loading state.Reported by Doctolib (enterprise customer). Existing issue: #95257.
Fix
Replace the
get_projects_list()call withget_projects_paginated(params={"maxResults": 50}), capping the initial settings-page render to the first 50 projects. The existing typeahead search endpoint (JiraSearchEndpoint) already uses the paginated API with a query filter, so users can find any project not in the initial 50 by typing in the dropdown.The
50bound also ensures large instances (> 10 projects) still take the global-status fallback path in_set_status_choices_in_organization_config, preserving existing behavior.What was verified
test_get_organization_config_uses_paginated_endpointto confirm the paginated/project/searchendpoint is hit (not the legacy/project) and thataddDropdown.itemsis populated correctly.test_get_config_data/test_get_config_data_issue_keysare unaffected — they testget_config_data()which calls_filter_active_projects()→get_projects_list(), a separate code path not changed here.Out of scope
get_project_key_for_id()and_filter_active_projects()also callget_projects_list()and have the same underlying issue; those are separate follow-up candidates.Fixes #95257
View Session in Sentry
Action taken on behalf of Nick Meisenheimer.