pytorch
7b5f8988 - [GHF] Auth when trying to fetch labels (#103679)

Commit
2 years ago
[GHF] Auth when trying to fetch labels (#103679) There were few merge bot failures reported recently due to HTTP/403 error: - https://github.com/pytorch/pytorch/actions/runs/5269083146/jobs/9526693976#step:6:80 - https://github.com/pytorch/pytorch/actions/runs/5272750075/jobs/9535376256#step:6:93 Which likely stems from the fact that `_fetch_url` method did not try to pass the auth token even when it was available and as result was rate-limited to 60 requests per hour, according to [Resources in the REST API](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limit-headers) Refactor `gh_fetch_url` into `gh_fetch_url_and_headers` and use it from `request_for_labels` to utilize auth token, if available, which bumps rate limit to 1000 per hour as well as print more actionable message when rate limit is exceeded. <!-- copilot:poem --> ### <samp>🤖 Generated by Copilot at 499b805</samp> > _`gh_fetch_url` splits_ > _returns headers and body_ > _wrapper function_ Pull Request resolved: https://github.com/pytorch/pytorch/pull/103679 Approved by: https://github.com/jeanschmidt, https://github.com/kit1980
Author
Committer
Parents
Loading