fix: treat transient GitHub /user failures as inconclusive in PAT check handler (#1106)#1175
Closed
alpurkan17 wants to merge 2 commits into
Closed
fix: treat transient GitHub /user failures as inconclusive in PAT check handler (#1106)#1175alpurkan17 wants to merge 2 commits into
alpurkan17 wants to merge 2 commits into
Conversation
5296666 to
4a73298
Compare
Collaborator
|
Duplicate of #1107 which is better scoped. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a tighter version of PR #1107, implementing only the check-handler change (as requested by @anderdc in review).
handle_pat_checkused the legacyvalidate_github_credentials()wrapper that collapsesGitHubCredentialValidationinto a(github_id, error)tuple, dropping thetransient_failureflag added by #932. When GitHub's/userendpoint returns a transient error, the check handler reportedpat_valid=False— making a stored PAT appear invalid during a temporary GitHub outage.This fix uses
validate_github_credentials_result()directly and branches ontransient_failure:pat_valid=None,rejection_reason= retry-oriented messagepat_valid=False,rejection_reason= error (unchanged)pat_valid=True(unchanged)Why this is better than #1107
stored_github_idvalidate_github_credentials_result✓Validation
validate_github_credentials_result()is called directly withstored_github_id=entry.get('github_id')pat_valid=None, retry messagepat_valid=False(unchanged)_test_pat_against_repostill runs on success (unchanged)test_transient_failure_returns_inconclusivemocks transient response and assertspat_valid is NoneCloses #1106