-
Notifications
You must be signed in to change notification settings - Fork 17
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
added sentry webpack plugin #5118
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5118 +/- ##
==========================================
- Coverage 93.99% 93.99% -0.01%
==========================================
Files 497 497
Lines 23048 23052 +4
Branches 943 1409 +466
==========================================
+ Hits 21664 21667 +3
Misses 1282 1282
- Partials 102 103 +1
Continue to review full report at Codecov.
|
b4097dd
to
d545b99
Compare
i have updated the webpack config and added some environment variables as well( I didn't chose a dot file as we could add the token in GitHub secrets). |
c827c7b
to
a640a9b
Compare
Made a small change in webpack config for prod. I made the sentry plugin conditional so as not to upload releases to sentry during CI builds. |
webpack.config.prod.js
Outdated
...process.env.IS_NOT_CI ? [new SentryWebpackPlugin({ | ||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
org : process.env.ORG_NAME, | ||
project : process.env.PROJECT_NAME, | ||
release : process.env.SENTRY_RELEASE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things here:
- You should open a ticket with devops to set these values
- Could you namespace them all under
SENTRY_*
? - Currently the release version comes from
settings.py
, there's no environment variable for that and we don't currently have any automation around setting this var either. So I think some work needs to go into pulling that out into a version file or otherwise getting it extracted somehow during the heroku build. The release bot expects it to live insettings.py
though so the latter might be best for the time being.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have addressed the first two issues However I am not sure I understand you last point. Is there any related document or commit I could look in to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put up a fix to the release script here: mitodl/release-script#358, that will allow you to move the version into a VERSION
file and then replace the current definition of VERSION
in settings.py
with a few lines of code that read that file's contents. Then do the same in webpack.config.prod.js
and use that for the value of release
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that PR is approved, but I'm going to hold off on merging it until after this merged, let me know when i can review this again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, i had addressed the feedback a while back but forgot tor re-request the review. Sorry for the delay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wassaf-Shahzad I'm not seeing those changes here, specifically the usage of a VERSION
file.
2e7292c
to
ead5720
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ead5720
to
0f0625f
Compare
Pre-Flight checklist
What are the relevant tickets?
Closes #5117
What's this PR do?
This PR adds a sentry Webpack plugin do add source map to sentry.
How should this be manually tested?
Source map should be uploaded in sentry.
Introduces a new settings in CI
This PR adds the following environment variables
- ORG_NAME ( organisation name as defined in sentry)
- PROJECT_NAME (name of the project as defined in sentry)
- SENTRY_RELEASE (same as the one passed to sentry init call in sentry client)
- SENTRY_AUTH_TOKEN (sentry auth token with project:write scope)