Skip to content

ref: Add streaming trace decorator (7) #6331

ref: Add streaming trace decorator (7)

ref: Add streaming trace decorator (7) #6331

Triggered via pull request March 5, 2026 15:22
Status Success
Total duration 3m 45s
Artifacts 2

test-integrations-flags.yml

on: pull_request
Matrix: Flags
All Flags tests passed
3s
All Flags tests passed
Fit to window
Zoom out
Zoom in

Annotations

1 error and 25 warnings
StreamedSpan context manager doesn't set scope.span, breaking automatic span parenting: sentry_sdk/traces.py#L234
The `__enter__` method returns `self` without setting `scope.span = self`, and `__exit__` does nothing. This breaks automatic span parenting: when using `with start_span(name='A'):` followed by nested `start_span(name='B')`, span B won't detect span A as its parent because `scope.span` is never updated. Compare with `tracing.py:Span.__enter__` (lines 389-394) which correctly sets `scope.span = self` and `__exit__` (lines 396-406) which restores the old span.
Flags (3.10, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.10, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.7, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.7, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.9, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.9, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.9, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.8, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.8, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.8, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.12, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.12, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.12, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.14t, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.14t, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.14t, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.14, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.14, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.14, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
New streaming trace decorator lacks test coverage: sentry_sdk/traces.py#L366
The new `sentry_sdk.traces.trace` decorator has no dedicated test coverage. The existing tests in `tests/tracing/test_decorator.py` only test the old `sentry_sdk.tracing.trace` decorator. The new streaming decorator should have functional tests covering: basic usage, usage with parameters (name, attributes, active), decorator behavior with sync/async functions, and edge cases like exception handling.
[EW2-W2A] New streaming trace decorator lacks test coverage (additional location): sentry_sdk/tracing_utils.py#L945
The new `sentry_sdk.traces.trace` decorator has no dedicated test coverage. The existing tests in `tests/tracing/test_decorator.py` only test the old `sentry_sdk.tracing.trace` decorator. The new streaming decorator should have functional tests covering: basic usage, usage with parameters (name, attributes, active), decorator behavior with sync/async functions, and edge cases like exception handling.
Flags (3.13, ubuntu-22.04)
❌ Patch coverage check failed: 17.50% < target 80%
Flags (3.13, ubuntu-22.04)
Failed to upload coverage artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
Flags (3.13, ubuntu-22.04)
Failed to upload test artifact: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
StreamedSpan.__exit__ is no-op, contradicting documented auto-finish behavior: sentry_sdk/traces.py#L237
The `__exit__` method added to `StreamedSpan` is a no-op (`pass`), but the documentation at line 88 states 'The span automatically finishes once the `with` block is exited' and the `@trace` decorator docstring (line 377) says it 'finishes the span when the function returns or raises an exception'. Additionally, unlike the existing `Span.__exit__` in tracing.py (lines 396-406), this implementation doesn't set error status on exceptions, doesn't call a finish/end method, and doesn't restore scope state. Users relying on context manager semantics will have spans that never complete.

Artifacts

Produced during runtime
Name Size Digest
codecov-coverage-results-ivana-span-first-7-add-trace-decorator-test-flags
106 KB
sha256:37b247c59a7de7456fcdacacaab85a4961a5e783024bdd209466dce440475e8c
codecov-test-results-ivana-span-first-7-add-trace-decorator-test-flags
230 Bytes
sha256:b691467193bd327992355981e2bbe95750b0c95adf2cc36cf09f1fa725c4c4b2