Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-21850

Deleting the source branch of a Pull Request will return a "Couldn't load merge checks" error message

    XMLWordPrintable

Details

    Description

      Issue Summary

      If branch permissions are enabled on a repository, when the source branch of pull request is deleted, the Pull Request will throw the following error message on the "Checks" section on the PR sidebar:

      Couldn't load merge checks
      

      This also prevents the PR from being merged, as the merge button does not show up on the UI anymore when this error message happens.

      Steps to Reproduce

      1. Enable branch permissions on a repository, or use a repo that has them enabled already to test this;
      2. Create a new branch, and create a pull request with that branch;
      3. Delete the branch created on step 2;
      4. The pull request will remain open with the deleted branch as its source, and if you open the Pull Request, the checks section will throw the error message below:
        Couldn't load merge checks
        

        The merge button will also not show up.

      Expected Results

      When the source branch of a Pull Request is deleted, the Pull Request should still show up normally, without any error messages. The merge button should also still be present.

      Actual Results

      When opening a PR that has its source branch deleted, the pull request will throw the following error message on the checks section:

      Couldn't load merge checks
      

      The merge button is also missing when this happens.

      Workaround

      There are two workarounds here:
      1. If you still want to merge the PR, if the commits are dangling and not removed by Git Garbage Collection, then you can just use the API to merge the Pull Request:
      https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post

      curl -X POST -u <username>:<password> https://api.bitbucket.org/2.0/repositories/<workspaceID>/<repoSlug>/pullrequests/<pullRequestId>/merge
      

      2. If you just want to see the PR gone from the PR list, you can just click on the "..." icon on the PR view and decline it.

      Attachments

        Activity

          People

            095a30826ce1 Matt Geng
            lmontiel@atlassian.com Leonardo M
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: