Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -103,7 +103,7 @@ describe('StacktraceLink', () => {
});
});

it('should hide stacktrace link error state on unsupported platforms', async () => {
it('should show setup button for native platforms', async () => {
MockApiClient.addMockResponse({
url: `/projects/${org.slug}/${project.slug}/stacktrace-link/`,
body: {
Expand All @@ -112,17 +112,15 @@ describe('StacktraceLink', () => {
integrations: [integration],
},
});
const {container} = render(
render(
<StacktraceLink
frame={frame}
event={{...event, platform: 'unreal'}}
event={{...event, platform: 'cocoa'}}
line=""
disableSetup={false}
/>
);
await waitFor(() => {
expect(container).toBeEmptyDOMElement();
});
expect(await screen.findByText('Set up Code Mapping')).toBeInTheDocument();
});

it('renders the codecov link', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import type {Event, Frame} from 'sentry/types/event';
import type {StacktraceLinkResult} from 'sentry/types/integrations';
import {CodecovStatusCode} from 'sentry/types/integrations';
import type {Organization} from 'sentry/types/organization';
import type {PlatformKey} from 'sentry/types/project';
import {trackAnalytics} from 'sentry/utils/analytics';
import {getAnalyticsDataForEvent} from 'sentry/utils/events';
import {getIntegrationIcon, getIntegrationSourceUrl} from 'sentry/utils/integrationUtil';
Expand All @@ -29,22 +28,6 @@ import useProjects from 'sentry/utils/useProjects';
import StacktraceLinkModal from './stacktraceLinkModal';
import useStacktraceLink from './useStacktraceLink';

// Keep this list in sync with PLATFORMS_CONFIG in auto_source_code_config/constants.py
const supportedStacktracePlatforms: PlatformKey[] = [
'clojure',
'csharp',
'elixir', // Elixir is not listed on the main list
'go',
'groovy',
'java',
'javascript',
'node',
'php',
'python',
'ruby',
'scala',
];

const scmProviders = ['github', 'gitlab', 'bitbucket'];

interface StacktraceLinkProps {
Expand Down Expand Up @@ -231,11 +214,8 @@ export function StacktraceLink({frame, event, line, disableSetup}: StacktraceLin
// Check if the line starts and ends with {snip}
const isMinifiedJsError =
event.platform === 'javascript' && /(\{snip\}).*\1/.test(line ?? '');
const isUnsupportedPlatform = !supportedStacktracePlatforms.includes(
event.platform as PlatformKey
);

const hideErrors = isMinifiedJsError || isUnsupportedPlatform || disableSetup;
const hideErrors = isMinifiedJsError || disableSetup;
// for .NET projects, if there is no match found but there is a GitHub source link, use that
if (
frame.sourceLink &&
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/events/interfaces/nativeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function NativeFrame({
: tn('Show %s more frame', 'Show %s more frames', hiddenFrameCount)}
</ShowHideButton>
) : null}
<Flex>
<Flex align="center" gap="sm">
Copy link
Member Author

Choose a reason for hiding this comment

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

These changes are so that:

  1. The "In App" badge remains vertically centered in the stack frame row
  2. There is some horizontal spacing between the "Set Up Code Mapping" button and the "In App" badge in each stack frame row

{showStacktraceLink && (
<ErrorBoundary>
<StacktraceLink
Expand Down
Loading