Skip to content

Commit c801170

Browse files
ericallamTrigger.dev RepoOps
authored andcommitted
ci(webapp): let a repo variable skip the Sentry sourcemap upload
The webapp image build uploads sourcemaps to Sentry and fails if Sentry's API is unavailable, which also blocks the Helm chart and release steps that depend on the image. Setting the `SKIP_SENTRY_SOURCEMAP_UPLOAD` repository variable to `true` now skips the upload (the sourcemaps are still removed from the image). Repository variables are read when a job runs, so during an outage you can set it and re-run the failed jobs. Unset, the build behaves exactly as before. Mono-RevId: a310168c2b92061094101e737a94be4753265b02
1 parent 82a7870 commit c801170

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/publish-webapp.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
SENTRY_RELEASE=${{ steps.set_build_info.outputs.BUILD_GIT_SHA }}
136136
SENTRY_ORG=triggerdev
137137
SENTRY_PROJECT=trigger-cloud
138+
SKIP_SENTRY_SOURCEMAP_UPLOAD=${{ vars.SKIP_SENTRY_SOURCEMAP_UPLOAD }}
138139
secrets: |
139140
sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}
140141

‎apps/webapp/upload-sourcemaps.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
if [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_RELEASE" ]; then
4+
# Set during a Sentry outage so the image still builds; the maps are deleted either way so they never ship.
5+
if [ "$SKIP_SENTRY_SOURCEMAP_UPLOAD" = "true" ]; then
6+
echo "Skipping sourcemap upload: SKIP_SENTRY_SOURCEMAP_UPLOAD is true"
7+
rm -rf ./build/*.map
8+
elif [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_RELEASE" ]; then
59
sentry-cli releases new $SENTRY_RELEASE
610
sentry-cli sourcemaps inject ./build
711
sentry-cli sourcemaps upload ./build --release $SENTRY_RELEASE

‎docker/Dockerfile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
6161
ARG SENTRY_RELEASE
6262
ARG SENTRY_ORG
6363
ARG SENTRY_PROJECT
64+
ARG SKIP_SENTRY_SOURCEMAP_UPLOAD
6465
ENV SENTRY_RELEASE=${SENTRY_RELEASE} \
6566
SENTRY_ORG=${SENTRY_ORG} \
66-
SENTRY_PROJECT=${SENTRY_PROJECT}
67+
SENTRY_PROJECT=${SENTRY_PROJECT} \
68+
SKIP_SENTRY_SOURCEMAP_UPLOAD=${SKIP_SENTRY_SOURCEMAP_UPLOAD}
6769

6870
# Goose and schemas
6971
COPY --from=goose_builder /go/bin/goose /usr/local/bin/goose

0 commit comments

Comments
 (0)