Skip to content

Fix go-get support for relative urls

What does this MR do and why?

Contributes to #508593 (closed)

Problem

!161162 (merged) changed the generation logic for urls.

Before we used to build URLs based on Gitlab.config.gitlab.url value

After the change, we use Gitlab.config.gitlab.host value.

The problem with this approach that it ignores relative URLs configuration.

Solution

Revert changes to rely on Gitlab.config.gitlab.url as before.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-12-19_at_10.15.55 Screenshot_2024-12-19_at_10.18.25

How to set up and validate locally

  1. Define relative_url_root in gdk.yml
relative_url_root: '/gitlab'
  1. gdk reconfigure

  2. gdk restart

  3. Visit http://gdk.test:3000/gitlab/gitlab-org/gitlab-test?go-get=1

  4. You should see that relative url /gitlab is missing in the url Screenshot_2024-12-19_at_10.15.55

  5. Enable feature flag: Feature.enable(:go_get_handle_relative_url)

  6. gdk restart

  7. Visit http://gdk.test:3000/gitlab/gitlab-org/gitlab-test?go-get=1

  8. The relative url /gitlab will be present in the url Screenshot_2024-12-19_at_10.18.25

After testing

  1. Remove relative_url_root from gdk.yml
  2. gdk reconfigure to restore the previous state

Numbered steps to set up and validate the change are strongly suggested.

Edited by Vasilii Iakliushin

Merge request reports

Loading