Changing the main branch of a fork then creating a pull request to the upstream breaks the upstream repository

XMLWordPrintable

    • 8
    • Severity 3 - Minor
    • 2,070
    • Warranty

      Issue Summary

      If the main branch of a fork repository is changed, then a new pull request is created to the main branch of the upstream repository the fork repo originates from, the following symptoms can be observed:
      1. The upstream repository https://bitbucket.org/<workspaceID>/<repository>/src/ page will show the onboarding experience (as if there were no files) rather than the files present in the repo

      2. Pull requests can no longer be created from the fork repository to the upstream repository. The create pull request button will be greyed out in the fork, and it will state that you do not have access to create pull requests on the fork repository (regardless of your actual permission)

      3. Pull requests can also no longer be created on the upstream repository. A "Something went wrong" error message is thrown when the create pull request button is created.

      4. Branches page on the upstream repository will throw a "Something went wrong" error message.

      Steps to Reproduce

      1. Create a new repository in Bitbucket Cloud;
      2. Right after creating the repository, click on "..." > Fork this repository
      3. Create the fork repository;
      4. On the fork repository, create a new branch;
      5. Go to the repository settings of the fork repository > Repository Details > Click on Advanced > On the Main Branch dropdown, select the newly created branch.
      6. Create a new commit on the fork repository for the current main branch;
      7. Go to pull requests > Create pull request
      8. For the source branch of the pull request, select the branch set to the main branch
      9. For the target branch of the pull request, select the main branch of the upstream repository;
      10. Click on create pull request.

      Expected Results

      After clicking on "Create Pull Request" on step 10, you should be redirected to the newly created pull request, and the source page of the upstream repository will load correctly. You will also still be able to create PRs from the fork repository to the upstream

      Actual Results

      After clicking on "Create pull request" on step 10, the source page of the upstream repository does not load correctly, showing the onboarding experience rather than the actual files present on the repository. Furthermore, it's no longer possible to create pull requests from the fork repo to the upstream.

      Workaround

      1. Switch the main branch on the forked repo to match the parent repo. This should allow PRs to be created again, and the /src/ page of the upstream will load correctly again.

      2. If the above does not work for you, navigate to the affected repository > Repository settings > repository details > Change any data like the description field > Click on save.

            Assignee:
            Unassigned
            Reporter:
            Leonardo M
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: