Skip to content

Commit 9b3fc8f

Browse files
authored
Merge pull request #278 from mxmeinhold/rm-raven
Remove Raven
2 parents bc4b169 + 7b54c9c commit 9b3fc8f

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

conditional/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from flask_gzip import Gzip
99
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
1010
from flask_sqlalchemy import SQLAlchemy
11-
from raven.contrib.flask import Sentry
1211

1312
import sentry_sdk
1413
from sentry_sdk.integrations.flask import FlaskIntegration
@@ -30,10 +29,10 @@
3029
migrate = Migrate(app, db)
3130

3231
# Sentry setup
33-
sentry = Sentry(app)
3432
sentry_sdk.init(
3533
dsn=app.config['SENTRY_DSN'],
36-
integrations=[FlaskIntegration(), SqlalchemyIntegration()]
34+
integrations=[FlaskIntegration(), SqlalchemyIntegration()],
35+
environment=app.config['SENTRY_ENV'],
3736
)
3837

3938
ldap = CSHLDAP(app.config['LDAP_BIND_DN'],
@@ -190,8 +189,7 @@ def route_errors(error, user_dict=None):
190189
return render_template('errors.html',
191190
error=error_desc,
192191
error_code=code,
193-
event_id=g.sentry_event_id,
194-
public_dsn=sentry.client.get_public_dsn('https'),
192+
event_id=sentry_sdk.last_event_id(),
195193
**data), int(code)
196194

197195

config.env.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
LDAP_BIND_PW = env.get("CONDITIONAL_LDAP_BIND_PW", "")
2626

2727
# Sentry config
28-
# Do not set the DSN for local development
28+
# Not required for local development, but if you set it, make sure the
29+
# SENTRY_ENV is 'local-development'
2930
SENTRY_DSN = env.get("CONDITIONAL_SENTRY_DSN", "")
3031
SENTRY_CONFIG = {
3132
'dsn': env.get("CONDITIONAL_SENTRY_LEGACY_DSN", ""),
3233
'release': VERSION,
3334
}
35+
SENTRY_ENV = env.get("CONDITIONAL_SENTRY_ENV", "local-development")
3436

3537
# OIDC Config
3638
OIDC_ISSUER = env.get("CONDITIONAL_OIDC_ISSUER", "https://sso.csh.rit.edu/auth/realms/csh")

frontend/javascript/app.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
// Install Raven to send errors to Sentry
2-
import Raven from 'raven-js';
3-
Raven
4-
.config('https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175')
5-
.install();
1+
// Install Sentry to send errors to Sentry
2+
import * as Sentry from '@sentry/browser';
3+
Sentry.init(
4+
{
5+
dsn: 'https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175'
6+
}
7+
);
68

79
// Capture unhandled exceptions in promises
810
window.addEventListener('unhandledrejection', err => {
9-
Raven.captureException(err.reason);
11+
Sentry.captureException(err.reason);
1012
});
1113

1214
// Load the rest of the modules

frontend/javascript/modules/errorReport.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Raven from 'raven-js';
1+
import * as Sentry from '@sentry/browser';
22

33
export default class ErrorReport {
44
constructor(btn) {
@@ -8,11 +8,11 @@ export default class ErrorReport {
88
}
99

1010
render() {
11-
this.btn.addEventListener('click', () => this._invokeRavenModal());
11+
this.btn.addEventListener('click', () => this._invokeSentryModal());
1212
}
1313

14-
_invokeRavenModal() {
15-
Raven.showReportDialog({
14+
_invokeSentryModal() {
15+
Sentry.showReportDialog({
1616
eventId: this.eventId
1717
});
1818
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"demo": "gulp production"
2626
},
2727
"dependencies": {
28+
"@sentry/browser": "^5.29.2",
2829
"bootstrap": "^3.3.6",
2930
"bootstrap-material-datetimepicker": "https://github.com/T00rk/bootstrap-material-datetimepicker.git#gh-pages",
3031
"bootstrap-sass": "^3.4.1",
@@ -89,7 +90,6 @@
8990
"object-assign": "4.1.0",
9091
"open": "0.0.5",
9192
"pretty-hrtime": "1.0.2",
92-
"raven-js": "^3.27.2",
9393
"require-dir": "1.2.0",
9494
"sinon": "1.17.4",
9595
"sinon-chai": "2.8.0",

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ MarkupSafe~=1.0
1818
mccabe~=0.6.1
1919
oic~=0.11.0
2020
psycopg2~=2.8.5
21-
pyldap~=2.4.45
2221
pylint~=2.6.0
2322
python-dateutil~=2.6.1
2423
python-editor~=1.0.3
25-
raven~=6.10.0
2624
sentry-sdk[flask]~=0.19.5
2725
six~=1.12.0
2826
SQLAlchemy~=1.3.22

0 commit comments

Comments
 (0)