-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(debugger-modal): Make 'debug ID' clickable and link to settings #92714
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ import {CodeSnippet} from 'sentry/components/codeSnippet'; | |||||||||||||
| import {Flex} from 'sentry/components/container/flex'; | ||||||||||||||
| import {ContentSliderDiff} from 'sentry/components/contentSliderDiff'; | ||||||||||||||
| import {Alert} from 'sentry/components/core/alert'; | ||||||||||||||
| import {LinkButton} from 'sentry/components/core/button/linkButton'; | ||||||||||||||
| import {TabList, TabPanels, Tabs} from 'sentry/components/core/tabs'; | ||||||||||||||
| import {sourceMapSdkDocsMap} from 'sentry/components/events/interfaces/crashContent/exception/utils'; | ||||||||||||||
| import {FeedbackModal} from 'sentry/components/featureFeedback/feedbackModal'; | ||||||||||||||
|
|
@@ -738,12 +739,14 @@ export function SourceMapsDebuggerModal({ | |||||||||||||
| <UploadedSourceFileWithCorrectDebugIdChecklistItem | ||||||||||||||
| shouldValidate={sourceResolutionResults.stackFrameDebugId !== null} | ||||||||||||||
| sourceResolutionResults={sourceResolutionResults} | ||||||||||||||
| projectSlug={project?.slug} | ||||||||||||||
| /> | ||||||||||||||
| <UploadedSourceMapWithCorrectDebugIdChecklistItem | ||||||||||||||
| shouldValidate={ | ||||||||||||||
| sourceResolutionResults.uploadedSourceFileWithCorrectDebugId | ||||||||||||||
| } | ||||||||||||||
| sourceResolutionResults={sourceResolutionResults} | ||||||||||||||
| projectSlug={project?.slug} | ||||||||||||||
| /> | ||||||||||||||
| </CheckList> | ||||||||||||||
| {sourceResolutionResults.debugIdProgressPercent === 1 ? ( | ||||||||||||||
|
|
@@ -1255,12 +1258,58 @@ function HasDebugIdChecklistItem({ | |||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| function DebugIdMismatchMessage({ | ||||||||||||||
| debugId, | ||||||||||||||
| projectSlug, | ||||||||||||||
| }: { | ||||||||||||||
| debugId: string | null; | ||||||||||||||
| projectSlug?: string; | ||||||||||||||
| }) { | ||||||||||||||
| // At this point debugId is always defined. The types need to be fixed | ||||||||||||||
| if (!debugId) { | ||||||||||||||
| return ( | ||||||||||||||
| <Fragment> | ||||||||||||||
| {t( | ||||||||||||||
| "You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID" | ||||||||||||||
| )} | ||||||||||||||
| </Fragment> | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| return tct( | ||||||||||||||
| "You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID: [debugId]", | ||||||||||||||
| { | ||||||||||||||
| debugId: projectSlug ? ( | ||||||||||||||
| <LinkButton | ||||||||||||||
| to={{ | ||||||||||||||
| pathname: `/settings/projects/${projectSlug}/source-maps/`, | ||||||||||||||
| query: { | ||||||||||||||
| query: debugId, | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we just do something like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can. but I usually avoid the usage of |
||||||||||||||
| }, | ||||||||||||||
| }} | ||||||||||||||
| icon={<IconOpen />} | ||||||||||||||
| aria-label={t('View source map Debug ID %(debugId)s in project settings', { | ||||||||||||||
| debugId, | ||||||||||||||
| })} | ||||||||||||||
|
Comment on lines
+1291
to
+1293
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
can we just use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to always have a string for aria-labels, and tct returns a React Node |
||||||||||||||
| size="xs" | ||||||||||||||
| > | ||||||||||||||
| {debugId} | ||||||||||||||
| </LinkButton> | ||||||||||||||
| ) : ( | ||||||||||||||
| <MonoBlock>{debugId}</MonoBlock> | ||||||||||||||
| ), | ||||||||||||||
| } | ||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| function UploadedSourceFileWithCorrectDebugIdChecklistItem({ | ||||||||||||||
| sourceResolutionResults, | ||||||||||||||
| shouldValidate, | ||||||||||||||
| projectSlug, | ||||||||||||||
| }: { | ||||||||||||||
| shouldValidate: boolean; | ||||||||||||||
| sourceResolutionResults: FrameSourceMapDebuggerData; | ||||||||||||||
| projectSlug?: string; | ||||||||||||||
| }) { | ||||||||||||||
| const platform = getPlatform(sourceResolutionResults); | ||||||||||||||
| const sourceMapsDocLinks = getSourceMapsDocLinks(platform); | ||||||||||||||
|
|
@@ -1281,21 +1330,16 @@ function UploadedSourceFileWithCorrectDebugIdChecklistItem({ | |||||||||||||
| <CheckListInstruction type="muted"> | ||||||||||||||
| <h6>{t('No Source File With Matching Debug ID')}</h6> | ||||||||||||||
| <p> | ||||||||||||||
| {tct( | ||||||||||||||
| "You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID: [debugId]", | ||||||||||||||
| { | ||||||||||||||
| debugId: ( | ||||||||||||||
| <MonoBlock>{sourceResolutionResults.stackFrameDebugId}</MonoBlock> | ||||||||||||||
| ), | ||||||||||||||
| } | ||||||||||||||
| )} | ||||||||||||||
| <DebugIdMismatchMessage | ||||||||||||||
| projectSlug={projectSlug} | ||||||||||||||
| debugId={sourceResolutionResults.stackFrameDebugId} | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add sourceResolutionResults.stackFrameDebugId to the if and make debugId non-nullable
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to ensure this part of the code always renders, even if debugID is null - which shouldn't happen, but just in case. That's why we need to fix the types. |
||||||||||||||
| /> | ||||||||||||||
| </p> | ||||||||||||||
| <p> | ||||||||||||||
| {t( | ||||||||||||||
| 'Make sure to inject Debug IDs into all of your source files and to upload all of them to Sentry.' | ||||||||||||||
| )} | ||||||||||||||
| </p> | ||||||||||||||
| {/* TODO: Link to Uploaded Artifacts */} | ||||||||||||||
| </CheckListInstruction> | ||||||||||||||
| </CheckListItem> | ||||||||||||||
| ); | ||||||||||||||
|
|
@@ -1322,9 +1366,11 @@ function UploadedSourceFileWithCorrectDebugIdChecklistItem({ | |||||||||||||
| function UploadedSourceMapWithCorrectDebugIdChecklistItem({ | ||||||||||||||
| sourceResolutionResults, | ||||||||||||||
| shouldValidate, | ||||||||||||||
| projectSlug, | ||||||||||||||
| }: { | ||||||||||||||
| shouldValidate: boolean; | ||||||||||||||
| sourceResolutionResults: FrameSourceMapDebuggerData; | ||||||||||||||
| projectSlug?: string; | ||||||||||||||
| }) { | ||||||||||||||
| const platform = getPlatform(sourceResolutionResults); | ||||||||||||||
| const sourceMapsDocLinks = getSourceMapsDocLinks(platform); | ||||||||||||||
|
|
@@ -1345,21 +1391,16 @@ function UploadedSourceMapWithCorrectDebugIdChecklistItem({ | |||||||||||||
| <CheckListInstruction type="muted"> | ||||||||||||||
| <h6>{t('No Source Map With Matching Debug ID')}</h6> | ||||||||||||||
| <p> | ||||||||||||||
| {tct( | ||||||||||||||
| "You already uploaded artifacts with Debug IDs but none of the uploaded source maps had a Debug ID matching this stack frame's Debug ID: [debugId]", | ||||||||||||||
| { | ||||||||||||||
| debugId: ( | ||||||||||||||
| <MonoBlock>{sourceResolutionResults.stackFrameDebugId}</MonoBlock> | ||||||||||||||
| ), | ||||||||||||||
| } | ||||||||||||||
| )} | ||||||||||||||
| <DebugIdMismatchMessage | ||||||||||||||
| projectSlug={projectSlug} | ||||||||||||||
| debugId={sourceResolutionResults.stackFrameDebugId} | ||||||||||||||
| /> | ||||||||||||||
| </p> | ||||||||||||||
| <p> | ||||||||||||||
| {t( | ||||||||||||||
| 'Make sure to inject Debug IDs into all of your source files and to upload all of them to Sentry.' | ||||||||||||||
| )} | ||||||||||||||
| </p> | ||||||||||||||
| {/* TODO: Link to Uploaded Artifacts */} | ||||||||||||||
| </CheckListInstruction> | ||||||||||||||
| <SourceMapStepNotRequiredNote /> | ||||||||||||||
| </CheckListItem> | ||||||||||||||
|
|
||||||||||||||
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.