Skip to content

Handle GitHub token cleanup network failures without masking root errors#77

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

Handle GitHub token cleanup network failures without masking root errors#77
cursor[bot] wants to merge 1 commit intomainfrom
cursor/high-impact-sentry-errors-d5ae

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 18, 2026

Summary

  • wrap GitHub App token revocation in GithubAppToken.get_token() with best-effort error handling
  • log revocation failures instead of raising, so the original workflow processing exception is preserved
  • add regression tests for successful cleanup and for cleanup network failure while propagating the original exception

Validation

  • python3 -m pytest tests/test_github_app.py

Sentry incident

  • Addresses SENTRY-GITHUB-ACTIONS-APP-72 (ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))
  • Root cause: cleanup requests.delete(...) in context manager finally could raise a second network exception and mask the true upstream failure path
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