fix(glrepo): keep www. prefix on self-managed hostnames

normalizeHostname stripped www. from every host, so a remote, GITLAB_HOST, or -R value of www.example.com resolved to example.com: the config lookup missed and API calls went to the wrong host. Only www.gitlab.com still collapses to gitlab.com, since it is an alias of the same instance.

Note

Users who worked around this bug by logging in under the bare domain (for example glab auth login --hostname example.com --api-host www.example.com) while their remote uses www.example.com must log in again after upgrading. Until then, glab reports "none of the git remotes configured for this repository point to a known GitLab host". To fix this, either:

  • Log in with the real hostname: glab auth login --hostname www.example.com
  • For SSH remotes, run the command the error suggests: glab config set ssh_host www.example.com --host example.com

Closes #8750 (closed)

Edited by Jay McCure

Merge request reports

Loading
Loading