gh icon indicating copy to clipboard operation
gh copied to clipboard

feature request - filter pull requests by reviewer

Open mikedfunk opened this issue 6 years ago • 4 comments

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}

mikedfunk avatar Jun 21 '18 18:06 mikedfunk

@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 avatar Jul 14 '18 20:07 protoEvangelion

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.

protoEvangelion avatar Jul 14 '18 21:07 protoEvangelion

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

amir-reconstruct avatar Nov 21 '19 22:11 amir-reconstruct

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 ;)

protoEvangelion avatar Nov 22 '19 16:11 protoEvangelion