Repository navigation
CI: use a single function for GH calls - #47474
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
ydshieh
reviewed
Jul 27, 2026
…o github_utils - Add _log_token_status(): calls /rate_limit once before the retry loop (no quota consumed). Fails immediately if: CI env with no token, token rejected (401), or quota already exhausted (remaining=0). 401 with vs. without token gives distinct actionable error messages. - Add _log_rate_limit_headers(): prints limit/used/remaining/reset on every request attempt, labeled [initial] / [retry N/M]. Skipped on 401 (GitHub omits those headers on auth failures). - Remove _is_expired_or_bad_token(): pre-flight check catches bad tokens earlier; 401s in the retry loop fall through to the generic fail-hard with the raw body. - Update tests: remove IsExpiredOrBadTokenTest (function deleted), add LogTokenStatusTest covering all _log_token_status failure modes, patch _log_token_status in GithubRequestTest.setUp so mock responses are not consumed by the pre-flight call. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
get_github_json now raises RuntimeError on error responses (rate limiting, auth failures, etc.) rather than returning an error dict. Update comments in notification_service.py and check_bad_commit.py that incorrectly described the old behaviour, while keeping the defensive .get() calls which guard against unexpected response shapes. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Collaborator
|
run-slow: vit |
Contributor
|
This comment contains models: ["models/vit"] |
Contributor
CI recapDashboard: View test results in Grafana |
ydshieh
approved these changes
Jul 28, 2026
stevhliu
pushed a commit
to stevhliu/transformers
that referenced
this pull request
Jul 30, 2026
* use a single function for GH calls * check token before loop * Add pre-flight token/quota check and per-request rate-limit logging to github_utils - Add _log_token_status(): calls /rate_limit once before the retry loop (no quota consumed). Fails immediately if: CI env with no token, token rejected (401), or quota already exhausted (remaining=0). 401 with vs. without token gives distinct actionable error messages. - Add _log_rate_limit_headers(): prints limit/used/remaining/reset on every request attempt, labeled [initial] / [retry N/M]. Skipped on 401 (GitHub omits those headers on auth failures). - Remove _is_expired_or_bad_token(): pre-flight check catches bad tokens earlier; 401s in the retry loop fall through to the generic fail-hard with the raw body. - Update tests: remove IsExpiredOrBadTokenTest (function deleted), add LogTokenStatusTest covering all _log_token_status failure modes, patch _log_token_status in GithubRequestTest.setUp so mock responses are not consumed by the pre-flight call. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Fix stale comments about get_github_json error handling get_github_json now raises RuntimeError on error responses (rate limiting, auth failures, etc.) rather than returning an error dict. Update comments in notification_service.py and check_bad_commit.py that incorrectly described the old behaviour, while keeping the defensive .get() calls which guard against unexpected response shapes. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * format * fix --------- Co-authored-by: ydshieh <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Sainava
pushed a commit
to Sainava/Sai-transformers
that referenced
this pull request
Aug 3, 2026
* use a single function for GH calls * check token before loop * Add pre-flight token/quota check and per-request rate-limit logging to github_utils - Add _log_token_status(): calls /rate_limit once before the retry loop (no quota consumed). Fails immediately if: CI env with no token, token rejected (401), or quota already exhausted (remaining=0). 401 with vs. without token gives distinct actionable error messages. - Add _log_rate_limit_headers(): prints limit/used/remaining/reset on every request attempt, labeled [initial] / [retry N/M]. Skipped on 401 (GitHub omits those headers on auth failures). - Remove _is_expired_or_bad_token(): pre-flight check catches bad tokens earlier; 401s in the retry loop fall through to the generic fail-hard with the raw body. - Update tests: remove IsExpiredOrBadTokenTest (function deleted), add LogTokenStatusTest covering all _log_token_status failure modes, patch _log_token_status in GithubRequestTest.setUp so mock responses are not consumed by the pre-flight call. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Fix stale comments about get_github_json error handling get_github_json now raises RuntimeError on error responses (rate limiting, auth failures, etc.) rather than returning an error dict. Update comments in notification_service.py and check_bad_commit.py that incorrectly described the old behaviour, while keeping the defensive .get() calls which guard against unexpected response shapes. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * format * fix --------- Co-authored-by: ydshieh <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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.
What does this PR do?