Fix file tree search missing relative URL root
What does this MR do and why?
Fixes the follow-up from !258829 (merged). The file tree search built its request URL as a root-relative path, so it returned a 404 on instances with a relative URL root. It now builds the URL from the projectPath() path helper, which already includes the relative URL root and the organization prefix. A Jest test covers the relative-root case.
References
- Resolves #631811 (closed)
- Follow-up to !258829 (merged)
How to set up and validate locally
-
Serve GDK under a relative URL root, then restart:
gdk config set relative_url_root /gitlab gdk reconfigure gdk restart -
Open any repository and open the file tree browser.
-
Click the file search box and type a file name.
-
The results should populate. Before this fix the request to
/<group>/<project>/-/files/<ref>dropped the/gitlabprefix and returned a 404, so no results showed.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.