Uploaded image for project: 'Migration Platform'
  1. Migration Platform
  2. MIG-2388

Display approvals for migrated pull requests with "Reset approvals when the source branch is modified"

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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

      1. Create a repository with multiple branches + commits
      2. Create a pull request with multiple approvers (assume A1, A2, A3, A4)
      3. Approvers A1 and A2 approve the pull request
        Do not approve/merge the PR - PR is open during migration
      4. Using Bitbucket Cloud Migration Assistant (BCMA), migrate the repository to Bitbucket Cloud

      Bitbucket Cloud

      1. Navigate to the repository in Bitbucket Cloud
      2. Open the repository settings at:
        https://bitbucket.org/<workspace>/<repository>/admin/branch-restrictions
      3. 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

              Unassigned Unassigned
              887e911e3c81 Jimmy Van
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: