Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc-8099: ensure env are set in sentry set up #821

Merged
merged 4 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion web/gds-admin-ui/src/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import config from './config';
const defaultTracingOrigins = ['localhost', /^\//];

const initSentry = () => {
console.log(config.appVersion)
// ensure environment variables app version and git revision are set
if (!config.appVersion) {
throw new Error('App version is not set in environment variables');
}
if (!config.gitVersion) {
throw new Error('Git revision is not set in environment variables');
}
console.log(`AppVersion: ${config.appVersion || 'not set'} - GitRevision: ${config.gitVersion || 'not set'}`); // eslint-disable-line no-console

if (process.env.REACT_APP_SENTRY_DSN) {
let tracingOrigins = defaultTracingOrigins;
Expand Down
4 changes: 2 additions & 2 deletions web/gds-user-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"extract": "lingui extract",
"compile": "lingui compile",
"extract-c": "lingui extract --clean",
"dash": "node write-save-po-file.js",
"dash-compile": "node write-save-po-file.js && lingui compile",
"dash": "node scripts/write-save-po-file.js",
"dash-compile": "node scripts/write-save-po-file.js && lingui compile",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"lint-staged": {
Expand Down