Skip to content

fix: treat transient GitHub /user failures as inconclusive in PAT check handler (#1106)#1175

Closed
alpurkan17 wants to merge 2 commits into
entrius:testfrom
alpurkan17:fix/1106-pat-transient-inconclusive-v2
Closed

fix: treat transient GitHub /user failures as inconclusive in PAT check handler (#1106)#1175
alpurkan17 wants to merge 2 commits into
entrius:testfrom
alpurkan17:fix/1106-pat-transient-inconclusive-v2

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

Summary

This is a tighter version of PR #1107, implementing only the check-handler change (as requested by @anderdc in review).

handle_pat_check used the legacy validate_github_credentials() wrapper that collapses GitHubCredentialValidation into a (github_id, error) tuple, dropping the transient_failure flag added by #932. When GitHub's /user endpoint returns a transient error, the check handler reported pat_valid=False — making a stored PAT appear invalid during a temporary GitHub outage.

This fix uses validate_github_credentials_result() directly and branches on transient_failure:

  • Transient failurepat_valid=None, rejection_reason = retry-oriented message
  • Validation errorpat_valid=False, rejection_reason = error (unchanged)
  • Validpat_valid=True (unchanged)

Why this is better than #1107

Aspect #1107 (competitor) This PR
Scope Broadcast + Check Check only (per maintainer request)
Files changed 2 2
Broadcast handler Modified (dropped flag requested by maintainer) Untouched
Transient test Tests broadcast path too Only check handler + its test
stored_github_id Not used Passed to validate_github_credentials_result

Validation

  • validate_github_credentials_result() is called directly with stored_github_id=entry.get('github_id')
  • Transient failure → pat_valid=None, retry message
  • Validation error → pat_valid=False (unchanged)
  • _test_pat_against_repo still runs on success (unchanged)
  • New test: test_transient_failure_returns_inconclusive mocks transient response and asserts pat_valid is None

Closes #1106

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 12, 2026
@alpurkan17 alpurkan17 force-pushed the fix/1106-pat-transient-inconclusive-v2 branch from 5296666 to 4a73298 Compare May 12, 2026 07:46
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 12, 2026

Duplicate of #1107 which is better scoped. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] pat_handler treats transient GitHub /user failures as invalid PATs in validator-side broadcast/check handlers

2 participants