Skip to content

Fix openapi viewer for relative url instances

Dheeraj Joshi requested to merge djadmin-fix-openapi-relative-instance into master

Fixes #381047 (comment 1296098032)

What does this MR do and why?

This fixes the openapi viewer for instances configured with root-relative url.

This has been broken because the iframe sandbox loads on a separate origin which doesn't have access to gon.relative_url_root to load the webpack chunk properly.

Screenshots or screen recordings

Notice the gdk.test:3000/gitlab without /gitlab in the Network URL tab:

before after
image image

How to set up and validate locally

  1. Configure a gdk instance by appending the following line to gdk.yml relative_url_root: /gitlab
  2. Run gdk reconfigure
  3. Create openapi.yaml, for example https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi_v2.yaml

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dheeraj Joshi

Merge request reports