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 |
---|---|
![]() |
![]() |
How to set up and validate locally
- Define
relative_url_root
in gdk.yml
relative_url_root: '/gitlab'
-
gdk reconfigure
-
gdk restart
-
Visit
http://gdk.test:3000/gitlab/gitlab-org/gitlab-test?go-get=1
-
You should see that relative url
/gitlab
is missing in the url -
Enable feature flag:
Feature.enable(:go_get_handle_relative_url)
-
gdk restart
-
Visit
http://gdk.test:3000/gitlab/gitlab-org/gitlab-test?go-get=1
After testing
- Remove
relative_url_root
from gdk.yml -
gdk reconfigure
to restore the previous state
Numbered steps to set up and validate the change are strongly suggested.