fix(preprod): Understand ghe.com as github_enterprise#3127
Open
fix(preprod): Understand ghe.com as github_enterprise#3127
Conversation
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.
0d1aa26 to
8ccb16a
Compare
szokeasaurusrex
approved these changes
Feb 4, 2026
|
|
||
| // GitHub Enterprise Server uses *.ghe.com domains | ||
| if trimmed.ends_with(".ghe.com") { | ||
| return "github_enterprise"; |
Member
There was a problem hiding this comment.
Some optional improvements we could do here (both can wait for a separate PR):
-
We could extract
"github_enterprise"to a constant. -
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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