-
Suggestion
-
Resolution: Unresolved
-
None
Issue Summary
Some migrated pull requests (PRs) do not display approvals after migration if the "Reset approvals when the source branch is modified" is set. This applies in specific circumstances, specifically when the PR is open.
Steps to Reproduce
Bitbucket Data Center
- Create a repository with multiple branches + commits
- Create a pull request with multiple approvers (assume A1, A2, A3, A4)
- Approvers A1 and A2 approve the pull request
Do not approve/merge the PR - PR is open during migration
- Using Bitbucket Cloud Migration Assistant (BCMA), migrate the repository to Bitbucket Cloud
Bitbucket Cloud
- Navigate to the repository in Bitbucket Cloud
- Open the repository settings at:
https://bitbucket.org/<workspace>/<repository>/admin/branch-restrictions - Click "Merge settings" tab > Merge conditions section >
"Reset approvals when the source branch is modified"
This enables the reset_approvals_on_change flag.
Expected Results
- Approvals from A1 and A2 are displayed as approved in the right side panel as approved
- Approvals from A1 and A2 return true from the REST API - https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pullrequests/<pullrequestid>
Actual Results
Approvals from A1 and A2 are not displayed as approved in the right side panel in approved
Approvals from A1 and A2 return false from the REST API
- Approvals are displayed correctly in the pull request activity log UI
- Approvals are correctly noted in the pull request activity API - https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pullrequests/<pullrequestid>/activity
This is because Bitbucket Data Center does not have the reset_approvals_on_change flag out of the box. After migrating a repository and then enabling reset_approvals_on_change for the repo, approvals are removed on the PR.
Workaround
- Avoid open PRs during migration (approve and merge all PRs, OR decline PR and open new PR in Bitbucket Cloud after migration).
- Re-approve the PRs