Skip to content

Commit eb764ca

Browse files
authored
feat(preprod): Add basic admin debug actions to buildDetails error UI (#106149)
Little quality of life thing I figured would be helpful when debugging today, this adds a download and rerun button to the `buildDetails` failed UI. Both actions do exactly what the dropdown buttons do in the usual UI, but since they're not visible in the failed UI, we couldn't access them here. Helped me to quickly download a customer build, then re-run after I realized we'd already fixed the bug! <img width="608" height="578" alt="Screenshot 2026-01-12 at 4 30 06 PM" src="https://github.com/user-attachments/assets/ae58732a-76f7-4f6b-b657-2182321929ab" />
1 parent 06a58fb commit eb764ca

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

static/app/views/preprod/buildDetails/buildDetails.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import {useEffect, useRef} from 'react';
22
import styled from '@emotion/styled';
33

4+
import {Flex, Stack} from '@sentry/scraps/layout';
5+
import {Text} from '@sentry/scraps/text';
6+
47
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
8+
import {Button} from 'sentry/components/core/button';
59
import * as Layout from 'sentry/components/layouts/thirds';
610
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
11+
import {IconDownload, IconRefresh} from 'sentry/icons';
712
import {t} from 'sentry/locale';
813
import ProjectsStore from 'sentry/stores/projectsStore';
914
import {
@@ -14,6 +19,7 @@ import {
1419
} from 'sentry/utils/queryClient';
1520
import type RequestError from 'sentry/utils/requestError/requestError';
1621
import {UrlParamBatchProvider} from 'sentry/utils/url/urlParamBatchContext';
22+
import {useIsSentryEmployee} from 'sentry/utils/useIsSentryEmployee';
1723
import useOrganization from 'sentry/utils/useOrganization';
1824
import {useParams} from 'sentry/utils/useParams';
1925
import {BuildError} from 'sentry/views/preprod/components/buildError';
@@ -24,14 +30,20 @@ import {
2430
} from 'sentry/views/preprod/types/buildDetailsTypes';
2531

2632
import {BuildDetailsHeaderContent} from './header/buildDetailsHeaderContent';
33+
import {useBuildDetailsActions} from './header/useBuildDetailsActions';
2734
import {BuildDetailsMainContent} from './main/buildDetailsMainContent';
2835
import {BuildDetailsSidebarContent} from './sidebar/buildDetailsSidebarContent';
2936

3037
export default function BuildDetails() {
3138
const organization = useOrganization();
39+
const isSentryEmployee = useIsSentryEmployee();
3240
const params = useParams<{artifactId: string; projectId: string}>();
3341
const artifactId = params.artifactId;
3442
const projectId = params.projectId;
43+
const {handleDownloadAction, handleRerunAction} = useBuildDetailsActions({
44+
projectId,
45+
artifactId,
46+
});
3547

3648
const buildDetailsQuery: UseApiQueryResult<BuildDetailsApiResponse, RequestError> =
3749
useApiQuery<BuildDetailsApiResponse>(
@@ -125,7 +137,23 @@ export default function BuildDetails() {
125137
? buildDetailsQuery.error?.responseJSON.error
126138
: t('Unable to load build details for this artifact')
127139
}
128-
/>
140+
>
141+
{isSentryEmployee && (
142+
<Stack align="center" gap="lg">
143+
<Text variant="muted" size="sm">
144+
{t('Sentry employees only')}
145+
</Text>
146+
<Flex gap="sm">
147+
<Button icon={<IconRefresh />} onClick={handleRerunAction}>
148+
{t('Rerun Analysis')}
149+
</Button>
150+
<Button icon={<IconDownload />} onClick={handleDownloadAction}>
151+
{t('Download Build')}
152+
</Button>
153+
</Flex>
154+
</Stack>
155+
)}
156+
</BuildError>
129157
</Layout.Page>
130158
</SentryDocumentTitle>
131159
);

0 commit comments

Comments
 (0)