Skip to content

Option flag to open a created pull request in browser (not in edit mode) #478

Closed

Description

@oscard0m

Describe the feature or problem you’d like to solve

It would be nice to have an option to open the URL of the pull-request a user creates (gh pr create) immediately after creating it but not in edit-mode as the flag -w | --web is doing.

A clear and concise description of what the feature or problem is.
When you apply the -w | --web flag, a created Pull Request is opened in edit mode (https://github.com/<user|company>/<repository>/compare/<branch-name>?expand=1), giving the option to the user to edit the title and body of the PR and finally submitting its creation:
image

It would be nice to have the option to open the browser immediately after the Pull Request is created and with all the title and body already set. The URL to open would be: https://github.com/<user|company>/<repo>/pull/<pull-request-id>

image

Proposed solution

The flag would need a deep discussion but to follow the approach of hub would be an start:

-o | --browser behaviour combined with -e | --edit / --no-edit flags

Additional context

Feel free to link or close if duplicate issue.

Also, if you agree on the proposal I would be happy to contribute to support this feature!

Activity

  1. added
    enhancement
    on Feb 19, 2020
  2. yassinecc commented on Apr 8, 2020

    @yassinecc

    Much needed when switching from hub, with gh I used to do something like I run this within a PR creation script

    gh pr create -t $PR_TITLE -b $DESCRIPTION -B $BASE | grep -o "https.*github.*" | xargs gh pr view --web

    but it stopped working in a recent release of gh and it works :-)

    EDIT: I forgot to add the --web flag

  3. oscard0m commented on Apr 8, 2020

    @oscard0m
    ContributorAuthor

    Much needed when switching from hub, with gh I used to do something like

    gh pr create -t $PR_TITLE -b $DESCRIPTION -B $BASE | grep -o "https.*github.*" | xargs gh pr view

    but it stopped working in a recent release of gh

    nice hack in the meantime :)

  4. yassinecc commented on Apr 8, 2020

    @yassinecc

    Much needed when switching from hub, with gh I used to do something like

    gh pr create -t $PR_TITLE -b $DESCRIPTION -B $BASE | grep -o "https.*github.*" | xargs gh pr view

    but it stopped working in a recent release of gh

    nice hack in the meantime :)

    I amended my comment, the script works with the --web flag

  5. oscard0m commented on Apr 8, 2020

    @oscard0m
    ContributorAuthor

    @mislav @billygriffin Would it be possible to draft a PR from my end to support this? Sounds like a very good first contribution.

    @yassinecc would you like to collaborate on it? :)

  6. billygriffin commented on Apr 8, 2020

    @billygriffin
    Contributor

    Hi @dominguezcelada, thanks for the clear explanation here! I'm having a hard time understanding the difference between viewing the PR in the web browser before the PR is created vs. after the PR is created. It seems like the same amount of context switching and the former gives you an opportunity to edit anything before, for example, people who watch the repo get email notifications. I'm likely just missing something, so I'd love to hear how this would be useful for you differently from the existing flow of finishing a PR in the browser. Thanks!

  7. oscard0m commented on Apr 8, 2020

    @oscard0m
    ContributorAuthor

    Hi @dominguezcelada, thanks for the clear explanation here! I'm having a hard time understanding the difference between viewing the PR in the web browser before the PR is created vs. after the PR is created. It seems like the same amount of context switching and the former gives you an opportunity to edit anything before, for example, people who watch the repo get email notifications. I'm likely just missing something, so I'd love to hear how this would be useful for you differently from the existing flow of finishing a PR in the browser. Thanks!

    Sure! The use case I would like to cover is the one where the PR is already created (I dump a template to edit from in my case). The cool thing to me in my workflow is to start editing the description and so while the check runs start passing.

    Maybe in most of the Organizations / Open Source Projects in Github it's a bit "noisy" as you pointed but I think there are other companies or personal small team projects where this notification is not a problem since we only care on review request notifications. It's only a click + a few seconds of check runs start running but when you apply it to all the PR's in a year for all the developers of an organization, it can be a thing. :)

  8. billygriffin commented on Apr 8, 2020

    @billygriffin
    Contributor

    Oh fascinating, thank you for sharing that! Correct me if I'm wrong - it sounds like the primary problem you're trying to solve is that you want to not have to wait as long for checks to run, so having them run in parallel while you're filling out the PR description is a nice way to save time. Is that right?

  9. oscard0m commented on Apr 8, 2020

    @oscard0m
    ContributorAuthor

    Oh fascinating, thank you for sharing that! Correct me if I'm wrong - it sounds like the primary problem you're trying to solve is that you want to not have to wait as long for checks to run, so having them run in parallel while you're filling out the PR description is a nice way to save time. Is that right?

    Exactlty! Also opening it with the title and body I want as a template (but I guess this can be added when opening the browser with the form to submit the pull request)

    Thanks for the quick answers! :)

  10. oscard0m commented on Apr 10, 2020

    @oscard0m
    ContributorAuthor

    Oh fascinating, thank you for sharing that! Correct me if I'm wrong - it sounds like the primary problem you're trying to solve is that you want to not have to wait as long for checks to run, so having them run in parallel while you're filling out the PR description is a nice way to save time. Is that right?

    Exactlty! Also opening it with the title and body I want as a template (but I guess this can be added when opening the browser with the form to submit the pull request)

    Thanks for the quick answers! :)

    What do you think @billygriffin , would this be an interesting feature to work on?

    Thanks

  11. billygriffin commented on Apr 10, 2020

    @billygriffin
    Contributor

    @dominguezcelada Thanks for the gentle nudge. I'm going to bring it up in our meeting early next week to chat about. We're working toward a release so apologies if I don't get back to you right away.

  12. oscard0m commented on Apr 10, 2020

    @oscard0m
    ContributorAuthor

    @billygriffin No problem at all! :)

    If I can help, please let us know.

    And thanks for the attention received! 👏

  13. billygriffin commented on May 4, 2020

    @billygriffin
    Contributor

    Hi @dominguezcelada, thanks for your patience and I'm really sorry for the slow reply. We were able to discuss this quite a bit, and we're reticent to add flags for this behavior just because there are a ton of different ways we could imagine people wanting to combine these actions. We actually think this could be solved nicely using gh aliases, which don't exist yet but we're planning to work on providing support for those soon in #294. I know that doesn't solve your immediate problem (which makes complete sense, I'm certainly not discounting it and hope it doesn't feel like I am), but hopefully that at least provides a lens into how we're thinking about it. Thanks again for the idea and for your patience while we work toward that!

  14. oscard0m commented on May 6, 2020

    @oscard0m
    ContributorAuthor

    Hi @dominguezcelada, thanks for your patience and I'm really sorry for the slow reply. We were able to discuss this quite a bit, and we're reticent to add flags for this behavior just because there are a ton of different ways we could imagine people wanting to combine these actions. We actually think this could be solved nicely using gh aliases, which don't exist yet but we're planning to work on providing support for those soon in #294. I know that doesn't solve your immediate problem (which makes complete sense, I'm certainly not discounting it and hope it doesn't feel like I am), but hopefully that at least provides a lens into how we're thinking about it. Thanks again for the idea and for your patience while we work toward that!

    @billygriffin

    So happy to read this nice reply. Definetely don't worry about it, it's a nice-to-have feature and not a bug, so no worries about it.

    gh aliases looks super cool and probably will cover my usecase I'm willing to see it up and running!

    Once again, thanks for your time and help!

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions