Skip to content

Commit ee32224

Browse files
authored
Correct Sentry env derivation from VERCEL_ENV (#3130)
1 parent 2c974bb commit ee32224

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

website/src/bootstrapping/sentry.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import { isBrowserSupported } from './browser';
66

77
// Decide Sentry environment based on some basic heuristics.
88
function sentryEnv(): string | undefined {
9-
if (VERCEL_ENV === 'preview') return 'preview';
10-
if (VERCEL_ENV === 'production') {
11-
if (VERCEL_GIT_COMMIT_REF === 'production') return 'production';
12-
if (window.location.host === 'nusmods.com') return 'production';
9+
if (VERCEL_ENV === 'production') return 'production';
10+
if (VERCEL_ENV === 'preview') {
1311
if (VERCEL_GIT_COMMIT_REF === 'master') return 'staging';
14-
// Don't expect Vercel production deployments to be made from other
15-
// branches.
12+
return 'preview';
1613
}
1714
return 'development';
1815
}

0 commit comments

Comments
 (0)