简体   繁体   中英

Is there a way to filter pull requests where my review is stale/dismissed?

On GitHub, I would like to be able to have a list of Pull Requests that require my attention. This must include any pull request that is created by a member of my team that was not authored by me, but requires a review from me. So far, I have this:

is:pr is:open user:<ORGANIZATION> involves:coworker involves:coworker -author:@me -reviewed-by:@me

The problem is, when my review is dismissed or becomes stale, -reviewed-by:@me filters out that pull request because I've previously reviewed it, even though that review has been dismissed. If I've already approved it or if the pull request has changes requested by me that are not outdated, I do not want to see them in the list.

Is there an online query to be able to list these pull requests from github.com/pulls ?

Taking inspiration of this use-case which illustrate the power of GitHub CLI gh , you could, for each of the currently listed PR, do a check (using the "List reviews for a pull request" API ):

gh api repos/<your repo name>/pulls/<PR ID>/reviews --jq '.[] | [.id,.state] | join("=")' | grep -Po '\d+(?=\=DISMISSED)'

You can add the .user.login attribute to filter on your name and check if you have, for a given PR, reviews in "DISMISSED" state.
If yes, you know you can filter you that PR from your intial query.

This is not straightforward, as some processing is needed, but it can help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM