Skip to content

Conversation

@shashjar
Copy link
Member

@shashjar shashjar commented Feb 5, 2026

Fixes ID-1333.

This PR displays the "Set Up Code Mapping" button from in-app stack frames on the issue details page for all platforms.

After changes:
image
image

@linear
Copy link

linear bot commented Feb 5, 2026

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

</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

SUPPORTED_INTEGRATIONS = [IntegrationProviderSlug.GITHUB.value]
STACK_ROOT_MAX_LEVEL = 4

# Any new languages should also require updating the stacktraceLink.tsx
Copy link
Member Author

Choose a reason for hiding this comment

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

Both frontend & backend changes in this PR but it's fine; the backend change is just this comment removal

@shashjar shashjar requested review from a team and scttcper February 5, 2026 23:58
@shashjar shashjar marked this pull request as ready for review February 5, 2026 23:58
@shashjar shashjar requested review from a team as code owners February 5, 2026 23:58
@shashjar shashjar removed request for a team February 5, 2026 23:58
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

);

const hideErrors = isMinifiedJsError || isUnsupportedPlatform || disableSetup;
const hideErrors = isMinifiedJsError || disableSetup;
Copy link
Contributor

Choose a reason for hiding this comment

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

Unhandled KeyError crashes save for new platforms

High Severity

Removing the supportedStacktracePlatforms filter now shows the "Set up Code Mapping" modal for platforms not in PLATFORMS_CONFIG (e.g., cocoa, swift, native). When the user saves, create_frame_info calls PlatformConfig(platform), which does dict(PLATFORMS_CONFIG[platform]), raising a KeyError. The repo-path-parsing POST endpoint only catches UnsupportedFrameInfo, not KeyError, so this results in an unhandled 500 error — making the new feature non-functional for the very platforms it aims to support.

Fix in Cursor Fix in Web

);

const hideErrors = isMinifiedJsError || isUnsupportedPlatform || disableSetup;
const hideErrors = isMinifiedJsError || disableSetup;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The /repo-path-parsing/ endpoint will raise an unhandled KeyError when processing a request for an unsupported platform, leading to a 500 error.
Severity: MEDIUM

Suggested Fix

In src/sentry/api/endpoints/project_repo_path_parsing.py, add a try...except KeyError block to catch the error raised for unsupported platforms. This will allow the endpoint to return a graceful 400 Bad Request response, similar to how the corresponding GET endpoint already handles this case.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: static/app/components/events/interfaces/frame/stacktraceLink.tsx#L218

Potential issue: The frontend change allows the "Set Up Code Mapping" button for all
platforms, but the backend does not support all of them. When a user on an unsupported
platform (e.g., `cocoa`) proceeds to the final step of setting up code mapping, a POST
request is made to the `/projects/{org}/{project}/repo-path-parsing/` endpoint. This
endpoint attempts to look up the platform in `PLATFORMS_CONFIG`, which raises a
`KeyError` for unsupported platforms. Because the endpoint does not handle `KeyError`,
the exception is unhandled, resulting in a 500 Internal Server Error.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant