Skip to content
Snippets Groups Projects

Disable changing of target branch in new merge request page when a branch has already been specified

Merged Stan Hu requested to merge stanhu/gitlab-ce:new-mr-disable-change-target-branch into master

What does this MR do?

This MR prevents a user from changing the target branch inside a new merge request page if the target branch has already been specified (e.g. from the shortcut in the activity feed). A link to "Change branches" is provided to allow the user to do this properly.

Why was this MR needed?

If a user attempted to create a merge request from a shortcut with a pre-specified target branch (e.g. master), the dropdown would suggest that the user could change the branch. However, this did not actually work due to duplicate data elements (see #1830 (closed) for more details), and the target branch would always be set to the original, default branch. This would lead to confusion, potentially causing an improper merge request to be created.

What are the relevant issue numbers?

Closes #1830 (closed)

Screenshot

image

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Stan Hu Added 1 commit:

    Added 1 commit:

    • 61b38137 - Disable changing of target branch in new merge request page when a branch has already been specified
  • Author Maintainer

    @DouweM, updated!

  • @stanhu Cool. Could you maybe update the use of unless @merge_request.persisted? above to if @merge_request.new_record? as well?

  • Stan Hu Added 1 commit:

    Added 1 commit:

    • c8d4a408 - Disable changing of target branch in new merge request page when a branch has already been specified
  • Author Maintainer

    Douwe, done!

  • Douwe Maan Status changed to merged

    Status changed to merged

  • Thank you @stanhu. Could you submit another MR to get this in 7-12-stable, and assign it to @jacobvosmaer?

  • Douwe Maan mentioned in commit 07956981

    mentioned in commit 07956981

  • Please register or sign in to reply
    Loading