buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Feature Request: Support "trial merges" of base branch on PR builds #366

Open a141144 opened 6 years ago

a141144 commented 6 years ago

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.

lox commented 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!

KevinGrandon commented 6 years ago

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.

lox commented 6 years ago

I wonder if we could make that a plugin @KevinGrandon?

lox commented 6 years ago

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.

a141144 commented 6 years ago

@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.

a141144 commented 6 years ago

@lox bors looks like a more comprehensive answer to the problem.

lox commented 6 years ago

Apologies @a141144, you're right I did misunderstand. I'm going to re-open this!

zsims commented 6 years ago

@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.

joshross12 commented 3 years ago

Seems like the current solutions are:

Are 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.