Auto-Merge FAQ

What differentiates the app’s Auto-Merge from the native Auto-Merge feature of Bitbucket Data Center?

As of version 8.15, Bitbucket Data Center includes a native Pull Request Auto-merge feature.

The following table aims at providing users with a clear understanding of the feature set available for the native Bitbucket Code Owners feature and our Code Owners app: 

Feature

Author can decide during PR creation if should be Auto-Merged

❌ Only possible once the pull request is created

Ship/Show/Ask Support

🔗

Auto-Merge supports Code Owners

🔗 Only Auto-Merge when Code Owners approve

 

Auto-Merge Cancellation

image-20240417-154610.png

Auto-Merge Policy visible in PR lists

You can see in the PR title the type of the Auto-merge: [AUTO], [SHIP], [SHOW], [ASK]

image-20240416-163452.png

 

Available in older Bitbucket versions

>= Bitbucket 7.6

❌ >= Bitbucket 8.15

What if I want to use the traditional manual merge for my pull request?

You can select “Manual merge” and requiring “No” approval from the app. This will act as if auto-merge does not exist for your pull request.

Will auto-merge delete the source branch upon merging?

Bitbucket 7.15 introduced the “Branch deletion on merge” setting, available in Workflow > Branches on your project or repository. Auto-merge will respect this setting when merging a pull request. This means that Auto-Merge will follow the behavior specified in that setting when merging a pull request.

If the version of your Bitbucket instance is 7.14 or lower, then Auto-Merge will delete the source branch on merge.

How do Auto-Merge and Code Owners interact?

For the most part, Auto-Merge and Code Owners are two independent features next to each other. However, Auto-Merge will skip Code Owners merge checks in the event of a [Ship] or [Show] pull request.

In particular:

  • a [Show] pull request doesn’t require any approvals to be merged. Moreover, if Code Owners requires approvals for that same pull request, they will be skipped. Therefore the pull request will be automatically merged even if Code Owners merge checks are not fulfilled.

  • a [Show>=2] pull request will require two approvals, regardless of who they are coming from. If for its part, the merge checks on your repository are configured to require 3 approvals, then in total only 3 approvals will be necessary. Code Owners merge checks will be skipped.

  • The same applies for [Ask>=2], but they the key difference is that the Ask pull request will not skip Code Owners merge checks. The other difference is that it will not auto-merge.

  • a [Ship] pull request will skip assignment of Code Owners. This is inline with the philosophy of Ship/Show/Ask: Ship pull request are meant for tiny and trivial changes to your repository. Such changes will be more effective if you don’t bother other team members to carry them through.

I accidentally created a pull request in the wrong category, can I do something about it?

Auto-Merge uses the title of a pull request to determine its category. For example a [Show>=2] pull request will have its title start with [SHOW>=2]. If you modify the title of the pull request after it has been created, it will also change its category for Auto-Merge.

When does Auto-Merge check if a pull request must be auto-merged?

Auto-Merge will check that a pull request can be auto-merged every time an impactful change happens to the pull request. For example, a new task completed, a new approval, a finished build or a change in the title. However, it will never do so less than 20 seconds after the creation of the pull request, leaving you a time window to change the pull request title (or delete the pull request) if you accidentally used the wrong one (see “I accidentally create a pull request in the wrong category, can I do something about it?”).

Is there a way to make some kind of “work in progress” pull request?

Perhaps you want to use auto-merging pull requests, but your pull request is not actually ready and you don’t want it to be auto-merged right away. If that is the case, you have two options:

  • after creating the pull request, create an open task to prevent the merge (note that if that is the only merge check on your repository, you only have 20 seconds to do so – see “When does Auto-Merge check if a pull request must be auto-merged?”)

  • you can create the pull request selecting “Manual merge”, and change the title so that it starts with [SHOW>=n] (with n replaced with the desired number) or with [SHOW] when it is not longer work in progress.

I want to use Ship/Show/Ask but I don’t want Ship or Show to skip Code Owners?

This is something that is currently not supported. If you would be interested in such a feature, we will be happy to hear from you!

Why is my pull request not auto-merged?

Common cases where a pull request would not be merged automatically by Auto-Merge:

  • The pull request author misses permission to merge to destination repository.

  • Auto-merge feature is disabled in destination repository of pull request.

  • Last build of pull request is still in progress or has failed.

  • Someone selected “needs work” for their review status

  • Pull request title is not prefixed with [AUTO] - or [SHIP] / [SHOW] if Ship/Show/Ask feature enabled.

  • Before version 6.7.0:
    If a merge check does requests to a 3rd party system (like Jira), then the Auto-Merge Bitbucket service user might not have permissions to do it, causing the auto-merge to fail. This is a known situation when using the merge check “Require that a pull request is associated with a valid Jira issue” from ScriptRunner for Bitbucket. We are working on a way to configure a separate Bitbucket user for auto-merging, please vote on CODEOWNERS-56.

    • Since version 6.7.0, the pull request author is used to the perform the merge.