Skip to content
Merged
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 @@ -33,7 +33,7 @@ interface SourceMapDebugBlueThunderResponseFrame {
};
}

interface SourceMapDebugBlueThunderResponse {
export interface SourceMapDebugBlueThunderResponse {
dist: string | null;
exceptions: Array<{
frames: SourceMapDebugBlueThunderResponseFrame[];
Expand All @@ -49,31 +49,38 @@ 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 function useSourceMapDebugQuery(
projectSlug: string,
eventId: string,
sdkName: string | null = null
) {
const organization = useOrganization({allowNull: true});
const {data: sourceMapDebuggerData} = useApiQuery<SourceMapDebugBlueThunderResponse>(
const isSdkThatShouldShowSourceMapsDebugger =
sdkName?.startsWith('sentry.javascript.') ?? false;
Comment thread
Abdkhan14 marked this conversation as resolved.
return useApiQuery<SourceMapDebugBlueThunderResponse>(
[
getApiUrl(
'/projects/$organizationIdOrSlug/$projectIdOrSlug/events/$eventId/source-map-debug-blue-thunder-edition/',
{
path: {
organizationIdOrSlug: organization!.slug,
Comment thread
Abdkhan14 marked this conversation as resolved.
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
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
2 changes: 2 additions & 0 deletions static/app/utils/issueTypeConfig/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export type IssueTypeConfig = {
* Configuration for the issue-level information header
*/
header: {
// Controls the "X in this issue" event navigation row (First/Latest/Recommended)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Controls the "X in this issue" event navigation row (First/Latest/Recommended)
/**
* Controls the "X in this issue" event navigation row.
*/

Let's use a docstring here so we get this documentation in the LSP

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it looks like some of the other ones are wrong also lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all three in the file ^

eventNavigation: DisabledWithReasonConfig;
filterBar: DisabledWithReasonConfig & {
// Display the environment filter in an inactive, locked state
fixedEnvironment?: boolean;
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