Skip to content

fix: prevent sentry-sdk TypeError with version check - #753

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/sentry-sdk-version-check
Open

fix: prevent sentry-sdk TypeError with version check#753
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/sentry-sdk-version-check

Conversation

@sentry

@sentry sentry Bot commented Aug 3, 2026

Copy link
Copy Markdown

This PR addresses a TypeError: Span.__init__() got an unexpected keyword argument 'name' that occurred when codecov-cli attempted to use sentry_sdk.start_span(name=...) with an older version of sentry-sdk.

The root cause was that while pyproject.toml specified sentry-sdk==2.*, some environments could still resolve to an sentry-sdk version older than 2.0.0, which does not support the name argument in Span.__init__().

Changes include:

  • Updated pyproject.toml: The sentry-sdk dependency is now specified as sentry-sdk>=2.0.0,<3.0.0 to explicitly enforce a minimum version of 2.0.0.
  • Added runtime version check: In codecov_cli/opentelemetry.py, a check has been added to verify the installed sentry_sdk version before initializing telemetry. If the version is older than 2.0.0, telemetry initialization is skipped, and a warning is logged, preventing the TypeError and ensuring graceful degradation.

Fixes CLI-FZ

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
723 1 722 1
View the full list of 1 ❄️ flaky test(s)
api.temp.calculator.test_calculator::test_divide

Flake rate in main: 100.00% (Passed 0 times, Failed 1625 times)

Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

0 participants