Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !8086

Closed
Created Oct 18, 2014 by Administrator@rootOwner1 of 5 tasks completed1/5 tasks
  • Report abuse
Report abuse

Create merge request when editing on web UI v3 [can be updated]

  • Overview 46
  • Commits 1
  • Changes 44

Created by: cirosantilli

Fixes: ACCEPTING MR at: http://feedback.gitlab.com/forums/176466-general/suggestions/5350102-option-to-make-a-merge-request-when-editing-via-we

Supersedes the original request: https://github.com/gitlabhq/gitlabhq/pull/7266

I proposed custom branch names to GitHub at: https://github.com/isaacs/github/issues/228 and they've half implemented it at: https://github.com/blog/1945-quick-pull-requests

Dependencies:

  • https://github.com/gitlabhq/gitlabhq/pull/8053/files (fixes the only CI failure)
  • https://github.com/gitlabhq/gitlabhq/pull/8257

Dependencies already included here which were extracted from this PR and should be evaluated separately and merged first:

  • https://github.com/gitlabhq/gitlabhq/pull/8128
  • https://github.com/gitlabhq/gitlabhq/pull/8131
  • https://github.com/gitlabhq/gitlabhq/pull/8183

TODO on future PRs:

  • Allow to create new branch without creating a merge request (add new checkbox, implied by create mr)
  • When already on fork, add a "Create merge request back to origin checkbox"

TODO just before merging this after having evaluated:

  • set the gitlab-shell URL back to the original one

Blob edit page UI changes

If user has push permission on the current branch, when the page loads it looks like:

screenshot from 2014-11-02 17 12 20 initial

If user clicks on "Create merge request", he now sees:

  • the "On my fork" checkbox which shows where the merge request source will be
  • the source branch indicator master becomes an input so he can choose a custom branch name
  • the source repository changes from gitlab-org to root

screenshot from 2014-11-02 17 13 10 click create mr

By default, branch name is a free branch name on both repositories. When user toggles "On my fork", and he has not yet modified it, it toggles the branch name to a free branch name on given repo:

screenshot from 2014-11-02 17 32 43 on my fork

If user edits the branch name to a custom name like custom-name, the branch name toggle stops so as not to lose the user's input. So after editing the branch name and toggle "On my fork", the branch name stays at custom-name:

screenshot from 2014-11-02 17 34 40 custom name

User does not have push permission, he must fork. "Create merge request" and "On my fork" are checked and disabled:

screenshot from 2014-10-15 21 23 22 user does not have push permission on current branch

If user is already on his fork, he does not see "On my fork": the merge request will necessarily be generated between the current repo and itself:

screenshot from 2014-11-02 17 15 37 on fork

There is also a minor UI behavior change at blob#show: the edit button is enabled even if you don't have push permission since you can edit to start a merge request:

screenshot from 2014-10-15 21 45 23 blob show edit

Are there points in the code the reviewer needs to double check?

  • The hard thing of this MR was the testing. See the dependencies above and check them very well.
  • Permissions. Double check the controller specs, and the crux of the implementation: base_tree_controller.rb
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/cirosantilli/edit-mr-v14