Create Automatic Pull Request Merge in Bitbucket
Workzone implements fine-grained pull request merge control per branch or branch pattern.
- Workzone can merge the pull request automatically when all or a percentage of reviewers have approved and/or on successful build results.
- Workzone can delete the source branch of a pull request after successful automatic merge.
- Allow or block push operations to a branch once a pull request has been created and un-approve all approvals on a pull request should the originating branch be updated.
- Can block a pull request from being merged manually.
The Workzone auto-merging feature has the following options:
- Target Branch: the target of pull request that should be merged automatically. Can be a branch name or pattern.
- Source Branch: the source of pull requests that should be merged automatically. Can be a branch name or pattern.
- Delete Source Branch: when a pull request is automatically merged, delete the source branch of the pull request immediately after.
- Watch Build Results: triggers an automatic merge of a pull request on successful build result for the source branch commit, provided all other conditions are met.
The following criteria are combined to allow a merge to happen or block it:
- Reviewers approval quota – how many per-cent of reviewers must approve
- Reviewers group quota – how many members of a reviewer group must approve
- Required digital signatures – how many approvals must have a digital signatures [link] for CFR Part 11 compliance
- Required successful builds – how many successful build results must be associated with the pull request’s source branch HEAD
Auto-merge user
The auto-merge user is the Bitbucket user on which behalf a pull request merge is performed automatically in the background when all merge criteria are met.
Tip: It is best practice to use Bitbucket branch permissions to limit write access to the pull request target branches like ‘master’ or ‘develop’ to ensure ‘normal’ users can’t just press the ‘Merge’ button.
No auto-merge required
If you don’t want Workzone to trigger an automatic pull request merge but still want to control the manual merge process , leave the auto-merge user field empty. Workzone won’t merge pull requests to the specified target branch automatically.