Giter Club home page Giter Club logo

Comments (48)

kytrinyx avatar kytrinyx commented on May 22, 2024 18

I almost never want to merge pull requests unseen as soon as they pass—it's almost always a thing where I've reviewed it, and want to merge it, but the build is still running, so I go look at instagram and check my email and completely forget what I was actually doing. That's when I would want to have a way to signal to a bot: go ahead and merge this as soon as it passes.

I could see this working with protected branches that have required builds and require an approval from a human reviewer. Then as soon as all the requirements are met, it could merge it.

from ideas.

zeke avatar zeke commented on May 22, 2024 14

GitHub API doesn't support GitHub apps merging pull requests with protected branches yet.

I found the internal GitHub issue for this and gave it a little bump. It's a known issue, GitHubbers are aware that integrators are frustrated by it, and a solution is actively being discussed. I'll report back here with any updates.

from ideas.

gr2m avatar gr2m commented on May 22, 2024 7

@JasonEtco it’s not about working around protected branches, it's about automated merging once all the checks are green

from ideas.

bobvanderlinden avatar bobvanderlinden commented on May 22, 2024 6

I've been working on a probot that does exactly this the last few days. It is working for the tests I've done with it, but I still consider it experimental. Let me know what you think: https://github.com/bobvanderlinden/probot-auto-merge

GitHub
probot-auto-merge - A GitHub App built with Probot that automatically merges pull requests

from ideas.

zeke avatar zeke commented on May 22, 2024 4

@rsarky you beat me to it! Thanks to @kytrinyx for helping move this forward.

https://twitter.com/kytrinyx/status/986409138568810496

from ideas.

rsarky avatar rsarky commented on May 22, 2024 3

@zeke A new API endpoint is now available and it is perfect for this use case 🎉
Merge PR

from ideas.

JasonEtco avatar JasonEtco commented on May 22, 2024 2

I don't think that an app should be able to bypass protected branches. Those are typically very sensitive branches where things would break if merged incorrectly, and I think that folks would be upset to see an app ignore their intentional decision to treat that branch more carefully.

from ideas.

adamu avatar adamu commented on May 22, 2024 2

My team has settled on using https://github.com/pascalgn/automerge-action for this workflow. Attach an automerge label to the pull request and walk away (or go look at Instagram). Once it turns green it will get merged.

That's exactly what Mergery does too. One of the reasons I wrote it is that the configuration for automerge-action was quite bewildering, and it didn't work as expected when I tried it. Mergery doesn't require any config, it works with the default repository config, and it's fast :-)

from ideas.

rsarky avatar rsarky commented on May 22, 2024 1

Protected branches refer to branches with some restriction on who can push to the branch.
Isn't that the case for most branches?

from ideas.

pranay414 avatar pranay414 commented on May 22, 2024 1

Ok got it, Thanks :)

from ideas.

jd avatar jd commented on May 22, 2024 1

I feel you @kytrinyx. This is where Mergify is actually very helpful, since it does provide this auto-merge feature when CI is passed as a base feature. :)

from ideas.

bobvanderlinden avatar bobvanderlinden commented on May 22, 2024 1

Quite a few people are now using https://github.com/bobvanderlinden/probot-auto-merge. I do not consider it experimental anymore. I personally use dependabot as well as probot-auto-merge. They both have their purposes.

For example, for some projects it's fine to just approve prs with a review and have it automatically merged. For other projects merging to master happens in batches: I label all approved prs with a merge label and merge them all. Probot-auto-merge works fine for those usecases.

Dependabot is great for automatically merging using a comment or a development dependency update. It just doesn't do more complex merging rules.

GitHub
A GitHub App built with Probot that automatically merges pull requests - bobvanderlinden/probot-auto-merge

from ideas.

cyberhck avatar cyberhck commented on May 22, 2024 1

https://github.com/fossapps/MergeWhenReady I also gave this a try, it doesn't use any config, you protect your branch with everything you have from github (require review, status checks etc), once the button becomes green, and IF you have added a label created by this bot, it automatically merges the branch

GitHub
Contribute to fossapps/MergeWhenReady development by creating an account on GitHub.

from ideas.

jainankit avatar jainankit commented on May 22, 2024 1

You can also checkout MergeQueue for not just auto-merging, but also avoid all the build conflicts. It also works on Github labels. Read the docs for details.

from ideas.

