Skip to content
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

[FEAT]: Octokit::Client::PullRequests#pull_requests should accept a block. #1508

Open
1 task done
jordansissel opened this issue Nov 14, 2022 · 2 comments
Open
1 task done
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@jordansissel
Copy link

Describe the need

It is nice to use auto_paginate, but sometimes it is nice to also interrupt pagination when I have found the results I'm looking for.

It looks like paginate accepts a block, but pull_requests does not. It would be nice to be able to pass a block to pull_requests in order to process each page as it is fetched and, further, so that pagination may be interrupted with an exception if desired.

The current alternatives are:

  • Continue using pull_requests with auto_paginate and assume the time cost of receiving every page of results
  • Paginate outside of Octokit by invoking client.get(client.last_response[:rels].href).

Example use case: I want all PRs merged after a given time. Best I can tell, the github pull_requests api doesn't allow this granularity, so one search pull requests by date and then stop paginating once we find the first pull that's older than the requested time.

SDK Version

No response

API Version

No response

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jordansissel jordansissel added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Nov 14, 2022
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Apr 20, 2024
@jordansissel
Copy link
Author

jordansissel commented Apr 20, 2024 via email

@github-actions github-actions bot removed the Status: Stale Used by stalebot to clean house label Apr 21, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants