[go: up one dir, main page]

Skip to content

More user friendly URL to create new merge request when pushing code

Problem to solve

When someone pushes a new branch to GitLab, we display a nice message telling them to visit a URL to create a merge request based on that branch.

The problem with that URL is that it contains special characters, as part of the URL is generated using query params. This not always translate well with the terminal application the user may be using and so it may fail to provide a click to open browser integration.

Further details

The URL is generated by our backend (the internal API). Whatever we change there will be displayed to the user.

https://gitlab.com/gitlab-org/gitlab-ce/blob/0725d4911faf931c6c2d99fda4509ece22ac1aee/lib/api/helpers/internal_helpers.rb#L40-42

Proposal

Create a new friendly route following this syntax: https://#{gitlab.host}/:namespace/:project_path/merge_requests/new/:source_branch_name

Here is an example of how the final URL will look like in gitlab.com: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/new/1234-awesome-branch

What does success look like, and how can we measure that?

We get a URL like the example above: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/new/1234-awesome-branch, instead of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/new?merge_request=%5Bsource_branch%5D=1234-awesome-branch

Links / references

Edited by Gabriel Mazetto