Skip to content

fix: ignore exceptions originating outside codecov_cli in before_send - #819

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/filter-external-exceptions-before-send
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/filter-external-exceptions-before-send

Conversation

@sentry

@sentry sentry Bot commented Nov 5, 2026

Copy link
Copy Markdown

When codecov-cli is invoked programmatically (for example via click's CliRunner in a host script), sentry_sdk.init sets up process-wide exception handling. If the host script later raises an unhandled exception whose stack frames contain no codecov_cli code (such as attempting to import an invalid module like prevent_cli), Sentry captures it as a crash in the cli project.

This update checks exception stack frames in _before_send and drops events where no frames originate from codecov_cli, preventing noise from external scripts from polluting Sentry while keeping CLI reporting intact.

Fixes CLI-J5

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
727 1 726 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 1882 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.

This branch has not been deployed

No deployments
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