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
- 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.
-
gdk reconfigure && gdk restart
-
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/
tohttp://127.0.0.1:3000/foo/
. -
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. -
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
References #220509 (closed)