Extend Rate and Rate Limiting with X-Ratelimit-Used and X-Ratelimit-Resource headers#3453
Merged
gmlewis merged 2 commits intogoogle:masterfrom Jan 27, 2025
Merged
Conversation
…mit-Resource` headers GitHub API docs: - Rate Limiting Header: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit - Rate Limiting Resource: https://docs.github.com/en/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user
1 task
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3453 +/- ##
=======================================
Coverage 91.02% 91.03%
=======================================
Files 179 179
Lines 15529 15535 +6
=======================================
+ Hits 14136 14142 +6
Misses 1221 1221
Partials 172 172 ☔ View full report in Codecov by Sentry. |
Collaborator
|
Thank you, @andygrunwald ! Please run |
Contributor
Author
gmlewis
approved these changes
Jan 26, 2025
Collaborator
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @andygrunwald!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
@stevehipwell - might you have time for a code review? Thank you!
Collaborator
|
Thank you, @stevehipwell! |
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.
GitHub introduced two new headrs when it comes to rate limiting:
X-Ratelimit-UsedX-Ratelimit-ResourceSee https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit
For which resources are available, see https://docs.github.com/en/rest/rate-limit/rate-limit?apiVersion=2022-11-28#get-rate-limit-status-for-the-authenticated-user
This Pull Request extends the Rate Limiting Header parsing and adds the two new information into the
Rateresponse.Additionally, the key
usedis added into the response from the/rate_limitAPI endpoint.For the
Ratetype, the docs have been updated according to the original GitHub API docs.