Skip to content

Commit a3aded6

Browse files
feat(apple): Add onboarding source context Option (#11819)
* onboarding source-context option * [getsentry/action-github-commit] Auto commit * Update index.tsx * Update _default.mdx * Update _default.mdx * Update _default.mdx --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent 0d46586 commit a3aded6

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

platform-includes/debug-symbols-apple/_default.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ For this to work, your project settings for `DEBUG_INFORMATION_FORMAT` must be s
2525

2626
<OrgAuthTokenNote />
2727

28-
```bash
28+
You can also upload your code for source context. This feature allows Sentry to display snippets of your code next to the event stack traces.
29+
30+
<OnboardingOptionButtons
31+
options={[{ id:"source-context", checked: false }]}
32+
/>
33+
34+
```bash {"onboardingOptions": {"source-context": "2"}}
2935
sentry-cli debug-files upload --auth-token ___ORG_AUTH_TOKEN___ \
3036
--include-sources \
3137
--org ___ORG_SLUG___ \
@@ -44,7 +50,7 @@ Sentry can display snippets of your code next to event stack traces. This featur
4450

4551
<OrgAuthTokenNote />
4652

47-
```ruby {tabTitle:Current Fastlane plugin}
53+
```ruby {tabTitle:Current Fastlane plugin} {"onboardingOptions": {"source-context": "5"}}
4854
sentry_debug_files_upload(
4955
auth_token: '___ORG_AUTH_TOKEN___',
5056
org_slug: '___ORG_SLUG___',
@@ -53,7 +59,7 @@ sentry_debug_files_upload(
5359
)
5460
```
5561

56-
```ruby {tabTitle:Fastlane plugin before 1.20.0}
62+
```ruby {tabTitle:Fastlane plugin before 1.20.0} {"onboardingOptions": {"source-context": "5"}}
5763
sentry_upload_dif(
5864
auth_token: '___ORG_AUTH_TOKEN___',
5965
org_slug: '___ORG_SLUG___',
@@ -94,7 +100,7 @@ Another option is to use warnings, and then set `GCC_TREAT_WARNINGS_AS_ERRORS` t
94100

95101
<OrgAuthTokenNote />
96102

97-
```bash {tabTitle:Warn on failures - nonblocking}
103+
```bash {tabTitle:Warn on failures - nonblocking} {"onboardingOptions": {"source-context": "10"}}
98104
if [[ "$(uname -m)" == arm64 ]]; then
99105
export PATH="/opt/homebrew/bin:$PATH"
100106
fi
@@ -103,7 +109,9 @@ if which sentry-cli >/dev/null; then
103109
export SENTRY_ORG=___ORG_SLUG___
104110
export SENTRY_PROJECT=___PROJECT_SLUG___
105111
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
106-
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
112+
ERROR=$(sentry-cli debug-files upload \
113+
--include-sources \
114+
"$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
107115
if [ ! $? -eq 0 ]; then
108116
echo "warning: sentry-cli - $ERROR"
109117
fi
@@ -112,7 +120,7 @@ echo "warning: sentry-cli not installed, download from https://github.com/getsen
112120
fi
113121
```
114122

115-
```bash {tabTitle:Error on failures - blocking}
123+
```bash {tabTitle:Error on failures - blocking} {"onboardingOptions": {"source-context": "10"}}
116124
if [[ "$(uname -m)" == arm64 ]]; then
117125
export PATH="/opt/homebrew/bin:$PATH"
118126
fi
@@ -121,7 +129,9 @@ if which sentry-cli >/dev/null; then
121129
export SENTRY_ORG=___ORG_SLUG___
122130
export SENTRY_PROJECT=___PROJECT_SLUG___
123131
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
124-
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" --force-foreground 2>&1 >/dev/null)
132+
ERROR=$(sentry-cli debug-files upload \
133+
--include-sources \
134+
"$DWARF_DSYM_FOLDER_PATH" --force-foreground 2>&1 >/dev/null)
125135
if [ ! $? -eq 0 ]; then
126136
echo "error: sentry-cli - $ERROR"
127137
fi

src/components/onboarding/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,23 @@ const optionDetails: Record<
4848
</span>
4949
),
5050
},
51+
'source-context': {
52+
name: 'Source context',
53+
description: (
54+
<span>
55+
Upload your source code to allow Sentry to display snippets of your code next to
56+
the event stack traces.
57+
</span>
58+
),
59+
},
5160
};
5261

5362
const OPTION_IDS = [
5463
'error-monitoring',
5564
'performance',
5665
'profiling',
5766
'session-replay',
67+
'source-context',
5868
] as const;
5969

6070
type OptionId = (typeof OPTION_IDS)[number];

0 commit comments

Comments
 (0)