feat: add ssh_host configuration option for SSH connection support

What does this MR do?

This MR adds a new ssh_host configuration option to support GitLab instances that use a different hostname for SSH connections than for HTTPS/API access.

Changes:

  • Adds a new ssh_host field to the host configuration
  • Adds support for GITLAB_SSH_HOST environment variable
  • Updates the remote resolver to recognize Git remotes using the SSH hostname and properly associate them with the configured GitLab instance
  • Updates documentation in README with configuration examples
  • Adds comprehensive tests for the new functionality

Example Configuration:

hosts:
    gitlab.example.com:
        token: xxxxxxxxxxxxxxxxxxxxxxxxx
        ssh_host: ssh.gitlab.example.com

This configuration tells glab that when it sees a Git remote using ssh.gitlab.example.com, it should associate it with gitlab.example.com for API calls.

Note:

This MR introduces ssh_host as a new configuration option alongside the existing api_host. It does NOT replace or deprecate api_host. Both options serve different purposes:

  • api_host: Override the API endpoint hostname (existing functionality)
  • ssh_host: Specify an alternative hostname for SSH connections (new functionality)

Closes #7641 (closed)

Edited by Swapnaneel Patra

Merge request reports

Loading