bobvanderlinden avatar bobvanderlinden commented on May 22, 2024 1

Ooh, MergeQueue sounds very promising! 👍 Like dependabot and pullreminder, this sounds like an application that fills the gap in GitHubs core functionality.
Thanks for bringing it up.

from ideas.

zeke avatar zeke commented on May 22, 2024

@gr2m suggested that there might currently be some roadblocks for such a bot: https://platform.github.community/t/repositories-which-have-protected-branches-with-push-restrictions-have-no-ability-to-grant-push-rights-to-integrations/1376

from ideas.

ocombe avatar ocombe commented on May 22, 2024

we're thinking about doing something similar for Angular, we already have a probot app that checks if the PR is good to merge, but it doesn't do the merge itself yet

from ideas.

zeke avatar zeke commented on May 22, 2024

Hey @ocombe is that bot source public?

from ideas.

ocombe avatar ocombe commented on May 22, 2024

yes! it's here: https://github.com/angular/github-robot
we're going to add some new PR triage functionalities soon as well, see angular/angular#21884 for a first draft of what we intend to do

GitHub
Contribute to github-robot development by creating an account on GitHub.

from ideas.

zeke avatar zeke commented on May 22, 2024

Good stuff. Thanks for sharing, @ocombe.

from ideas.

mritunjayz avatar mritunjayz commented on May 22, 2024

I seen angular/angular#21884.
I know to work with github api's but no working experience for bot in github.

from ideas.

heshanpadmasiri avatar heshanpadmasiri commented on May 22, 2024

I would like to work on this any suggestions on how the bot should behave if the mentioned issue where bots not being able to merge pull requests with protected branches

from ideas.

rsarky avatar rsarky commented on May 22, 2024

So I went through this https://platform.github.community/t/repositories-which-have-protected-branches-with-push-restrictions-have-no-ability-to-grant-push-rights-to-integrations/1376.
And it doesn't look like GitHub has released a fix yet.
Further AFAIK there is no realistic workaround for this?
Can anyone give some idea so as to how we might go about this?

from ideas.

JasonEtco avatar JasonEtco commented on May 22, 2024

it’s not about working around protected branches, it's about automated merging once all the checks are green

I see - I guess it depends on the level of protection (which is ultimately up to the user). One available option is the only allow merges with at least 1 green review from someone with write access; I think that as long as that protection isn't ignored then its all good. I only bring it up because I'm not sure if that's considered a "status."

from ideas.

rsarky avatar rsarky commented on May 22, 2024

Sadly the GitHub API doesn't support GitHub apps merging pull requests with protected branches yet. @JasonEtco

from ideas.

rsarky avatar rsarky commented on May 22, 2024

@zeke That's awesome.Thanks

from ideas.

pranay414 avatar pranay414 commented on May 22, 2024

@zeke I would like to work on this. I have completed hello-world bot. What's the next step?

from ideas.

zeke avatar zeke commented on May 22, 2024

@pranay414 GitHub folks are actively working on a fix for the bot permissions problem, but it hasn't shipped yet. I will post here when that happens.

from ideas.

pranay414 avatar pranay414 commented on May 22, 2024

@zeke so should I start drafting a proposal for this?

from ideas.

zeke avatar zeke commented on May 22, 2024

@pranay414 sure. If you want to outline the expected behavior that could be helpful.

from ideas.

pranay414 avatar pranay414 commented on May 22, 2024

@zeke when someone submits a PR then it is put into testing and once all checks are passed then it should be merged or it should be reviewed by someone and then merged?

from ideas.

rsarky avatar rsarky commented on May 22, 2024

@pranay414 One of the status checks will probably be getting the PR reviewed.

from ideas.

pranay414 avatar pranay414 commented on May 22, 2024

@rsarky so once it is reviewed then it should be merged right?

from ideas.

rsarky avatar rsarky commented on May 22, 2024

@pranay414 Once all the status checks pass. The status checks may include CI, reviews etc.

from ideas.

jainkeval avatar jainkeval commented on May 22, 2024

@gr2m @JasonEtco I would like to consider this for my GSoC proposal. Can you please guide me how do I proceed?

from ideas.

vishalseshagiri avatar vishalseshagiri commented on May 22, 2024

@gr2m @JasonEtco . I have given this task a try and it works for ci-validated and mergeable PRs. Please find my repository here gsoc_probot_task_1

from ideas.

