Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to switch a pull request to a draft #8918

Open
khatchad opened this issue Apr 2, 2024 · 3 comments
Open

Add the ability to switch a pull request to a draft #8918

khatchad opened this issue Apr 2, 2024 · 3 comments
Labels
enhancement a request to improve CLI needs-triage needs to be reviewed

Comments

@khatchad
Copy link

khatchad commented Apr 2, 2024

Add the ability to switch an existing pull request to a draft. Currently, there doesn't seem to be such an option. I don't see it in any of the pr commands nor does it come up with gh pr edit. There seems to be other similar commands like gh pr lock and gh pr unlock. There is also gh pr ready. Maybe we need gh pr unready?

@khatchad khatchad added the enhancement a request to improve CLI label Apr 2, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Apr 2, 2024
@williammartin
Copy link
Member

I think you're looking for gh pr ready --undo. I don't know the historical reasons for this being a flag on pr ready but it was outlined here: #2271 (comment)

@khatchad
Copy link
Author

khatchad commented Apr 2, 2024

The scenario I am thinking of is where a PR was never a draft to begin with. This, "undo" would seem a bit counterintuitive. The edit flag looks good, but what I was thinking of was something along the lines of lock and unlock (i.e., ready and unready).

@williammartin
Copy link
Member

williammartin commented Apr 2, 2024

This, "undo" would seem a bit counterintuitive.

Yeh, that's why I'm not sure why a flag was chosen originally, but it is the behaviour you're looking for. Behind the scenes it maps to convertPullRequestToDraft graphql mutation, so it's not really anything to do with undoing at all.

The edit flag looks good

This doesn't exist, it was a design proposal that wasn't implemented in #5995

but what I was thinking of was something along the lines of lock and unlock (i.e., ready and unready).

Yeh this has been discussed before and rejected here: #7053

That said, no one from the team that made that decision is still working on the project and I'm sympathetic to the fact that you're not undoing anything and it's also kind of hard to discover. Still, I'm not sure it's worth us addressing until we do a v3 as it's also confusing to have two ways supported ways of achieving the same thing.

In the meantime I'd suggest you gh alias set unready "gh pr ready --undo".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants