-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(code mappings): Display the modal from issue details for all platforms #107752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(code mappings): Display the modal from issue details for all platforms #107752
Conversation
…the issue details page for all platforms
|
🚨 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 |
| </ShowHideButton> | ||
| ) : null} | ||
| <Flex> | ||
| <Flex align="center" gap="sm"> |
There was a problem hiding this comment.
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:
- The "In App" badge remains vertically centered in the stack frame row
- 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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
| ); | ||
|
|
||
| const hideErrors = isMinifiedJsError || isUnsupportedPlatform || disableSetup; | ||
| const hideErrors = isMinifiedJsError || disableSetup; |
There was a problem hiding this comment.
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.


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:

