Cannot search for merge requests by target branch when using a relative URL
Summary
Reproduced in GitLab 18.2.1-ee
If GitLab is using a relative URL, it is not possible to filter the list of merge requests by target branch.
Steps to reproduce
- Setup GitLab with a relative URL.
- Navigate to any project with merge requests and attempt to filter by Target Branch. You will see a
There was a problem fetching branches
error
Example Project
N/A
What is the current bug behavior?
When attempting to filter merge requests by Target Branch, you will see a There was a problem fetching branches
error.
What is the expected correct behavior?
When attempting to filter merge requests by Target Branch, you should see a list of branches.
Relevant logs and/or screenshots
If we take a look at the Network tab, we can see a request is made to https://gitlab.example.com/-/autocomplete/merge_request_target_branches.json?project_id=xxxx
which returns a 404
. The URL is missing the relative path eg. https://gitlab.example.com/relative-path/-/autocomplete....
.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.