Disable changing of target branch in new merge request page when a branch has already been specified
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
Merge request reports
Activity
I'm not sure what's going on with all the recent CI changes, but @DouweM, can you review this approach?
mentioned in issue #1810 (closed)
@stanhu could you
chmod +x scripts/prepare_build.sh
and push a new commit?Added 4 commits:
- 817964a0...74a6732c - 3 commits from branch
gitlab-org:master
- c78ddf8d - Disable changing of target branch in new merge request page when a branch has already been specified
- 817964a0...74a6732c - 3 commits from branch
@jacobvosmaer Thanks--it looks like I just had to rebase master to get the right permissions.
@jacobvosmaer it's not a regression, that's never worked properly. I'll check this MR and that issue out tonight.
@DouweM, updated!
@stanhu Cool. Could you maybe update the use of
unless @merge_request.persisted?
above toif @merge_request.new_record?
as well?Added 1 commit:
- c8d4a408 - Disable changing of target branch in new merge request page when a branch has already been specified
Thank you @stanhu. Could you submit another MR to get this in 7-12-stable, and assign it to @jacobvosmaer?
mentioned in commit 07956981