From 92fb7207d1dd8f059576e40e0cd0aa9116f03bc0 Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Thu, 6 Aug 2026 13:59:09 -0700 Subject: [PATCH 1/2] perf(issue-details): Skip linked pull request checks --- .../linkedPullRequests.spec.tsx | 28 +++++++++++++++++++ .../externalIssuesList/linkedPullRequests.tsx | 22 ++++++++++++--- .../sidebar/externalIssueSidebarList.tsx | 3 +- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx b/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx index ab2ec330e0a3..a3fd753966fa 100644 --- a/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx +++ b/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx @@ -138,6 +138,34 @@ describe('LinkedPullRequests', () => { ).not.toBeInTheDocument(); }); + it('can omit checks and review expansion', async () => { + const pullRequestsMock = MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/issues/${group.id}/pull-requests/`, + body: { + pullRequests: [ + { + ...PullRequestFixture({id: '123', repository}), + attribution: null, + dateLinked: '2026-06-08T23:11:32.000000Z', + status: 'open', + }, + ], + }, + }); + + render(, { + organization, + }); + + expect( + await screen.findByRole('link', {name: /Pull request #123/}) + ).toBeInTheDocument(); + expect(pullRequestsMock).toHaveBeenCalledWith( + expect.anything(), + expect.not.objectContaining({query: {expand: 'checksAndReview'}}) + ); + }); + it('deduplicates pull request ids from group activity', () => { const activityGroup = GroupFixture({ activity: [ diff --git a/static/app/components/group/externalIssuesList/linkedPullRequests.tsx b/static/app/components/group/externalIssuesList/linkedPullRequests.tsx index d9314585bd9c..487882bdba87 100644 --- a/static/app/components/group/externalIssuesList/linkedPullRequests.tsx +++ b/static/app/components/group/externalIssuesList/linkedPullRequests.tsx @@ -62,6 +62,7 @@ export function getLinkedPullRequestActivityIds(group: Group) { interface LinkedPullRequestsProps { group: Group; + showChecksAndReview?: boolean; showEmptyState?: boolean; } @@ -231,7 +232,13 @@ function SeerAttributionAvatar() { ); } -export function useLinkedPullRequests({group}: {group: Group}) { +export function useLinkedPullRequests({ + group, + includeChecksAndReview = true, +}: { + group: Group; + includeChecksAndReview?: boolean; +}) { const organization = useOrganization(); return useQuery( @@ -239,15 +246,22 @@ export function useLinkedPullRequests({group}: {group: Group}) { '/organizations/$organizationIdOrSlug/issues/$issueId/pull-requests/', { path: {organizationIdOrSlug: organization.slug, issueId: group.id}, - query: {expand: 'checksAndReview'}, + query: includeChecksAndReview ? {expand: 'checksAndReview'} : undefined, staleTime: 30_000, } ) ); } -export function LinkedPullRequests({group, showEmptyState}: LinkedPullRequestsProps) { - const {data, isError, isPending} = useLinkedPullRequests({group}); +export function LinkedPullRequests({ + group, + showChecksAndReview = true, + showEmptyState, +}: LinkedPullRequestsProps) { + const {data, isError, isPending} = useLinkedPullRequests({ + group, + includeChecksAndReview: showChecksAndReview, + }); const activityPullRequestIds = getLinkedPullRequestActivityIds(group); if (isError) { diff --git a/static/app/views/issueDetails/sidebar/externalIssueSidebarList.tsx b/static/app/views/issueDetails/sidebar/externalIssueSidebarList.tsx index df0f425e4120..3bf001e08df6 100644 --- a/static/app/views/issueDetails/sidebar/externalIssueSidebarList.tsx +++ b/static/app/views/issueDetails/sidebar/externalIssueSidebarList.tsx @@ -24,7 +24,7 @@ interface Props { export function ExternalIssueSidebarList({event, group}: Props) { const externalIssueData = useGroupExternalIssues({group, event}); const {data: linkedPullRequestsData, isPending: isLinkedPullRequestsLoading} = - useLinkedPullRequests({group}); + useLinkedPullRequests({group, includeChecksAndReview: false}); const hasLinkedPullRequestActivity = getLinkedPullRequestActivityIds(group).size > 0; const showEmptyIssueTrackerAction = !externalIssueData.isLoading && @@ -60,6 +60,7 @@ export function ExternalIssueSidebarList({event, group}: Props) { Date: Thu, 6 Aug 2026 14:02:06 -0700 Subject: [PATCH 2/2] Remove unnecessary test --- .../linkedPullRequests.spec.tsx | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx b/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx index a3fd753966fa..ab2ec330e0a3 100644 --- a/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx +++ b/static/app/components/group/externalIssuesList/linkedPullRequests.spec.tsx @@ -138,34 +138,6 @@ describe('LinkedPullRequests', () => { ).not.toBeInTheDocument(); }); - it('can omit checks and review expansion', async () => { - const pullRequestsMock = MockApiClient.addMockResponse({ - url: `/organizations/${organization.slug}/issues/${group.id}/pull-requests/`, - body: { - pullRequests: [ - { - ...PullRequestFixture({id: '123', repository}), - attribution: null, - dateLinked: '2026-06-08T23:11:32.000000Z', - status: 'open', - }, - ], - }, - }); - - render(, { - organization, - }); - - expect( - await screen.findByRole('link', {name: /Pull request #123/}) - ).toBeInTheDocument(); - expect(pullRequestsMock).toHaveBeenCalledWith( - expect.anything(), - expect.not.objectContaining({query: {expand: 'checksAndReview'}}) - ); - }); - it('deduplicates pull request ids from group activity', () => { const activityGroup = GroupFixture({ activity: [