Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {StacktraceBanners} from 'sentry/components/events/interfaces/crashConten
import {useLineCoverageContext} from 'sentry/components/events/interfaces/crashContent/exception/lineCoverageContext';
import {
prepareSourceMapDebuggerFrameInformation,
useSourceMapDebuggerData,
useSourceMapDebugQuery,
type SourceMapDebugBlueThunderResponse,
} from 'sentry/components/events/interfaces/crashContent/exception/useSourceMapDebuggerData';
import {renderLinksInText} from 'sentry/components/events/interfaces/crashContent/exception/utils';
import {getStacktracePlatform} from 'sentry/components/events/interfaces/utils';
Expand Down Expand Up @@ -164,7 +165,7 @@ function InnerContent({
hasChainedExceptions: boolean;
hiddenExceptions: ExceptionRenderStateMap;
isSampleError: boolean;
sourceMapDebuggerData: ReturnType<typeof useSourceMapDebuggerData>;
sourceMapDebuggerData: SourceMapDebugBlueThunderResponse | undefined;
toggleRelatedExceptions: (exceptionId: number) => void;
values: ExceptionValue[];
project?: Project;
Expand Down Expand Up @@ -265,7 +266,11 @@ export function Content({
}: Props) {
const {projects} = useProjects({slugs: [projectSlug]});

const sourceMapDebuggerData = useSourceMapDebuggerData(event, projectSlug);
const {data: sourceMapDebuggerData} = useSourceMapDebugQuery(
projectSlug,
event.id,
event.sdk?.name ?? null
);
const {hiddenExceptions, toggleRelatedExceptions, expandException} =
useHiddenExceptions(values);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type {FrameSourceMapDebuggerData} from 'sentry/components/events/interfac
import type {Event} from 'sentry/types/event';
import type {PlatformKey} from 'sentry/types/project';
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
import {useApiQuery} from 'sentry/utils/queryClient';
import {useApiQuery, type UseApiQueryResult} from 'sentry/utils/queryClient';
import type {RequestError} from 'sentry/utils/requestError/requestError';
import {useOrganization} from 'sentry/utils/useOrganization';

interface SourceMapDebugBlueThunderResponseFrame {
Expand Down Expand Up @@ -33,7 +34,7 @@ interface SourceMapDebugBlueThunderResponseFrame {
};
}

interface SourceMapDebugBlueThunderResponse {
export interface SourceMapDebugBlueThunderResponse {
dist: string | null;
exceptions: Array<{
frames: SourceMapDebugBlueThunderResponseFrame[];
Expand All @@ -49,31 +50,43 @@ interface SourceMapDebugBlueThunderResponse {
min_debug_id_sdk_version?: string | null;
}

export function useSourceMapDebuggerData(event: Event, projectSlug: string) {
const isSdkThatShouldShowSourceMapsDebugger =
!!event.sdk?.name?.startsWith('sentry.javascript.');
export type SourceMapDebugQueryResult = UseApiQueryResult<
SourceMapDebugBlueThunderResponse,
RequestError
>;

export function useSourceMapDebugQuery(
projectSlug: string,
eventId: string,
sdkName: string | null = null
): SourceMapDebugQueryResult {
const organization = useOrganization({allowNull: true});
const {data: sourceMapDebuggerData} = useApiQuery<SourceMapDebugBlueThunderResponse>(
const isSdkThatShouldShowSourceMapsDebugger =
sdkName?.startsWith('sentry.javascript.') ?? false;
return useApiQuery<SourceMapDebugBlueThunderResponse>(
[
getApiUrl(
'/projects/$organizationIdOrSlug/$projectIdOrSlug/events/$eventId/source-map-debug-blue-thunder-edition/',
{
path: {
organizationIdOrSlug: organization!.slug,
projectIdOrSlug: projectSlug,
eventId: event.id,
eventId,
},
}
),
],
{
enabled: isSdkThatShouldShowSourceMapsDebugger && organization !== null,
enabled:
isSdkThatShouldShowSourceMapsDebugger &&
!!organization &&
!!projectSlug &&
!!eventId,
staleTime: Infinity,
retry: false,
refetchOnWindowFocus: false,
}
);
return sourceMapDebuggerData;
}

function getDebugIdProgress(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Button} from '@sentry/scraps/button';
import {openModal} from 'sentry/actionCreators/modal';
import {
prepareSourceMapDebuggerFrameInformation,
useSourceMapDebuggerData,
useSourceMapDebugQuery,
} from 'sentry/components/events/interfaces/crashContent/exception/useSourceMapDebuggerData';
import {SourceMapsDebuggerModal} from 'sentry/components/events/interfaces/sourceMapsDebuggerModal';
import {VALID_SOURCE_MAP_DEBUGGER_FILE_EXTENSIONS} from 'sentry/components/stackTrace/frame/actions/utils';
Expand All @@ -24,7 +24,11 @@ export function IssueSourceMapsDebuggerAction() {
const {exceptionIndex, hideSourceMapDebugger, project} = useStackTraceContext();
const organization = useOrganization({allowNull: true});

const sourceMapDebuggerData = useSourceMapDebuggerData(event, project?.slug ?? '');
const {data: sourceMapDebuggerData} = useSourceMapDebugQuery(
project?.slug ?? '',
event.id,
event.sdk?.name ?? null
);
const debuggerFrame =
exceptionIndex === undefined
? undefined
Expand Down
12 changes: 12 additions & 0 deletions static/app/utils/issueTypeConfig/configurationIssuesConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {t} from 'sentry/locale';
import {IssueType} from 'sentry/types/group';
import type {IssueCategoryConfigMapping} from 'sentry/utils/issueTypeConfig/types';
import {Tab} from 'sentry/views/issueDetails/types';

Expand Down Expand Up @@ -34,6 +35,7 @@ export const configurationIssuesConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
graph: {enabled: true, type: 'discover-events'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
},
Expand All @@ -51,4 +53,14 @@ export const configurationIssuesConfig: IssueCategoryConfigMapping = {
discover: {enabled: false},
groupingInfo: {enabled: false},
},
[IssueType.SOURCEMAP_CONFIGURATION]: {
evidence: null,
header: {
filterBar: {enabled: false},
graph: {enabled: false},
eventNavigation: {enabled: false},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
},
},
};
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/cronConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const cronConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true},
graph: {enabled: true, type: 'cron-checks'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: true},
},
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const BASE_CONFIG: IssueTypeConfig = {
header: {
filterBar: {enabled: true, fixedEnvironment: false, searchBar: {enabled: true}},
graph: {enabled: true, type: 'discover-events'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: true},
occurrenceSummary: {enabled: false},
},
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/instrumentationConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const instrumentationConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
graph: {enabled: true, type: 'discover-events'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
},
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/metricConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const metricConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true, searchBar: {enabled: false}},
graph: {enabled: true, type: 'detector-history'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
},
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/metricIssueConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const metricIssueConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true},
graph: {enabled: true, type: 'detector-history'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: false},
},
Expand Down
2 changes: 2 additions & 0 deletions static/app/utils/issueTypeConfig/outageConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const outageConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true},
graph: {enabled: true, type: 'cron-checks'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: true},
},
Expand Down Expand Up @@ -69,6 +70,7 @@ export const outageConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true},
graph: {enabled: true, type: 'uptime-checks'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: true, downtime: true},
},
Expand Down
8 changes: 6 additions & 2 deletions static/app/utils/issueTypeConfig/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ export type IssueTypeConfig = {
* Configuration for the issue-level information header
*/
header: {
/**
* Controls the "X in this issue" event navigation row
*/
eventNavigation: DisabledWithReasonConfig;
filterBar: DisabledWithReasonConfig & {
// Display the environment filter in an inactive, locked state
/** Display the environment filter in an inactive, locked state */
fixedEnvironment?: boolean;
// The search bar can be hidden if the issue type does not support event filtering
/** The search bar can be hidden if the issue type does not support event filtering */
searchBar?: DisabledWithReasonConfig;
};
graph: DisabledWithReasonConfig & {
Expand Down
1 change: 1 addition & 0 deletions static/app/utils/issueTypeConfig/uptimeConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const uptimeConfig: IssueCategoryConfigMapping = {
header: {
filterBar: {enabled: true, fixedEnvironment: true},
graph: {enabled: true, type: 'uptime-checks'},
eventNavigation: {enabled: true},
tagDistribution: {enabled: false},
occurrenceSummary: {enabled: true, downtime: true},
},
Expand Down
Loading
Loading