Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊❌ 25 failed | Total: 25 | Pass Rate: 0% | Execution Time: 1m 23s 📊 Comparison with Base Branch
➕ New Tests (25)View new tests
❌ Failed Tests
|
| File | Patch % | Lines |
|---|---|---|
scope.py |
26.73% | |
_wsgi_common.py |
0.00% | |
wsgi.py |
0.00% | |
_asgi_common.py |
0.00% |
Coverage diff
@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 21.06% 9.90% -11.16%
==========================================
Files 191 191 —
Lines 21281 21334 +53
Branches 7006 7034 +28
==========================================
+ Hits 4481 2112 -2369
- Misses 16800 19222 +2422
- Partials 345 22 -323Generated by Codecov Action
Codecov Results 📊✅ 49 passed | ⏭️ 3 skipped | Total: 52 | Pass Rate: 94.23% | Execution Time: 12.36s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 7.81%. Project has 15640 uncovered lines. Files with missing lines (5)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 26.75% 26.70% -0.05%
==========================================
Files 191 191 —
Lines 21281 21336 +55
Branches 7006 7036 +30
==========================================
+ Hits 5692 5696 +4
- Misses 15589 15640 +51
- Partials 490 490 —Generated by Codecov Action |
| import sentry_sdk | ||
| from sentry_sdk._types import SENSITIVE_DATA_SUBSTITUTE | ||
| from sentry_sdk._werkzeug import _get_headers | ||
| from sentry_sdk.integrations.wsgi import get_client_ip, get_request_url |
There was a problem hiding this comment.
Circular import between wsgi.py and _wsgi_common.py will cause ImportError at runtime
The new import from sentry_sdk.integrations.wsgi import get_client_ip, get_request_url creates a circular dependency. wsgi.py imports _get_request_attributes from _wsgi_common.py (line 12 in wsgi.py), while _wsgi_common.py now imports from wsgi.py. When wsgi.py is loaded first, it will fail because _wsgi_common.py will try to import symbols from wsgi.py before they're defined. This will cause an ImportError or AttributeError at runtime.
Verification
Read both wsgi.py (lines 1-20) and _wsgi_common.py (lines 1-15) to confirm the import structure. wsgi.py imports _get_request_attributes from _wsgi_common.py at line 12. _wsgi_common.py now imports get_client_ip and get_request_url from wsgi.py at line 8. This is a classic circular import pattern that will fail at runtime.
Identified by Warden code-review · RW9-LXB
Description
Make the WSGI integration span first ready.
Also, set an additional attribute (
user.ip_address) in ASGI.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)