-
Notifications
You must be signed in to change notification settings - Fork 514
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
ref: Patched functions decorator for integrations #2454
ref: Patched functions decorator for integrations #2454
Conversation
I really like the idea, this can make our integration's code way cleaner and easier to read! |
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.
Looks already very good. Left some comments.
Some tests are still failing. I guess the GQL you can fix easily. For the Starlette tests we need to check if the behavior changed now because of the |
Update: see comment below |
@antonpirker The GQL tests that are failing are themselves appear to be broken; I don't think that the fact that they are failing indicates that this is a breaking change. The reason the tests fail is because they are doing some strange monkey patching to verify that the method we monkeypatch is still being called by the integration. I don't think we do tests like this anywhere else; looks like I added them six months ago when I was less familiar with how to best test integrations. I think we should just delete the failing tests since they provide little value, but clearly are failing even when they should not. I will open a new PR to make this change. |
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.
Looks good! Great work.
Left some typo fix
Co-authored-by: Anton Pirker <[email protected]>
This PR introduces two new decorators in
sentry_sdk.utils
that we can use in our integrations to automate the checks for whether the integration is still enabled. Since these decorators use the new scopes API, adopting these decorators may simplify the change to the new Scopes API.For example, we could replace the below sample, which uses the old Hub API:
with the code below, using these decorators:
The above example is taken from #2836; the full code is available at that PR.