node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Listing issues only returns 30 results and there's no way to paginate #438

Closed biddster closed 5 years ago

biddster commented 8 years ago

I'm trying to list all of the issues closed in a milestone:

gh is --list --state closed --milestone '1.1.0'

I know from GitHub web that there are 50 issues closed but I only get 30 on the command line from gh.

I can see that the repo command has the per_page setting as per the github api docs. Seems that hasn't been implemented here (or I've missed a command line switch, in which case, apologies).

What I'd really like for my automation purposes is to be able to retrieve the exhaustive issue list from GitHub via gh.

PS - great work, gh is brilliant.

hildjj commented 8 years ago

Same problem for gh re -l. There are several pages in the response. If you don't want to get one long page, you can use the Link header with rel next to follow the subsequent pages.

henvic commented 8 years ago

This is related to GitHub's rate limit: https://developer.github.com/v3/rate_limit/

If someone can send a pull request I would really appreciate it and as long as it doesn't have any issues I am going to merge and release a new version right away, otherwise there isn't much I can't do for now. Sorry about that.

timdp commented 7 years ago

Can you explain how this is related to rate limiting? It's just standard pagination. GitHub expects you to use the metadata supplied by the API to get all the pages using consecutive calls. You'll have to make a ton of calls before you hit the rate limit, and in that case, you can still implement a backoff mechanism as a fallback.

Nowaker commented 7 years ago

This would be appreciated a lot.

protoEvangelion commented 5 years ago

Should list the full amount of issues now.