Skip to content

Github enterprise support #134

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

Open
nick-kanakis opened this issue Sep 10, 2020 · 18 comments · May be fixed by #319
Open

Github enterprise support #134

nick-kanakis opened this issue Sep 10, 2020 · 18 comments · May be fixed by #319

Comments

@nick-kanakis
Copy link

Are there plans to support github enterprise as well? I see that there are many github.com related functionality it would be nice if users could customize the endpoint to also support github enterprise.

@mikelalcon
Copy link
Collaborator

Hi Nicolas,

We wouldn't mind supporting GH enterprise. The main two problems is that we don't have the bandwidth right now and we don't have access to an example enterprise host to test it. But we would happily accept contributions. I think the main work is to extract all the hardcoded "https://github.com/" and make it a parameter for origin/destination (something like a param like enterprise = "https://example.com" or similar)

@nick-kanakis
Copy link
Author

Nice, I can take up the task for that, I'm not sure about my bandwidth for this week but hopefully next week I can start.

@hsudhof
Copy link
Collaborator

hsudhof commented Oct 1, 2020 via email

@nick-kanakis
Copy link
Author

(hmm somehow I deleted my questions). Since the enterprise host syntax might differ quite a lot, I think I have to utilize GitHubOption but there are quite a few places that do not use it I will try to come up with a PoC and get your opinions.

@mikelalcon
Copy link
Collaborator

I think it cannot be in GHOptions, since it would apply globally.

For example, a common use case could be GH entrerprise <-> public GH

Another (not sure how common) GH enterprise 1 <-> GH enterprise 2.

If I have some spare cycles this/next week I can look into it. It might need some real GH enterprise iterations tests :)

@mikelalcon
Copy link
Collaborator

We can try to use GH PR instead of our internal Gerrit so that we can collaborate. sg?

@mikelalcon
Copy link
Collaborator

mikelalcon commented Oct 8, 2020 via email

@nick-kanakis
Copy link
Author

@mikelalcon
Copy link
Collaborator

Thanks! just to confirm, never installed under a path, right. Something like https://foo.bar.sampleCorp.com/github

@nick-kanakis
Copy link
Author

No not in the cases I have seen

@mikelalcon
Copy link
Collaborator

K, after 6d33db4 it should be much easier. We can add a parameter to each fo the git.* that we want to use like

enterprise_host = "github.example.com"

@mikelalcon
Copy link
Collaborator

Assigned to you if you want to tackle this, otherwise I can see if I can do it in the next weeks :)

@ljharb
Copy link

ljharb commented May 4, 2021

any update?

@nick-kanakis
Copy link
Author

Sorry couldn't find time to work on it. Feel free to pick it up

@nick-kanakis nick-kanakis removed their assignment Jul 4, 2021
@rubenLindstrom
Copy link

Also interested!

@andrew-kowalczyk-cb
Copy link

@mikelalcon @nick-kanakis

it's been a while since the last comments, but did want to provide an update of mine!

I ended up forking this repo and getting a proof of concept working with GitHub Enterprise, here's the list of files that I needed to change the hardcoded github.com/api.github.com URLs to the matching GitHub Enterprise URLs:

java/com/google/copybara/git/GitHubPrDestination.java
java/com/google/copybara/git/GitHubWriteHook.java
java/com/google/copybara/git/GitRepoType.java
java/com/google/copybara/git/github/api/GitHubApiTransportImpl.java
java/com/google/copybara/git/github/util/GitHubHost.java

there's definitely way more work to get this properly working from a configuration level, but did want to report here that I was able to sync code and pull requests!

castler added a commit to castler/copybara that referenced this issue Mar 19, 2025
GitHub can be hosted by companies for their own usage (under their own
URL).
This changset removes the hard-coded url to `github.com` and makes it
confligurable for a user, which GitHub-instances shall be supported.

Closes google#134
@castler castler linked a pull request Mar 19, 2025 that will close this issue
@castler
Copy link

castler commented Mar 19, 2025

@mikelalcon

In #319 I was able to introduce GitHub enterprise support.

All tests passed on my side (CI, let's see).

Due to the need to inject the GitHub host into various places it touches a lot of places.

I am happy to address any review comments

@junlong-gao
Copy link

@mikelalcon

In #319 I was able to introduce GitHub enterprise support.

All tests passed on my side (CI, let's see).

Due to the need to inject the GitHub host into various places it touches a lot of places.

I am happy to address any review comments

Thanks! We are also blocked by this, is there anything pending before merging?

castler added a commit to castler/copybara that referenced this issue May 7, 2025
GitHub can be hosted by companies for their own usage (under their own
URL).
This changset removes the hard-coded url to `github.com` and makes it
confligurable for a user, which GitHub-instances shall be supported.

Closes google#134
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 a pull request may close this issue.

8 participants