Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shared): match source-control providers by DNS label #6175

Mergedgb1095(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6175/headmerged by juliusmarminge View on GitHub

An unrelated Git host such as notgithub.example.com is currently treated as GitHub because provider detection uses substring matching.

Provider names now have to appear as complete DNS labels. This keeps self-hosted names such as github.company.com working while leaving embedded names unknown.

Fixes #5932

Tests:

  • pnpm exec vp test run packages/shared/src/sourceControl.test.ts
  • pnpm --filter @t3tools/shared typecheck

Generated with GPT-5.6 Sol in T3 Code's Codex harness, with a focused GPT-5.6 Luna review through Pi.


Note

Low Risk Small, localized change to hostname heuristics in shared detection logic; behavior becomes more accurate with no auth or data-path changes.

Overview Fixes misclassification of Git remotes where hosts like notgithub.example.com were treated as GitHub/GitLab/Bitbucket because provider checks used substring matching on the hostname.

Provider detection for GitHub, GitLab, and Bitbucket now uses a hasDnsLabel helper that requires the provider name to appear as a full DNS label (dot-separated segment), while still recognizing official domains (github.com, etc.) and self-hosted patterns such as github.example.com. Tests cover both self-hosted label matches and embedded-name false positives.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 88108cc43e0c018089319a561de784a5c1c30569. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix source-control provider detection to match by full DNS label

Replaces substring checks (host.includes(...)) with a new hasDnsLabel helper that splits the host on . and checks for an exact label match. This prevents hosts like notgithub.example.com from being misclassified as GitHub, while still matching self-hosted instances like github.example.com.

Macroscope summarized 88108cc.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: d3c594b5-7c26-4c73-ad9e-0bb23a776fa7

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Approvability

      Verdict: Approved 88108cc

      This is a straightforward bug fix that makes source control provider detection more accurate by requiring complete DNS label matches instead of substring matches. The change is small, well-tested, and corrects false positive behavior.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged this178da6b

    5. juliusmarminge closed this

Sign in to join this conversation.