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

feature request - filter pull requests by reviewer #541

Open mikedfunk opened 6 years ago

mikedfunk commented 6 years ago

I used to do

gh pr --list --all --org={my_org} --assignee={me}

And I would get a list of all pull requests in my organization assigned to me. But now github has split reviewers from assignees, and my team uses the first one on the list which is reviewers. gh does not have an arg to filter by reviewer currently.

Can this be added? e.g.

gh pr --list --all --org={my_org} --reviewer={me}
protoEvangelion commented 6 years ago

@mikedfunk That seems like a helpful way to filter PRs. I am in the process of completely rewriting gh to use TypeScript and Github's new GraphQL api. Adding the ability to filter by reviewer would probably quite trivial at that point (but I am estimating that the release won't be for at least several months). If you would be willing to send a PR though against our master branch, I would likely merge your work. Otherwise I will add this to the v2 release.

protoEvangelion commented 6 years ago

On second thought, this doesn't seem to be as trivial as I imagined.

If you take a look at https://developer.github.com/v4/explorer/ and search for "pullrequests" in the docs and click on the "pullRequests" part of "Repository.pullRequests".

You will notice that we cannot filter on Github's api by the reviewer. So although it is possible, we would have to perform the filtering on our end.

amir-reconstruct commented 4 years ago

Any updates to this? It will be really handy to have this filter

protoEvangelion commented 4 years ago

No update but good to know you find this valuable. I will move it higher up in my queue unless you feel so inclined to send a PR for it ;)