Refined-github: Filter by "Draft PRs only" in PR list

Created on 1 Apr 2019  ยท  16Comments  ยท  Source: sindresorhus/refined-github

In a repo's PR list, it would sometimes be useful to see only draft pull requests (e.g. to close long stale drafts or look which can be made "ready to review"). This can be done by adding is:draft to the search term (see GitHub help article; unfortunately is:pr is:open -is:draft doesn't work as expected :confused:).

I see two possibilities where this could be added:

  1. On the left "Open/Close" switcher: Add a "Draft" state. Problems:

    • Takes up much space, which could reintroduce #1830.

    • A draft PR is also "open".

    • The number of open PRs would likely need to be fetched via the API.

  2. In the "Reviews" filter menu: Add a "Not ready for review (Draft PR)" item. Problem:

    • Not very discoverable.

enhancement help wanted

Most helpful comment

@FloEdelmann Oops, I just tried is:pr is:open draft:false and it works.

All 16 comments

In the "Reviews" filter menu: Add a "Not ready for review (Draft PR)" item.

I think this is good enough

Should it be a new feature (like filter-draft-prs) or part of filter-pr-by-build-status? It's the only feature that adding it to might be considered. Maybe then rename the feature to simply filter-prs?

Yeah it might make sense to make a pr-filters feature

unfortunately is:pr is:open -is:draft doesn't work as expected ๐Ÿ˜•

Oddly enough, it works as expected on the global GitHub search... ๐Ÿค”
query: repo:sindresorhus/refined-github is:pr is:open -is:draft
(currently there is one draft PR open)

I've researched a bit more:

Combining is:draft/-is:draft with is:open / is:closed is not respected at all in PR lists:

Using the exact same queries with repo:... in the global search yields the expected results:

I've contacted GitHub about this issue. Until it is fixed, adding a filter menu item that doesn't work as expected does not make sense in my opinion.

Thanks for researching, but I don't think that affects this feature much. The filter is called "Not ready for review (Draft PR)" and those repo searches show exactly that: Draft PRs. The only issue is that also _closed_ draft PRs will be shown, but that a minor problem IMHO

@FloEdelmann any reference to an issue with them that one could follow?

@vlfig No, I contacted the GitHub team via the contact form and just got an automated response with a ticket ID but no link or similar.

@FloEdelmann Oops, I just tried is:pr is:open draft:false and it works.

@vlfig Weird :smile:

draft:true/draft:false actually works as expected in both the PR list and the global search. I can't find any documentation about it though.

We started using this on our team recently and came searching for this! ๐Ÿ‘

FWIW I tried, in order:

  • Looked at Status dropdown because to me "Draft" is a status of a PR
  • Looked at Sort to see if I could at least sort drafts first
  • Looking at any other kind of dropdown label that might indicate draftness

I never looked at Reviews because I did not mentally connect Drafts with Reviews.

I never looked at Reviews because I did not mentally connect Drafts with Reviews.

But that's what they are. When you're done drafting a PR, you literally click the "Ready for review" button. ๐Ÿ˜…

Intellectually I know that, I'm just relating how I acted as a user looking
for a word related to Drafts. ๐Ÿ™

On Wed, Sep 25, 2019, 1:30 PM Federico Brigante notifications@github.com
wrote:

I never looked at Reviews because I did not mentally connect Drafts with
Reviews.

But that's what they are. When you're done drafting a PR, you literally
click the "Ready for review" button. ๐Ÿ˜…

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/sindresorhus/refined-github/issues/1900?email_source=notifications&email_token=AAEJU22R7RPAHNHPXR3EADTQLOU5PA5CNFSM4HCVJ5G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7S4RSY#issuecomment-535152843,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEJU26VPXMKWXG3HEF57R3QLOU5PANCNFSM4HCVJ5GQ
.

I didn't see this mentioned, sorry if I missed it: I'd like to have a similar filter to hide Draft PRs.

This would be especially useful around sprint time when there's a bunch of drafts and a bunch of finished ones, and it's quite hard to tell apart. It's useful to know about draft:false but I have a zillion things to remember already and would appreciate a drop down option!

I just stumbled across this section in the GitHub docs, so it seems like we implemented the correct filters :sweat_smile:

Just wanted to check since I am not certain this is working with GHE domains. For example, I see its enabled in the console:

image

But notice the filters are unchanged:

image

Is anyone else seeing this too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivapoudel picture shivapoudel  ยท  3Comments

hkdobrev picture hkdobrev  ยท  3Comments

sindresorhus picture sindresorhus  ยท  3Comments

MilesBHuff picture MilesBHuff  ยท  3Comments

juliocanares picture juliocanares  ยท  3Comments