* [CI] check_bad_commit: use EFS cache to avoid Xet FUSE OOM (exit 137)
Temporary workaround matching huggingface/transformers-ci#184: set
HF_HOME=/mnt/efs_cache when the mount is present so pytest loads large
model weights from EFS instead of Xet FUSE, avoiding the cgroup RAM
exhaustion that kills the process with exit 137.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* simplify comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
* format
* fix
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: pass GitHub token to API calls in check_bad_commit.py to avoid rate limiting
Adds a `--github_token` argument (default None) and passes it as an
Authorization header to all `requests.get` calls in `get_commit_info`,
raising the rate limit from 60 to 5000 req/hour when a token is provided.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use consistent GitHub API header format (Bearer + Accept)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ci: pass GITHUB_TOKEN to check_bad_commit.py in workflow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style
* more secure
* fix: guard commit_info parents access against error API responses
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: consistent early-return schema and pass GitHub token via env var
- Add `parent: None` to the early-return dict when commit is None, so the
return schema is consistent for all callers
- Pass GITHUB_TOKEN as an env var instead of a CLI arg to avoid potential
token exposure in the process list; script falls back to GITHUB_TOKEN env
var when --github_token is not supplied
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* improve ruff setup
* fix
* ruff was already bumped, no need to remove
* remove F402
* remove one more
* one more
* latest ruff
* fix
* more removed rules
* last removed exceptions
* fix copies again
* fix
* fix
* all typing
* fix copies
* consistency
* fix
* oupsi
* more precise modular converter
* doc
* last fix