CircleCI Ideas

Merged idea

This idea has been merged into another idea. To comment or vote on this idea, please visit CCI-I-926 Show test results for prospective merge of a Github PR.

PRs should be built against the temporary merge with target branch Merged

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


  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • May 24 2018
  • Taking votes
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    23 Oct, 2018 02:48pm

    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.