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

ref(integrations): Use ensure_integration_enabled decorator #2906

Merged
merged 18 commits into from Mar 28, 2024

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Mar 26, 2024

Using the ensure_integration_enabled decorator which now supports not providing a function.

This is a best effort PR. We can't use the decorator everywhere.

  • For instance, in the Mongo integration and couple more places, the integration class hasn't been defined yet at the point in time where we want to use the decorator. We can't move the definition up either because of interdependencies between things.
  • Sometimes, applying the decorator makes the tests fail (this is the fix for one of those cases). Also e.g. in Starlite or one place in Starlette.

@sentrivana sentrivana changed the title ref(integrations): Use ensure_integration_enabled decorator ref(integrations): Use ensure_integration_enabled decorator Mar 26, 2024
@sentrivana sentrivana added this to the Better async support milestone Mar 28, 2024
@sentrivana sentrivana marked this pull request as ready for review March 28, 2024 09:44
@sentrivana sentrivana removed this from the Better async support milestone Mar 28, 2024
@sentrivana
Copy link
Contributor Author

I'm aware of the failing Lint step but very confused by it:

sentry_sdk/integrations/flask.py:79: error: Untyped decorator makes function "sentry_patched_wsgi_app" untyped  [misc]
  1. I didn't even touch this part of the code in this PR.
  2. The decorator is properly typed...

Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Yeah!

Just some small nitpicking

sentry_sdk/integrations/strawberry.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/falcon.py Outdated Show resolved Hide resolved
sentry_sdk/integrations/falcon.py Outdated Show resolved Hide resolved
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Looks generally good to me, please check @antonpirker's comments before merging

@sentrivana sentrivana merged commit b38f9c7 into sentry-sdk-2.0 Mar 28, 2024
111 checks passed
@sentrivana sentrivana deleted the ivana/2.0/new-deco branch March 28, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants