Allow for Pre Merge Check to be Ignored on PR Builds

XMLWordPrintable

      Hello,

      We ran into a use case where we want to be able to use PR builds, but skip the conditional merge check.

      Our primary use for using PR build is just to allow our Jenkins build to get context about the Pull Request in order to perform automation based off those changes.

      Our git system already prevents jobs from merging if there are merge conflicts etc, so we are more concerned with the extra information it provides than having the CI system check this

      Additionally, the pre merge step has since been deprecated. Likely since it problematically fails the build early on.

      See git-plugin/src/main/java/hudson/plugins/git/extensions/impl/PreBuildMerge.java at master · jenkinsci/git-plugin

      The code that performs this check is here
      atlassian-bitbucket-server-integration-plugin/src/main/java/com/atlassian/bitbucket/jenkins/internal/scm/trait/BitbucketPullRequestDiscoveryTrait.java at 323ba10d49249b7f430806315c6f5a2882293d6e · jenkinsci/atlassian-bitbucket-server-integration-plugin

      Proposed solution - Add a boolean flag to the trait that allows you to disable the merge check with the default being true for backwards compatibility.

      Current Behavior - When a branch is unmergeable the build fails out immediately in early checkout. This happens when there are merge conflicts etc.

      ERROR: Branch not suitable for integration as it does not merge cleanly: Command "git merge --ff 06a7db47b582970c9d2fdb3035e78e3850a373f4" returned status code 1: 

      Desired Behavior - Allow this check to be configurable so we can skip the check and run PR builds that are not mergeable.

       

            Assignee:
            Unassigned
            Reporter:
            Aidan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: