feedback icon indicating copy to clipboard operation
feedback copied to clipboard

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

Open a141144 opened this issue 7 years ago • 9 comments

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.

a141144 avatar May 03 '18 23:05 a141144

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!

lox avatar May 04 '18 00:05 lox

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.

KevinGrandon avatar May 04 '18 01:05 KevinGrandon

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

lox avatar May 04 '18 01:05 lox

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 avatar May 04 '18 01:05 lox

@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 avatar May 11 '18 08:05 a141144

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

a141144 avatar May 11 '18 08:05 a141144

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

lox avatar May 11 '18 09:05 lox

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

zsims avatar Jun 19 '18 20:06 zsims

Seems like the current solutions are:

  • https://github.com/seek-oss/github-merged-pr-buildkite-plugin
  • running git merge in a post checkout hook
  • https://bors.tech/devdocs/bors-ng/readme.html

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.

josh-ross-ai avatar Aug 19 '21 20:08 josh-ross-ai