Skip to content

Fix webIDEUrl for relative URL case

Cindy Halim requested to merge 477551-fix-web-ide-url-with-relative-path into master

Issue: Incorrect Web IDE URL constructed when relative... (#477551 - closed)

What does this MR do and why?

This MR fixes a bug with webIDEUrl when the project path contains a string matching relative_url_root.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No relative URL With relative URL

no_relative_url.mov

Regression testing: Web IDE URL is constructed correctly as expected.

relative_url.mov

Web IDE URL is correct: although we encounter an error in the /oauth/authorize step, we no longer see the 404 error page. The authorize error is fixed in this MR: Fix relative_url_root Web IDE OAuth issues (!161328 - merged).

Here's how it looks with the /oauth/authorize fix:

relative_url_with_other_fixes.mov

How to set up and validate locally

Enable Web IDE OAuth flag

1. Make sure that web_ide_oauth feature flag is enabled by visiting /gitlab/rails/features

Set up relative_url_root locally in your GDK

  1. Stop GDK with gdk stop
  2. Add relative_url_root: "/gitlab" to your gdk.yml
  3. Run gdk reconfigure
  4. In resulting Procfile, add -authBackend http://localhost:8080/gitlab to the end of the line that starts with gitlab-workhorse: (this is an issue with gitlab-workhorse I discovered while testing. We'll fix the Procfile generation in a separate MR)
  5. Start GDK with gdk start
  6. Now you can visit the GDK at /gitlab
  7. IMPORTANT: You might also need to disable vite, since that seems to have relative_url_root issues. https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/configuration.md#vite-settings

Related to #477551 (closed)

Edited by Cindy Halim

Merge request reports