feat(jira): control endpoint for fetching issue summaries#98324
feat(jira): control endpoint for fetching issue summaries#98324
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #98324 +/- ##
========================================
Coverage 81.17% 81.18%
========================================
Files 8536 8537 +1
Lines 376194 376322 +128
Branches 23922 23922
========================================
+ Hits 305374 305507 +133
+ Misses 70454 70449 -5
Partials 366 366 |
135ead8 to
f94bb55
Compare
|
🚨 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 |
f94bb55 to
4848d81
Compare
| for region_name in find_all_region_names(): | ||
| region_groups = issue_service.get_external_issue_groups( | ||
| region_name=region_name, external_issue_key=issue_key, integration_id=integration.id | ||
| ) | ||
| if region_groups is not None: | ||
| groups.extend(region_groups) | ||
| has_groups = True |
There was a problem hiding this comment.
Potential bug: The region fanout loop in JiraSentryIssueDetailsControlView lacks error handling for RPC calls, causing the entire request to crash if any single region is unavailable or times out.
-
Description: The
JiraSentryIssueDetailsControlViewiterates through all regions to fetch linked Sentry issues using theissue_service.get_external_issue_groups()RPC call. This call can raise exceptions likeRpcRemoteException,ConnectionError, orTimeoutif a region is unavailable or experiences network issues. The loop atsrc/sentry/integrations/jira/views/sentry_issue_details.py:236~242does not have atry/exceptblock to handle these potential failures. As a result, an issue in any single region will cause the entire endpoint to fail with an unhandled exception, leading to a 500 error for the user instead of showing partial results from available regions. -
Suggested fix: Wrap the
issue_service.get_external_issue_groups()call inside theforloop with atry/exceptblock. Catch relevant exceptions, such asRpcRemoteException, and log the error while allowing the loop to continue to the next region. This will make the endpoint more resilient to partial region failures.
severity: 0.81, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
24f23aa to
0d2c89a
Compare
leeandher
left a comment
There was a problem hiding this comment.
Approving since it all looks good! Just the one comment I think should be addressed but its a quick fix, great work 👏
| for region_name in find_all_region_names(): | ||
| region_groups = issue_service.get_external_issue_groups( | ||
| region_name=region_name, external_issue_key=issue_key, integration_id=integration.id | ||
| ) |
There was a problem hiding this comment.
Rather than fanout to every region, we can filter to regions with an associated installation, this is what the parsers do.
Take a look at find_regions_for_orgs, and you can get the org_ids from something like:
organization_integrations = OrganizationIntegration.objects.filter(
integration_id=integration.id,
status=ObjectStatus.ACTIVE,
)
organization_ids = [oi.organization_id for oi in organization_integrations]
There was a problem hiding this comment.
Done! Thanks for the suggestion!
|
|
||
| for group in [self.us_group, self.de_group]: | ||
| assert group.get_absolute_url() in resp_content | ||
|
|
There was a problem hiding this comment.
Bug: Mock Ineffectiveness in Jira Issue Hook Test
The test_simple_get in JiraIssueHookControlTest mocks ExternalIssue.objects.get, but the JiraSentryIssueDetailsControlView uses issue_service.get_external_issue_groups(). This makes the mock ineffective for testing the control view's behavior. The mock's side effect also assumes a specific region processing order, which could lead to flakiness.
For RTC-43
Implement a new Control-Silo endpoint for Jira to use which will perform region fanouts for issue data.