Deleting target branch for an open PR is permitted

XMLWordPrintable

    • 5
    • Severity 2 - Major
    • 790

      Issue Summary

      Currently, it is possible to delete the target branch for an open PR, which causes a few issues on the platform.

      Steps to Reproduce

      1. Create a PR to branch1;
      2. Leave that PR as open, 
      3. Go to repository branches view or use BB API > Delete  branch1 ;
      4. go back to the open PR where  branch1  was a destination branch > try to leave a comment > will result in 400 response
      5. try to merge the same PR > merge will be successful and the deleted  branch1 will be re-created.

      Expected Results

      1. Branch deletion that is part of an open PR should give a warning;
      2. leaving a comment on the same open PR shouldn't result in 400 - since the PR does exist and we allow it to still be merged successfully

      Actual Results

      1. Branch that is part of an open PR is allowed to be deleted without any warning;
      2. This causes new comments to that PR error out with user error (400);
      3. Users are even allowed to approve and merge PR successfully, where destination branch was previously deleted and that branch is re-created again after the merge

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Mateus T
              Votes:
              6 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: