fix: report PAT check as inconclusive on transient GitHub /user failures#1123
Closed
statxc wants to merge 1 commit into
Closed
fix: report PAT check as inconclusive on transient GitHub /user failures#1123statxc wants to merge 1 commit into
statxc wants to merge 1 commit into
Conversation
8160645 to
fbe7417
Compare
|
duplicate of #1107. |
Contributor
Author
|
@anderdc Hi, could you please take look at this PR carefully? |
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
When the GitHub
/userendpoint is temporarily unreachable,handle_pat_checkwas reporting stored PATs as invalid (pat_valid = False), which surfaces ingitt miner checkas a hard "PAT invalid" message. That can push miners to rotate a token that's actually fine — the validator just couldn't reach GitHub.This PR keeps the existing failure path for permanent errors and adds a third state for transient failures:
pat_valid = None(inconclusive) with a short "please retry in a few minutes" message. The check handler now usesvalidate_github_credentials_result()so thetransient_failureflag introduced in #932 isn't dropped.The broadcast handler is intentionally not changed — it already rejects the PAT and short-circuits the same way before and after, so swapping the rejection string there isn't worth the extra surface area.
Related Issues
Closes #1106
Type of Change
Testing
Added
test_transient_identity_lookup_reports_inconclusive— patchesget_github_identityto returnTRANSIENT_FAILUREend-to-end and assertspat_valid is None, the inconclusive message, and that the GraphQL test query is not called (proves the early return).Updated
test_valid_patandtest_stored_but_invalid_patto patch the new symbol (validate_github_credentials_result); behavior assertions are unchanged.Local run:
Checklist