Skip to content

Resolve "new snippet from snippet view is broken when using selfhosted gitlab with relative URL"

What does this MR do?

Updates the hardcoded URLs for snippets to take the relative_root_url into account to not break the URLs on instances, served from a subfolder.

See #220509 (closed) for more details

Click testing

  1. To "mimic" serving from a subfolder, gdk.yml has to be updated to something like this:
# gdk.yml
relative_url_root: "/foo/"

Check https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/master/doc/configuration.md for more details.

  1. gdk reconfigure && gdk restart

  2. Once the instance is up and running, navigate to an existing snippet. Keep in mind that the root URL to your site will be changed from, let's say, http://127.0.0.1:3000/ to http://127.0.0.1:3000/foo/.

  3. Make sure the "New snippet" button in the top right corner of the snippet view has the href attr including the /foo/ part. Without this MR, the URL is missing that part that leads to broken link for creating a snippet. Screenshot_2020-08-20_at_12.41.22

  4. Delete the existing snippet. The view should be properly redirected to the list of existing snippets. Without this MR, the redirection fails.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

References #220509 (closed)

Edited by Denys Mishunov

Merge request reports