Summary
Projects::BuildJob#project_git builds the clone URL from a hardcoded host per provider type:
base_url = if provider.github?
"github.com"
elsif provider.gitlab?
"gitlab.com"
elsif provider.bitbucket?
"bitbucket.org"
end
Enterprise (self-hosted) providers are supported elsewhere — Provider#enterprise?, #api_base_url and #source_base_url all honor registry_url, and Providers::CreateGitlabProvider validates the PAT against the self-hosted instance just fine. But the actual build then tries to clone from gitlab.com and fails:
fatal: Authentication failed for 'https://gitlab.com/<owner>/<repo>.git/'
Failed to clone repository: Command failed with exit code 128
Repro
- Create a GitLab provider with
registry_url pointing at a self-hosted GitLab instance (PAT validates OK).
- Create a project from a repo on that instance and deploy.
- Build fails at clone with the error above.
Suggested fix
Use provider.source_base_url in project_git instead of the hardcoded hosts. For instances that are HTTP-only (common for internal GitLab), the scheme could be taken from registry_url rather than hardcoding https://.
We are running Canine self-hosted (BOOT_MODE=cluster, image ghcr.io/caninehq/canine:latest as of 2026-08-01) against a self-hosted GitLab and currently patch this via an initializer. Happy to send a PR if the source_base_url approach sounds right to you.
Summary
Projects::BuildJob#project_gitbuilds the clone URL from a hardcoded host per provider type:Enterprise (self-hosted) providers are supported elsewhere —
Provider#enterprise?,#api_base_urland#source_base_urlall honorregistry_url, andProviders::CreateGitlabProvidervalidates the PAT against the self-hosted instance just fine. But the actual build then tries to clone from gitlab.com and fails:Repro
registry_urlpointing at a self-hosted GitLab instance (PAT validates OK).Suggested fix
Use
provider.source_base_urlinproject_gitinstead of the hardcoded hosts. For instances that are HTTP-only (common for internal GitLab), the scheme could be taken fromregistry_urlrather than hardcodinghttps://.We are running Canine self-hosted (
BOOT_MODE=cluster, imageghcr.io/caninehq/canine:latestas of 2026-08-01) against a self-hosted GitLab and currently patch this via an initializer. Happy to send a PR if thesource_base_urlapproach sounds right to you.