Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Source-control provider detection misclassifies unrelated hosts containing github, gitlab, or bitbucket #5932

Closedtheworker02(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

call: detectSourceControlProviderFromRemoteUrl( "https://notgithub.example.com/acme/project.git", );

Actual result

The result is classified as GitHub:

{ kind: "github", name: "GitHub Self-Hosted", baseUrl: "https://notgithub.example.com" }

Expected behavior

Unknown Git hosts should remain:

{ kind: "unknown", ... }

Unless the host is either:

  1. a known SaaS hostname such as github.com, gitlab.com, or bitbucket.org; or
  2. explicitly configured/detected as a self-hosted instance of that provider.

Simply having the provider’s name somewhere in the hostname should not be enough.

For example:

detectSourceControlProviderFromRemoteUrl( "https://notgithub.example.com/acme/project.git", )?.kind;

should return:

unknown

Actual behavior

detectSourceControlProviderFromRemoteUrl() currently determines whether a Git remote belongs to GitHub, GitLab, or Bitbucket by checking whether the hostname contains the provider name.

Impact

Major degradation or frequent failure

Version or commit

Observed on the current main branch at commit: f21d5e444e9a6b5876253ca8618a4dc8d4f2146c Commit message: Move project settings to contextual project routes (#5923) Commit date: 2026-08-10

Environment

N/A - Static Analysis

Logs or stack traces

No exception or stack trace is produced because the failure is a logical misclassification rather than a runtime error.

Example reproduction:



import { detectSourceControlProviderFromRemoteUrl } from "./packages/shared/src/sourceControl";

console.log(

  detectSourceControlProviderFromRemoteUrl(

    "https://notgithub.example.com/acme/project.git",

  ),

);

Screenshots, recordings, or supporting files

No response

Workaround

Temporary workaround

Use a neutral hostname for generic/self-hosted Git servers whose domain currently contains provider-name substrings such as github, gitlab, or bitbucket.

For example, instead of:

https://gitlab-backup.example.com/acme/repo.git

use an alternate DNS name such as:

https://scm-backup.example.com/acme/repo.git

pointing to the same server.

This avoids the current substring-based provider detection and allows the remote to remain classified as unknown.

If DNS changes are not possible, an SSH host alias may also help, depending on how the remote URL is parsed.
  1. theworker02(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. juliusmarminge closed this

Sign in to join this conversation.