Skip to content

Draft PR button not automatically selected when previewing on web #558

Closed

Description

@mm326

Issue

Using version gh version 0.5.7 (2020-02-20)

The Create draft pull request button isn't automatically selected when previewing PR on the web, even though the -d or --draft flag is set on the gh pr create command.

Steps to reproduce the behavior

  1. gh pr create -d
  2. Add title and body
  3. View the output https://github.com/mm326/studious-bassoon/compare/master...branch2?expand=1&title=Draft+PR

Expected vs actual behavior

I expected that the create draft pull request button to be the default button when previewing a created pr from the cli when the -d flag is set.

Actual outcome:
Screenshot 2020-02-27 at 16 20 35

Expected outcome:
Screenshot 2020-02-27 at 16 28 56

Activity

  1. rista404 commented on Feb 27, 2020

    @rista404
    Contributor

    Looks like GitHub doesn't support setting drafts via query params: Supported query parameters

  2. mislav commented on Feb 28, 2020

    @mislav
    Contributor

    Since -d cannot be translated to the web, I'm wondering what the right behavior would be here. Perhaps to error out and say that you can't use -d with -w?

  3. mm326 commented on Feb 29, 2020

    @mm326
    Author

    Sorry for the late reply yeah that could be an option. I didn't specify the -w flag but entered preview in web which might of been a -w flag.

  4. mislav commented on Mar 11, 2020

    @mislav
    Contributor

    I didn't specify the -w flag but entered preview in web which might of been a -w flag.

    Note that even though we've closed this issue, it's still technically allowed to use --draft and select "Preview" in the prompt, which would then open the web interface and disregard --draft being passed. The referenced fix only covers the case when --draft was used in combination with --web.

    Right now it's not technically possible for us to respect --draft in "Preview" mode, but we're not sure how to best communicate this to the user. We don't want to abort the "Preview" operation at that point because that would discard the text that the person entered for PR title & body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions