Geo: Admin button in sidebar incorrectly uses absolute URL instead of relative path

What

The Admin button in the GitLab super sidebar is using an absolute URL (admin_root_url) instead of a relative path (admin_root_path). This means on a Geo secondary site, the Admin button points to the primary instead.

Current behavior:

  • The Admin button always links to the primary site's URL (e.g., http://127.0.0.1:3000/admin)
  • On Geo secondary sites or development environments with multiple instances, the Admin button points users to the wrong instance

See screenshot below -

Screenshot_2025-08-26_at_18.01.38

Expected behavior:

  • The Admin button should use a relative path (/admin) so it stays on the current instance
  • Users on a Geo secondary site should remain on that site when clicking the Admin button

Impact:

  • Potential confusion about which site they are currently using

Implementation plan

  1. File to modify: app/helpers/sidebars_helper.rb

  2. Specific change required:

  • In the app/helpers/sidebars_helper.rb
  • Change admin_url: admin_root_url, to admin_url: admin_root_path,
  1. Example:
- admin_url: admin_root_url,
+ admin_url: admin_root_path,
Edited by 🤖 GitLab Bot 🤖