Skip to content

fix(preprod): Understand ghe.com as github_enterprise#3127

Merged
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-ghe
Feb 5, 2026
Merged

fix(preprod): Understand ghe.com as github_enterprise#3127
chromy merged 1 commit intomasterfrom
chromy/2026-02-03-ghe

Conversation

@chromy
Copy link
Contributor

@chromy chromy commented Feb 3, 2026

To determine vcs_provider we use part of the origin of the URL:

https://github.com/foo/bar -> github
https://gitlab.com/abcdef -> gitlab

This adds special handling for github enterprize remotes. Now instead
of:

https://foo.ghe.com/foo/bar -> ghe

we end up with:

https://foo.ghe.com/foo/bar -> github_enterprise

as the backend expects.

Resolves EME-821

@chromy chromy requested review from a team and szokeasaurusrex as code owners February 3, 2026 16:52
To determine vcs_provider we use part of the origin of the URL:

https://github.com/foo/bar -> github
https://gitlab.com/abcdef -> gitlab

This adds special handling for github enterprize remotes. Now instead
of:

https://foo.ghe.com/foo/bar -> ghe

we end up with:

https://foo.ghe.com/foo/bar -> github_enterprise

as the backend expects.
@linear
Copy link

linear bot commented Feb 3, 2026

@chromy chromy force-pushed the chromy/2026-02-03-ghe branch from 0d1aa26 to 8ccb16a Compare February 3, 2026 17:01
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!


// GitHub Enterprise Server uses *.ghe.com domains
if trimmed.ends_with(".ghe.com") {
return "github_enterprise";
Copy link
Member

@szokeasaurusrex szokeasaurusrex Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some optional improvements we could do here (both can wait for a separate PR):

  1. We could extract "github_enterprise" to a constant.

  2. We could define an enum for the supported providers, and include a fallback for unknown providers, like so:

    enum VcsProvider {
        Github,
        GithubEnterprise
        Gitlab,
        Other(String), // or &str
    }

    Then, we would return the enum from this method. We would probably need to add some serialization logic on the enum, as well as a method to convert an arbitrary string to the enum (probably a From<&str> impl works), so I guess there's some added complexity, but it would be clear what providers we support natively.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good! will try to send a follow up shortly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! And as I said, I think these are just optional improvements, so no rush. It is also fine if we don't do it.

@chromy chromy merged commit 15a6c62 into master Feb 5, 2026
25 checks passed
@chromy chromy deleted the chromy/2026-02-03-ghe branch February 5, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants