[Feature]: GitHub Enterprise support in the source control connector #6843
JorrinKievit
started this conversation in
Ideas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Problem or use case
The GitHub connector only recognizes
github.com. On a GitHub Enterprise host — GHES on an arbitrary hostname, or GHEC data residency on<tenant>.ghe.com— the provider is never detected, so PR listing, PR creation, publish, and clone all fall back to the generic "unknown" path even whenghis already authenticated against that host.Concretely, with two authenticated hosts:
Only
github.comshows up in Source Control settings. The enterprise host is invisible to the app despiteghbeing able to talk to it.Two related details that make this more than a labeling problem:
detectSourceControlProviderFromRemoteUrlclassifies arbitrary GHES hostnames asunknown, so nothing downstream routes to the GitHub provider.ghoperations (repo view owner/repo,repo create) have no remote to infer a host from, so they needGH_HOSTto target an enterprise host at all.Proposed solution
Treat GitHub Enterprise as a separate provider kind alongside
github, with hosts derived fromgh auth statusso there is nothing new to configure. I went with the Cursor design where they are seperate connectors, and you can have multiple instances of GitHub Enterprise configured.The piece that seemed worth getting right: a user can be authenticated against several enterprise hosts at once, so one
ghdiscovery probe needs to emit one row per authenticated host rather than one row per provider kind. GitLab's existingrefineUnknownRemotehook already covers the "claim an unclassifiable hostname" half of this.Alternatives considered
Making
githubaccept an optional host instead of adding a kind. That works for a single enterprise host but collapses when someone is authenticated againstgithub.comand two enterprise hosts simultaneously, since discovery rows and settings entries are keyed by kind.Risks or tradeoffs
github.acme.comremote currently classifies as kindgithub. Moving it to an enterprise kind changes anything gated onkind === "github"All reactions