-
Notifications
You must be signed in to change notification settings - Fork 692
Add GitHub Enterprise support to GitHubClient #10265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
https://<ghe-domain>/api
.Co-authored-by: Byron <[email protected]>
cce3671
to
d8efbd2
Compare
d8efbd2
to
5f57fe2
Compare
5f57fe2
to
92ed215
Compare
92ed215
to
024788d
Compare
This PR, particularly the tests, look good in principle, but maybe it's too much for what it actually should do. ![]() This for some reason didn't work as it didn't find the function that should exist according to the type system, but I assume it's not really needed. Thanks @estib-vega for taking a look 🙏. |
I am not sure this is how we want to approach this. Perhaps if there is a quick win here it would be great. Otherwise, I would like to move the GitHub/forge functionality more on the rust end |
That makes sense - if the code here is salvageable I think it qualifies as quick win, but moving everything to Rust is certainly more effort. However, even that effort might be acceptable if AI can do the port - a task it's supposedly good at. |
Fixes #2623
This PR implements GitHub Enterprise Server (GHE) support by enabling the GitHubClient to work with custom GitHub Enterprise installations that use the API endpoint pattern
https://<ghe-domain>/api
.Changes Made
GitHubClient Enhancements
setRepo()
method to accept an optionaldomain
parameternewClient()
function to dynamically construct the correct API base URL based on the domainSmart URL Construction
The client now intelligently determines the API endpoint:
https://api.github.com
https://<domain>/api
patternIntegration Updates
GitHub
class constructor to pass domain information from the repository to theGitHubClient
Example Usage
With a GitHub Enterprise installation at
github.mycompany.com
, the client will now automatically:https://github.mycompany.com/api
Testing
Added comprehensive test coverage including:
Backward Compatibility
This change is fully backward compatible - existing GitHub.com repositories continue to work exactly as before, with no configuration changes required.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.