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

[feature request] Command to push to master and close pull request #111

Open
alamothe opened this issue Apr 30, 2020 · 7 comments
Open

[feature request] Command to push to master and close pull request #111

alamothe opened this issue Apr 30, 2020 · 7 comments

Comments

@alamothe
Copy link

Once the pull request is reviewed and approved, our workflow is that the author should merge it. This can be done easily through GitHub UI (there is a "Squash and merge" button).

There are a couple of problems with this:

  • We can't do it through command line.
  • After it's done, the local branch becomes useless. Sometimes people will accidentally continue working in there, thinking it's nw at origin/master which is not the case.

Ideally, we want a command git pull-request --merge which will:

  • Merge into origin/master.
  • Close pull request.
  • Delete local branch.

What are your thoughts?

@jd
Copy link
Member

jd commented May 1, 2020

Why don't you use https://mergify.io to do that directly from GitHub?

@alamothe
Copy link
Author

alamothe commented May 5, 2020

I still want a command line tool. Does https://mergify.io offer a command line tool to do that?

@jd
Copy link
Member

jd commented May 6, 2020

No. Why do you want a command-line tool when you can make things automatic? 🤔

@alamothe
Copy link
Author

alamothe commented May 6, 2020

When a pull request is approved, there are still some final comments left.

It is expected of the author to fix the final comments and merge it themselves (update, push the button in GitHub UI, remember to delete the local branch).

So I am interested in automating the last part.

At least this is our workflow. It would slow us down if we do another round of "request changes" for the final comments which are usually nits.

Thanks for your reply!

@alamothe
Copy link
Author

alamothe commented May 6, 2020

...By the way, this tool saves us a ton of time and we would be OK to pay for it per user per month as long as it's not too much. Perhaps you can offer it as part of your Mergify package.

@jd
Copy link
Member

jd commented May 7, 2020

Thank you, that's nice! Feel free to subscribe to Mergify anyhow, that'll support us and this tool.

I think there are 2 solutions to your issues here:

  1. automatic merge: that really should be Mergify job IMHO. You can do that with a rule like:
- name: automatic merge
  conditions:
    - label=ready-to-merge
    - status-success=your ci system
    - "#approved-reviews-by>=1"
  actions:
    merge:
      method: squash

By using a label, you make sure the author has set this label when it's ready to be merged and that the CI works, etc. You can define finer-grained rules of course, but there's no need for doing anything "local" that way.

  1. Cleaning merged pull requests.

It's actually something I'd love to have too. That could be the job git-pull-request indeed. What'd be useful is to be able to delete local branches when their corresponding PR are merged, or even display their status. That shouldn't be too hard to implement I imagine. 🤔

@alamothe
Copy link
Author

alamothe commented May 7, 2020

It's actually something I'd love to have too. That could be the job git-pull-request indeed. What'd be useful is to be able to delete local branches when their corresponding PR are merged, or even display their status. That shouldn't be too hard to implement I imagine. 🤔

Yes, need exactly this. Sometimes developers will continue working on the local branch by accident, and make a mess locally. Maybe then a feature for git-pull-request to mark a PR with a label you suggested and delete the local branch. Then Mergify can take over.

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

No branches or pull requests

2 participants