travi avatar travi commented on May 22, 2024

i'm not sure how helpful any of this is to this thread, but i figure its related enough to at least mention. i maintain greenkeeper-keeper that serves a very similar purpose, but is purposely limited to PRs that are from greenkeeper. the current implementation is a hapi plugin, but a probot version is on my list even though i haven't found time to make that happen yet. i'm very interested in where this goes as i could see potentially replacing greenkeeper-keeper with this.

one thing that might be worth considering is the ability to limit the automatic merge to a certain type of PR. the important detail for greenkeeper-keeper is that it is limited to only greenkeeper PRs. they are only dependency upgrades, so there isnt anything to review beyond passing commit checks. contributions from humans usually are more more worth a human review, so my team likes to handle those differently.

from ideas.

zeke avatar zeke commented on May 22, 2024

Thanks for sharing, @bobvanderlinden!

The Electron team has been experimenting with @dependabot, which has a feature for auto-merging dependency updates when checks pass: https://twitter.com/dependabot/status/1015290676081283072

Twitter
“Cheeky little feature: you can now set your Dependabot auto-merge strategy to "in-range updates" and it will automerge any dependency updates that satisfy the range in your Gemfile / package.json / cargo.toml / Pipfile / composer.json / mix.exs 🍸”

from ideas.

bobvanderlinden avatar bobvanderlinden commented on May 22, 2024

I was meaning to check out Dependabot, but mostly for its automatic dependency updates. Does it do automatic merges for pull requests in general? Then I might want to look into that too.

from ideas.

zeke avatar zeke commented on May 22, 2024

Does it do automatic merges for pull requests in general?

No. Just for its own PRs.

from ideas.

grount avatar grount commented on May 22, 2024

Anything on this in 2019? 👍

from ideas.

zeke avatar zeke commented on May 22, 2024

Thanks to some work from @kytrinyx late last year, there's now an API endpoint for merging PRs: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button

@dependabot already has support for this, and the product was acquired by GitHub earlier this year. If you want this functionality today, you can install @dependabot on your projects. As for the future of this becoming a feature built into GitHub itself, I am not sure.

GitHub Developer
Get started with one of our guides, or jump straight into the API documentation.

from ideas.

paulirish avatar paulirish commented on May 22, 2024

In this twitter thread are a few more of these: https://twitter.com/rauchg/status/1154190143013584898

https://github.com/chdsbd/kodiak#prior-art has a matrix of some auto-merge bots and their characteristics.

Twitter
“We installed a GitHub bot that automatically merges PRs to master when certain conditions are met

… which in turns deploys to prod domain with @zeithq
… which is a dream come true

https://t.co/K9Jr3oc7ba

🚢”

GitHub
🔮 A bot to automatically update and merge GitHub PRs - chdsbd/kodiak

from ideas.

cyberhck avatar cyberhck commented on May 22, 2024

the one I did is very basic, if there's a label and PR can be merged it merges it. It's typescript automatically deployed to now.sh and it automatically deploys to docker hub as well, so if you want to run your own instance, you can. :)

from ideas.

mfix22 avatar mfix22 commented on May 22, 2024

http://reporanger.com also handles this 🙂 Very biased, since I built it, but let me know if anyone needs help setting it up or configuring a specific automation 👍

Ranger is a sidekick for GitHub maintainers.

from ideas.

adamu avatar adamu commented on May 22, 2024

I wrote a free GitHub App, Mergery, that does this.

from ideas.

zeke avatar zeke commented on May 22, 2024

it's almost always a thing where I've reviewed it, and want to merge it, but the build is still running, so I go look at instagram and check my email and completely forget what I was actually doing. That's when I would want to have a way to signal to a bot: go ahead and merge this as soon as it passes.

My team has settled on using https://github.com/pascalgn/automerge-action for this workflow. Attach an automerge label to the pull request and walk away (or go look at Instagram). Once it turns green it will get merged.

GitHub
GitHub action to automatically merge pull requests that are ready - pascalgn/automerge-action

from ideas.

cyberhck avatar cyberhck commented on May 22, 2024

https://github.com/fossapps/MergeWhenReady I also have this, however installation had some issue, however people say it's working for them, so not sure what's going on. When you label a PR with a specific value, it waits for status checks to pass and it merges the PR.

GitHub
Contribute to fossapps/MergeWhenReady development by creating an account on GitHub.

from ideas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.