-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(messaging): Removing Integration Namespace Imports #72033
Conversation
def get_provider(instance: Integration | RpcIntegration) -> IntegrationProvider: | ||
from sentry import integrations | ||
from sentry.integrations.manager import default_manager as integrations | ||
|
||
return integrations.get(instance.provider) |
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.
Probably a sign that this method doesn't belong here, since the import should be happening the other way around. Or, if anything, move this to a util file under manager
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #72033 +/- ##
=======================================
Coverage 77.91% 77.91%
=======================================
Files 6573 6573
Lines 292707 292751 +44
Branches 50523 50527 +4
=======================================
+ Hits 228059 228100 +41
- Misses 58401 58406 +5
+ Partials 6247 6245 -2
|
Importing the entire
integration
module is bad practice and it turns out we only do it to access theIntegrationManager
. I moved the instantiation of the manager back to the original file and import the manager directly.