mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-04 14:52:06 +00:00
fix(observability): upload source maps under the client Sentry release (SH-342) (#189)
Some checks are pending
Some checks are pending
Dev events bake shoc-frontend@<sha>. Stop tagging artifacts with Terraform version_label so Sentry can symbolicate them.
This commit is contained in:
parent
99df031f68
commit
d88a2e7854
2 changed files with 7 additions and 11 deletions
3
.github/workflows/deploy.yml
vendored
3
.github/workflows/deploy.yml
vendored
|
|
@ -83,11 +83,12 @@ jobs:
|
||||||
echo "prefix=${prefix}"
|
echo "prefix=${prefix}"
|
||||||
} >> "${GITHUB_OUTPUT}"
|
} >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
# Sentry release is shoc-frontend@${GITHUB_SHA} via VITE_APP_COMMIT_SHA,
|
||||||
|
# distinct from the S3/Terraform version_label.
|
||||||
- name: Upload private source maps
|
- name: Upload private source maps
|
||||||
run: bash scripts/upload-sourcemaps.sh
|
run: bash scripts/upload-sourcemaps.sh
|
||||||
env:
|
env:
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
SENTRY_RELEASE: ${{ steps.release.outputs.version_label }}
|
|
||||||
|
|
||||||
- name: Read previous release pointer
|
- name: Read previous release pointer
|
||||||
id: pointer
|
id: pointer
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,13 @@ set -euo pipefail
|
||||||
SENTRY_ORG="${SENTRY_ORG:-seahaven}"
|
SENTRY_ORG="${SENTRY_ORG:-seahaven}"
|
||||||
SENTRY_PROJECT="${SENTRY_PROJECT:-shoc-frontend}"
|
SENTRY_PROJECT="${SENTRY_PROJECT:-shoc-frontend}"
|
||||||
COMMIT_SHA="${VITE_APP_COMMIT_SHA:-${GITHUB_SHA:-}}"
|
COMMIT_SHA="${VITE_APP_COMMIT_SHA:-${GITHUB_SHA:-}}"
|
||||||
RELEASE_LABEL="${SENTRY_RELEASE:-${RELEASE_LABEL:-}}"
|
|
||||||
|
|
||||||
if [[ -n "${RELEASE_LABEL}" ]]; then
|
if [[ ! "${COMMIT_SHA}" =~ ^[0-9a-fA-F]{40}$ ]]; then
|
||||||
RELEASE="${RELEASE_LABEL}"
|
echo "::error::Source-map upload requires a 40-character VITE_APP_COMMIT_SHA or GITHUB_SHA." >&2
|
||||||
else
|
exit 1
|
||||||
if [[ ! "${COMMIT_SHA}" =~ ^[0-9a-fA-F]{40}$ ]]; then
|
|
||||||
echo "::error::Source-map upload requires a 40-character VITE_APP_COMMIT_SHA or GITHUB_SHA." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
COMMIT_SHA="$(printf '%s' "${COMMIT_SHA}" | tr '[:upper:]' '[:lower:]')"
|
|
||||||
RELEASE="shoc-frontend@${COMMIT_SHA}"
|
|
||||||
fi
|
fi
|
||||||
|
COMMIT_SHA="$(printf '%s' "${COMMIT_SHA}" | tr '[:upper:]' '[:lower:]')"
|
||||||
|
RELEASE="shoc-frontend@${COMMIT_SHA}"
|
||||||
|
|
||||||
npm exec --no -- sentry-cli sourcemaps upload \
|
npm exec --no -- sentry-cli sourcemaps upload \
|
||||||
--org "${SENTRY_ORG}" \
|
--org "${SENTRY_ORG}" \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue