renamed sentry constants to follow the global convention

This commit is contained in:
Abhinav 2022-01-09 13:51:47 +05:30
parent 1aec53311d
commit 4cdc93e345
5 changed files with 15 additions and 12 deletions

View file

@ -1,5 +1,5 @@
const cp = require('child_process');
const { isSentryEnabled } = require('./sentryConfigUtil');
const { getIsSentryEnabled } = require('./sentryConfigUtil');
module.exports = {
COOP_COEP_HEADERS: {
@ -51,5 +51,5 @@ module.exports = {
cwd: __dirname,
encoding: 'utf8',
}),
isSentryEnabled: isSentryEnabled,
getIsSentryEnabled: getIsSentryEnabled,
};

View file

@ -14,12 +14,12 @@ const {
CSP_DIRECTIVES,
WORKBOX_CONFIG,
ALL_ROUTES,
isSentryEnabled,
getIsSentryEnabled,
} = require('./configUtil');
const GIT_SHA = getGitSha();
const SENTRY_ENABLED = isSentryEnabled();
const IS_SENTRY_ENABLED = getIsSentryEnabled();
module.exports = withSentryConfig(
withWorkbox(
@ -51,5 +51,8 @@ module.exports = withSentryConfig(
},
})
),
{ release: GIT_SHA, dryRun: !SENTRY_ENABLED }
{
release: GIT_SHA,
dryRun: !IS_SENTRY_ENABLED,
}
);

View file

@ -5,18 +5,18 @@ import {
getSentryDSN,
getSentryENV,
getSentryRelease,
isSentryEnabled,
getIsSentryEnabled,
} from 'constants/sentry';
const SENTRY_DSN = getSentryDSN();
const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
const ENABLED = isSentryEnabled();
const IS_ENABLED = getIsSentryEnabled();
Sentry.setUser({ id: getUserAnonymizedID() });
Sentry.init({
dsn: SENTRY_DSN,
enabled: ENABLED,
enabled: IS_ENABLED,
environment: SENTRY_ENV,
release: SENTRY_RELEASE,
attachStacktrace: true,

View file

@ -3,17 +3,17 @@ import {
getSentryDSN,
getSentryENV,
getSentryRelease,
isSentryEnabled,
getIsSentryEnabled,
} from 'constants/sentry';
const SENTRY_DSN = getSentryDSN();
const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
const ENABLED = isSentryEnabled();
const IS_ENABLED = getIsSentryEnabled();
Sentry.init({
dsn: SENTRY_DSN,
enabled: ENABLED,
enabled: IS_ENABLED,
environment: SENTRY_ENV,
release: SENTRY_RELEASE,
autoSessionTracking: false,

View file

@ -7,4 +7,4 @@ export const getSentryENV = () =>
export const getSentryRelease = () => process.env.SENTRY_RELEASE;
export { isSentryEnabled } from '../../../sentryConfigUtil';
export { getIsSentryEnabled } from '../../../sentryConfigUtil';