Skip to content

Prevent cleanup failures from masking GitHub webhook errors#91

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/high-impact-sentry-errors-2871
Draft

Prevent cleanup failures from masking GitHub webhook errors#91
cursor[bot] wants to merge 1 commit intomainfrom
cursor/high-impact-sentry-errors-2871

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 22, 2026

Summary

  • make GitHub App token revocation in GithubAppToken.get_token() best-effort
  • catch and log requests.RequestException during token cleanup so the original application error is preserved
  • add focused regression tests for cleanup-failure behavior

Root cause addressed

SENTRY-GITHUB-ACTIONS-APP-75 showed that a network failure while revoking installation tokens (requests.delete(...) in the context manager finally block) could raise ConnectionError and mask the original business error (for example, the upstream 403 while fetching sentry_config.ini).

Validation

  • Ran: python3 -m pytest -q tests/test_github_app.py tests/test_web_app_handler.py tests/test_sentry_config_file.py
  • Result: pass (with one pre-existing skipped test in test_web_app_handler.py)
Open in Web View Automation 

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
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.

1 participant