Skip to content

Slow branch picker when creating a merge request (many branches) - Projects::MergeRequests::CreationsController#new

Currently, group/project/merge_requests/new (Projects::MergeRequests::CreationsController#new) renders all branches server-side rendered for the dropdowns. This becomes a problem when a project has 20,000 branches and the DOM becomes unresponsive.

Relevant code, https://gitlab.com/gitlab-org/gitlab-ce/blob/063e285e6a8c26a95809873fb32fefc54fe9bdb6/app/views/projects/merge_requests/creations/_new_compare.html.haml#L29

Potential Solutions

Only return the first 50 branches and add remote filtering. This is what is what we currently do for listing projects when you want to move an issue which also uses gl_dropdown.


Relevant ticket (for internal use only), https://gitlab.zendesk.com/agent/tickets/81962

For actual POST creation slow-ness, see

cc @victorwu @timzallmann

Design

Use same design as compare page. https://gitlab.com/gitlab-org/gitlab-ce/compare?from=master&to=master

Edited by Victor Wu