Skip to content

Commit ed7d0a1

Browse files
authored
chore(sc-65330): Improve error reporting for apps by reporting to Sentry (#77)
* Integrated Sentry for better error tracking in apps. * Added necessary Sentry configuration settings.
1 parent 5c9de1a commit ed7d0a1

8 files changed

Lines changed: 642 additions & 242 deletions

File tree

.github/workflows/subworkflow-build.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,21 @@ jobs:
7575
LABELS: "${{ steps.extract_labels.outputs.labels }}"
7676
VERSION: "${{ steps.version_tag.outputs.version }}"
7777
PUSH_TAG: "${{ inputs.push-tag }}"
78-
RUN_LINT: "${{ inputs.run-lint }}"
79-
RUN_TESTS: "${{ inputs.run-tests }}"
78+
RUN_LINT: "${{ inputs.run-lint }}"
79+
RUN_TESTS: "${{ inputs.run-tests }}"
80+
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
81+
SENTRY_ORG: "${{ secrets.SENTRY_ORG }}"
82+
SENTRY_PROJECT: "${{ secrets.SENTRY_PROJECT }}"
8083
with:
8184
env: |
8285
LABELS
8386
VERSION
8487
PUSH_TAG
8588
RUN_LINT
8689
RUN_TESTS
90+
SENTRY_AUTH_TOKEN
91+
SENTRY_ORG
92+
SENTRY_PROJECT
8793
runCmd: |
8894
set -e
8995
@@ -98,14 +104,20 @@ jobs:
98104
pnpm test:coverage
99105
fi
100106
101-
# Build
102-
pnpm run build
103-
104107
# Tag
105108
MILESTONE=$(echo "$LABELS" | grep -E 'major-version|minor-version' | head -1)
106109
VERSION_NEW=$(pnpm run bumpManifestVer "$MILESTONE" "$VERSION" | tail -n 1)
107110
pnpm prettier --write manifest.json
108111
git tag -a $VERSION_NEW -m "Version $VERSION_NEW"
112+
113+
# Build
114+
if [ "$PUSH_TAG" != "true" ]; then
115+
## Disable Sentry Release if not pushing
116+
export SENTRY_DISABLED="true"
117+
fi
118+
pnpm run build
119+
120+
# Push
109121
if [ "$PUSH_TAG" = "true" ]; then
110122
git push origin $VERSION_NEW
111123
fi
@@ -114,6 +126,7 @@ jobs:
114126
working-directory: dist
115127
run: |
116128
cp ../manifest.json .
129+
rm **/*.js.map || echo "No source maps to remove"
117130
zip -rq ../app.zip *
118131
119132
- name: Upload package

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ dist-ssr
77
*.local
88
/coverage
99
.pnpm-store
10+
11+
# Sentry Config File
12+
.env.sentry-build-plugin

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"@fortawesome/free-solid-svg-icons": "^6.7.2",
2121
"@fortawesome/react-fontawesome": "^0.2.2",
2222
"@heroicons/react": "1.0.6",
23+
"@sentry/react": "^9.22.0",
24+
"@sentry/vite-plugin": "^3.5.0",
2325
"date-fns": "^2.30.0",
2426
"flatpickr": "^4.6.13",
2527
"formik": "^2.4.6",
@@ -30,7 +32,6 @@
3032
"react": "^17.0.2",
3133
"react-copy-to-clipboard": "^5.1.0",
3234
"react-dom": "^17.0.2",
33-
"react-error-boundary": "^3.1.4",
3435
"react-resize-observer": "^1.1.1",
3536
"react-router-dom": "^6.30.0",
3637
"react-time-ago": "^7.3.3",

0 commit comments

Comments
 (0)