Open a141144 opened 6 years ago
Thanks for the suggestion @a141144! We've had a few requests for this before, but generally our philosophy is to not have access to source code (which we'd need for something like this). We basically act as a router for webhooks from Github (or other SCM systems) to agents on your infrastructure.
My suggestion would be solving this at a GitHub level with something like https://bors.tech/devdocs/bors-ng/readme.html. Beyond that, it would be a great feature suggestion for GitHub!
I'm going to close this for now as I don't think it's possible on our side of the ecosystem, but happy to discuss more!
We've also used post-checkout
buildkite agent hooks which make this easy to do. You can just git merge the upstream repo in a bash script.
I wonder if we could make that a plugin @KevinGrandon?
The thing I generally don't like about that approach is you need to give write access to your git repository to your CI environment.
@lox I think there is a mis-understanding here. I'm not asking the merge to be pushed back to the the repo. The CI env wouldn't need any more access than it already has to clone the repo.
@KevinGrandon yeah you could probably do it in a post-checkout
hook.
@lox bors
looks like a more comprehensive answer to the problem.
Apologies @a141144, you're right I did misunderstand. I'm going to re-open this!
@a141144 We recently created a plugin for this, still pretty basic but does kick off a merged PR build: https://github.com/seek-oss/github-merged-pr-buildkite-plugin
It uses the undocumented refs/pull/123/merge
ref that GitHub creates thus an explicit git merge
isn't currently required.
Seems like the current solutions are:
git merge
in a post checkout
hookAre there any plans to add this as a native feature or plugin in buildkite? Also, if anyone else has other solutions for this problem I'd love to see them.
I know some developers who use build kite have already scripted a solution to this but I feel it is something BuildKite should support "out-of-the-box".
There should be a pipeline configuration option so that when building a PR branch the buildkite agent will attempt to merge the PR branch with the base branch (without committing) and then run the build. This would give you greater confidence that a PR/branch will cleanly integrate with
master
.