Confusing behavior when creating merge request from branch

Summary

This is probably more of a misdesign, but it's bad enough that I consider it a bug. When creating a merge request from a branch, if you change the target branch and don't hit the Compare button, clicking Create Merge Request will use the previously selected branch, not the newly selected target branch. This is not obvious and is causing issues with our developers. It is also time wasting as you have to add an unnecessary (and slow -- since it has to recompute the changes) step in the process.

Steps to reproduce

  1. Create an issue.
  2. Create a branch from that issue.
  3. Add one or more commits to that branch.
  4. In the issue, click on the branch (it's in the Related Branches section).
  5. Change the target branch on the next page to something other than what's there by default (usually master).
  6. Click Create Merge Request.

Example Project

JoelFeiner/BugTest#4

What is the current bug behavior?

Merge request target branch will be master.

What is the expected correct behavior?

Merge request target branch will be what is selected. Alternatively, the Create Merge Request button should be disabled so that the user is forced to do the comparison, if this is the intended workflow. Either way, it should not be possible to create a merge request with a target branch that is not displayed on the screen.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com.

Possible fixes

  1. Disable Create Merge Request button if the target branch has been changed but a new comparison hasn't been generated.
  2. Treat whatever is in the target branch box as the intended target branch and use that when creating a new merge request, even if no new comparison has been run.
  3. Indicate somehow either in the Create Merge Request button or nearby what the actual target branch will be so that the user is aware of what will happen (this is least preferred unless paired with 1 or 2 above).
Assignee Loading
Time tracking Loading