-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paginate when retrieving check runs and check suites #1321
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
We let the client decide whether they want to auto paginate or not in their settings https://github.com/octokit/octokit.rb#pagination. This helps with rate limiting an other factors.
Would you mind just updating the calls to use paginate
without the block?
I took a look at The API response, and now I see why you had to change the block because we list checks
as an array in the payload body:
https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite
This is exactly what we do with
octokit.rb/lib/octokit/client/apps.rb
Lines 48 to 50 in 6df1ed8
paginate("user/installations", options) do |data, last_response| | |
data.installations.concat last_response.data.installations | |
end |
Mind just adding tests 😅
Thanks for the comment!
Okay, I'll add tests 👍 |
@a2ikm Do you still want to add tests for this changes? @matiasalbarello @lhmzhou Do you want to help it? |
@matiasalbarello I'm actually no longer maintaining Octokit #1365 apologies for the delay. |
@kou On the other hand, @matiasalbarello's PR looks good. |
Closing this one in favor of: @matiasalbarello's PR. Thank you @a2ikm for your effort here and for getting this work in motion. ❤️ |
As far as I've investigated, the following check APIs return the link headers:
This PR allows
auto_paginate
in them.