Submit Your Ideas

We want to hear from you - vote for the features and improvements you'd most like to see, or submit your own ideas if you don't find them already listed.

PRs should be built against the temporary merge with target branch

When building a pull-request there are scenarios where the build and tests passed successfully, everything may seem to be perfect for merging and yet merging the pull-request can break the build.

This can happen if the PR's branch does not stem from the HEAD of the target branch, in such case it is possible that the PR's branch will pass tests while merging it will break the build. Or if we have 2 PR's that introduce conflicting changes, in such case they both will pass the build but once one is merged to the target branch merging the other one will break the build.

To minimize / prevent the undesired state of broken builds the PRs build should not run on the PR's branch HEAD commit but on the a "fictive" commit that simulates the merging of the PR's branch into the target branch. Luckily this can be easily achieved as this "fictive" commit is provided by GitHub (and other SCM providers), on checkout simply pulling the branch +refs/pull/${CIRCLE_PR_NUMBER}/**merge** instead of +refs/pull/${CIRCLE_PR_NUMBER}/head.

There are few feature request posts (listed below) talking exactly about that for more than 2 years already, and this is a feature is really necessary to ensure stable builds. It is supported by other CI services (eg. Travis).

References:
https://discuss.circleci.com/t/prs-should-also-build-the-temporary-merge-with-target-branch/10706

https://discuss.circleci.com/t/show-test-results-for-prospective-merge-of-a-github-pr/1662

https://discuss.circleci.com/t/only-build-pull-requests-not-every-branch/200

https://docs.travis-ci.com/user/pull-requests

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • May 24 2018
  • Future consideration
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    23 Oct 14:48

    This absolutely is a must. We've just transferred from Jenkins, which supports it,  to CircleCi and are a little disheartened to find out that this is missing. 

    The ability to test the final, merged, result is vital to healthy PR-CI integration.