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

Added support for minified react exceptions #3632

Merged
merged 4 commits into from
Jul 7, 2016

Conversation

mitsuhiko
Copy link
Member

@mitsuhiko mitsuhiko commented Jul 1, 2016

This looks up the minified react error codes and expands the message. It
fetches the error map from github and keeps it cached for two minutes. We
could expand that if we want.


This change is Reviewable

timeout=settings.SENTRY_SOURCE_FETCH_TIMEOUT,
)
data = response.json()
cache.set(key, json.dumps(data), 120)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should increase cache time

@mitsuhiko mitsuhiko force-pushed the feature/react-minified-errors branch from cd94874 to efdb416 Compare July 1, 2016 21:35
http_session = http.build_session()
response = http_session.get(self.mapping_url,
allow_redirects=True,
verify=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we skipping TLS validation here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattrobenolt why are we for sourcemaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did what you did for sourcemaps :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's fine. Just making sure since we're choosing to explicitly opt-out, but it's probably reasonable here and the risk is really really low.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, but in this case, this is explicitly pulling from GitHub. They should have valid TLS certificate so I think it'd be more valuable to verify since we use this as a source for mappings.

@dcramer
Copy link
Member

dcramer commented Jul 6, 2016

Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


tests/sentry/lang/javascript/test_processor.py, line 294 [r1] (raw file):

class ErrorMappingTest(TestCase):

    def test_react_error_mapping_resolving(self):

only thing blocking for me is changing this to use a responses fixture


Comments from Reviewable

@mitsuhiko
Copy link
Member Author

Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


tests/sentry/lang/javascript/test_processor.py, line 294 [r1] (raw file):

Previously, dcramer (David Cramer) wrote…

only thing blocking for me is changing this to use a responses fixture

I will add that.

Comments from Reviewable

@mitsuhiko
Copy link
Member Author

I mocked out the test now.


Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


Comments from Reviewable

@dcramer
Copy link
Member

dcramer commented Jul 6, 2016

Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@mitsuhiko mitsuhiko force-pushed the feature/react-minified-errors branch from e40b351 to a65f140 Compare July 7, 2016 06:20
@mitsuhiko
Copy link
Member Author

Ready to merge?


Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion.


src/sentry/lang/javascript/errormapping.py, line 35 [r1] (raw file):

Previously, mattrobenolt (Matt Robenolt) wrote…

Oh, but in this case, this is explicitly pulling from GitHub. They should have valid TLS certificate so I think it'd be more valuable to verify since we use this as a source for mappings.

I will leave it unverified if that's okay.

Comments from Reviewable

@mitsuhiko
Copy link
Member Author

I changed this now to have a two-stage cache. We try to renew the data every 5 minutes but if we fail we fall back for up to an hour on older data. Also verify is now now :P


Review status: 1 of 3 files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@dcramer
Copy link
Member

dcramer commented Jul 7, 2016

Reviewed 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/sentry/lang/javascript/errormapping.py, line 17 [r4] (raw file):

SOFT_TIMEOUT = 300
HARD_TIMEOUT = 3600

I would probably just make this a super super long time (like one week)


Comments from Reviewable

@mitsuhiko
Copy link
Member Author

Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/sentry/lang/javascript/errormapping.py, line 17 [r4] (raw file):

Previously, dcramer (David Cramer) wrote…

I would probably just make this a super super long time (like one week)

Theoretically that makes sense but that would mean that for a week we try to hit the github API for every single event incoming :D

Comments from Reviewable

@mitsuhiko
Copy link
Member Author

Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions.


src/sentry/lang/javascript/errormapping.py, line 35 [r1] (raw file):

Previously, mitsuhiko (Armin Ronacher) wrote…

I will leave it unverified if that's okay.

btw. This is now verified.

Comments from Reviewable

@dcramer
Copy link
Member

dcramer commented Jul 7, 2016

Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion.


src/sentry/lang/javascript/errormapping.py, line 35 [r1] (raw file):

Previously, mitsuhiko (Armin Ronacher) wrote…

btw. This is now verified.

lgtm

Comments from Reviewable

@mattrobenolt
Copy link
Contributor

Reviewed 1 of 3 files at r1, 1 of 2 files at r4, 1 of 1 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@mitsuhiko mitsuhiko merged commit 0d83d55 into master Jul 7, 2016
@mitsuhiko mitsuhiko deleted the feature/react-minified-errors branch July 7, 2016 19:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants