Comments (48)
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.
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.
@JasonEtco it’s not about working around protected branches, it's about automated merging once all the checks are green
from ideas.
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
probot-auto-merge - A GitHub App built with Probot that automatically merges pull requests
from ideas.
@rsarky you beat me to it! Thanks to @kytrinyx for helping move this forward.
https://twitter.com/kytrinyx/status/986409138568810496
from ideas.
@zeke A new API endpoint is now available and it is perfect for this use case 🎉
Merge PR
from ideas.
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.
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.
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.
Ok got it, Thanks :)
from ideas.
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.
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.
A GitHub App built with Probot that automatically merges pull requests - bobvanderlinden/probot-auto-merge
from ideas.
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
Contribute to fossapps/MergeWhenReady development by creating an account on GitHub.
from ideas.
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.
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.
@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.
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.
Hey @ocombe is that bot source public?
from ideas.
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
Contribute to github-robot development by creating an account on GitHub.
from ideas.
Good stuff. Thanks for sharing, @ocombe.
from ideas.
I seen angular/angular#21884.
I know to work with github api's but no working experience for bot in github.
from ideas.
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.
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.
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.
Sadly the GitHub API doesn't support GitHub apps merging pull requests with protected branches yet. @JasonEtco
from ideas.
@zeke That's awesome.Thanks
from ideas.
@zeke I would like to work on this. I have completed hello-world bot. What's the next step?
from ideas.
@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.
@zeke so should I start drafting a proposal for this?
from ideas.
@pranay414 sure. If you want to outline the expected behavior that could be helpful.
from ideas.
@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.
@pranay414 One of the status checks will probably be getting the PR reviewed.
from ideas.
@rsarky so once it is reviewed then it should be merged right?
from ideas.
@pranay414 Once all the status checks pass. The status checks may include CI, reviews etc.
from ideas.
@gr2m @JasonEtco I would like to consider this for my GSoC proposal. Can you please guide me how do I proceed?
from ideas.
@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.
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.
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
“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.
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.
Does it do automatic merges for pull requests in general?
No. Just for its own PRs.
from ideas.
Anything on this in 2019? 👍
from ideas.
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 DeveloperGet started with one of our guides, or jump straight into the API documentation.
from ideas.
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.
“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🚢”
🔮 A bot to automatically update and merge GitHub PRs - chdsbd/kodiak
from ideas.
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.
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.
I wrote a free GitHub App, Mergery, that does this.
from ideas.
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 action to automatically merge pull requests that are ready - pascalgn/automerge-action
from ideas.
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.
Contribute to fossapps/MergeWhenReady development by creating an account on GitHub.
from ideas.
Related Issues (20)
- Auto assign newly created issues to a specific person
- Add title to issue links? HOT 2
- بانک جهانی HOT 5
- Probot deployment using kubernetes/helm HOT 1
- Merge queue HOT 2
- Spotify integration?
- Keeping issues and PR in-sync with GitLab side HOT 1
- Don't dismiss stale reviews if the code diff doesn't change on rebase
- shakibae01
- ITResearch Introduce
- Creation of an automation app
- Not working on release name with wild character *
- asdasdasd HOT 1
- 1223123
- custum probot
- Creation of probot.github app failing with Error: The programmatic API was removed in npm v8.0.0
- agba-merger
- Create a bot to send Github inactivity reminders to email HOT 2
- module.exports HOT 1
- AI repo assistant bot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ideas.