Description
This check verifies that open pull request tasks must be resolved before changes can be merged into the default branch of a Bitbucket repository. Requiring task resolution ensures that review comments, identified issues, and required follow-up actions are addressed before code changes are accepted. This control helps enforce a complete pull request review process by preventing merges while unresolved tasks remain open.
Note: Only repository-level branch restrictions are detected. Restrictions set only at the project level are not returned by Bitbucket’s API and will result in a FAIL. Configure the restriction at the repository level for accurate results.
Rationale
The default branch typically contains stable or production-ready code. Allowing pull requests to merge with unresolved tasks may result in incomplete reviews, ignored reviewer feedback, or known issues being introduced into the codebase. Requiring all pull request tasks to be completed before merging ensures that reviewer concerns are addressed, improves code quality, and helps maintain the integrity of the default branch.
Impact
Prevent pull requests from being merged until all review tasks are completed.
Ensure reviewer feedback and identified issues are addressed before code changes are accepted.
Improve code quality by enforcing completion of required review activities.
Increase the time required to merge changes when unresolved tasks remain.
Strengthen the overall pull request governance process.
Default Value
Depends on repository configuration. Bitbucket repositories do not automatically require pull request tasks to be completed before merging. Repository administrators must manually configure branch restrictions and merge checks to enforce this requirement.
Pre-Requisites
Repository administrator access
An existing Bitbucket repository
Test Plan
Sign in to Bitbucket at https://bitbucket.org.
Navigate to the target repository.
Select Repository settings.
Under the Workflow section, select Branch restrictions.
Review the branch restriction rules configured for the default branch.
Verify that the default branch requires all pull request tasks to be completed before merging.
If the requirement is not enabled for the default branch, follow the implementation steps.
Implementation Steps
Sign in to Bitbucket at https://bitbucket.org.
Navigate to the target repository.
Select Repository settings.
Under the Workflow section, select Branch restrictions.
Select the branch restriction rule configured for the default branch.
Open the Merge settings configuration.
Enable the option requiring all pull request tasks to be completed before merging.
Review and configure additional merge requirements based on organizational requirements.
Save the changes.
Backout Plan
Sign in to Bitbucket at https://bitbucket.org.
Navigate to the target repository.
Select Repository settings.
Under the Workflow section, select Branch restrictions.
Locate the branch restriction rule configured for requiring task resolution before merging.
Disable the requirement for completing pull request tasks before merging.
Save the changes.
Confirm that repository pull request workflows function as expected after the rollback.
Reference
https://support.atlassian.com/bitbucket-cloud/docs/use-branch-permissions/
https://support.atlassian.com/bitbucket-cloud/docs/work-with-pull-requests/