Skip to content

.

b270e5a
Select commit
Loading
Failed to load commit list.
Draft

feat(asgi): Migrate away from event processor in span first #5920

.
b270e5a
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Apr 1, 2026 in 3m 41s

2 issues

code-review: Found 2 issues (1 high, 1 medium)

High

Test parameterization duplicates same values, never tests span_streaming=True code path - `tests/integrations/asgi/test_asgi.py:170`

The @pytest.mark.parametrize decorator specifies [[False, True], [False, True]] - two identical test cases. This means span_streaming is always False, so the entire if span_streaming: branch (lines 198-222) that validates the new span streaming functionality is never executed. The PR's stated purpose is to migrate away from event processors in span-first mode, but this test doesn't actually test that functionality.

Medium

envelopes_to_spans raises KeyError when span has no attributes - `tests/conftest.py:1230-1232`

The function directly accesses span_json["attributes"] which will raise a KeyError if the span has no attributes. Looking at _span_batcher.py:116-119, the attributes field is only serialized when item._attributes is truthy - spans without attributes won't have this key in the JSON. This will cause test failures if any span being parsed lacks attributes.


Duration: 3m 34s · Tokens: 1.2M in / 15.0k out · Cost: $1.73 (+extraction: $0.00, +merge: $0.00, +fix_gate: $0.01)

Annotations

Check failure on line 170 in tests/integrations/asgi/test_asgi.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

Test parameterization duplicates same values, never tests span_streaming=True code path

The `@pytest.mark.parametrize` decorator specifies `[[False, True], [False, True]]` - two identical test cases. This means `span_streaming` is always `False`, so the entire `if span_streaming:` branch (lines 198-222) that validates the new span streaming functionality is never executed. The PR's stated purpose is to migrate away from event processors in span-first mode, but this test doesn't actually test that functionality.

Check warning on line 1232 in tests/conftest.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

envelopes_to_spans raises KeyError when span has no attributes

The function directly accesses `span_json["attributes"]` which will raise a `KeyError` if the span has no attributes. Looking at `_span_batcher.py:116-119`, the `attributes` field is only serialized when `item._attributes` is truthy - spans without attributes won't have this key in the JSON. This will cause test failures if any span being parsed lacks attributes.