Skip to content

fix(worker): catch NoConfiguredAppsAvailable in load_commit_diff#727

Open
thomasrockhu-codecov wants to merge 1 commit intomainfrom
fix/catch-bot-exceptions-in-load-commit-diff
Open

fix(worker): catch NoConfiguredAppsAvailable in load_commit_diff#727
thomasrockhu-codecov wants to merge 1 commit intomainfrom
fix/catch-bot-exceptions-in-load-commit-diff

Conversation

@thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Feb 26, 2026

Summary

  • load_commit_diff already handles TorngitError and RepositoryWithoutValidBotError by returning None (the diff is optional), but NoConfiguredAppsAvailable and OwnerWithoutValidBotError were not caught
  • When a GitHub App is misconfigured, rate-limited, or suspended for an org, these exceptions propagated up and crashed the entire upload_finisher task instead of gracefully skipping the diff
  • This was causing ~240 errors/6h for SciML/* repos in production, contributing to the upload_finisher queue backlog (~60k tasks)

Test plan

  • test_load_commit_diff_no_configured_apps — mocks get_repo_provider_service to raise NoConfiguredAppsAvailable, asserts load_commit_diff returns None
  • test_load_commit_diff_owner_without_bot — same pattern for OwnerWithoutValidBotError
  • CI passes

Made with Cursor


Note

Low Risk
Low risk: this only broadens exception handling around optional diff fetching and adds unit coverage; primary impact is reduced task failures when GitHub app configuration is invalid or unavailable.

Overview
load_commit_diff in upload_finisher now also catches NoConfiguredAppsAvailable and OwnerWithoutValidBotError, records the existing REPO_BOT_INVALID commit error, logs a warning, and returns None so the finisher continues without a diff.

Unit tests were added to assert these new exception cases are handled by returning None (matching prior behavior for missing diffs and invalid repo bots).

Written by Cursor Bugbot for commit 49c4fbf. This will update automatically on new commits. Configure here.

load_commit_diff already handles TorngitError and
RepositoryWithoutValidBotError by returning None (the diff is
optional), but NoConfiguredAppsAvailable and OwnerWithoutValidBotError
were not caught. When a GitHub App is misconfigured, rate-limited, or
suspended for an org, these exceptions propagated up and crashed the
entire upload_finisher task instead of gracefully skipping the diff.

This was causing ~240 errors/6h for SciML/* repos in production,
contributing to the upload_finisher queue backlog.

Made-with: Cursor
@sentry
Copy link

sentry bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (ed64332) to head (49c4fbf).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #727   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files        1302     1302           
  Lines       47890    47893    +3     
  Branches     1628     1628           
=======================================
+ Hits        44177    44180    +3     
  Misses       3404     3404           
  Partials      309      309           
Flag Coverage Δ
workerintegration 58.60% <25.00%> (-0.02%) ⬇️
workerunit 90.33% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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.

2 participants