google / copybara

Copybara: A tool for transforming and moving code between repositories.
Apache License 2.0
2.07k stars 246 forks source link

Github enterprise support #134

Open nick-kanakis opened 3 years ago

nick-kanakis commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

This is going to be a bit of a pain, presumably the patterns should be replaced with a parser that is able to deal with the enterprise syntax, if possible. Otherwise, the util might need to be injected from the GitHubOption instead and rely less on statics.

On Thu, Oct 1, 2020 at 4:16 PM Nikolaos Kanakis notifications@github.com wrote:

@mikelalcon https://github.com/mikelalcon I have started working on a version that supports GitHub enterprise. I'm unsure, what is the best way to deal with static variables at GithubUtil https://github.com/google/copybara/blob/master/java/com/google/copybara/git/github/util/GitHubUtil.java#L35 .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/copybara/issues/134#issuecomment-702373470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFKR2H5JBXMF4Q4F4UHVUUTSITPTNANCNFSM4REOSZWA .

--

Henry Sudhof | Software Engineer | hsudhof@google.com | US-NYC-9TH 14E220

nick-kanakis commented 3 years ago

(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 commented 3 years ago

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 commented 3 years ago

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

mikelalcon commented 3 years ago

Nikolaos,

Could you send us example GitHub Enterprise urls? (you can anonymize them) In particular https://foo type, "git@github.com:" ones, etc. Also if it can be installed in a path (https://foo.com/some_path/user/project)

On Fri, Oct 2, 2020 at 3:56 AM Nikolaos Kanakis notifications@github.com wrote:

(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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/copybara/issues/134#issuecomment-702584740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHJWQDV32LN4WX6GJBQVLLSIWBTLANCNFSM4REOSZWA .

nick-kanakis commented 3 years ago

Hi @mikelalcon sorry for the late reply:

mikelalcon commented 3 years ago

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

nick-kanakis commented 3 years ago

No not in the cases I have seen

mikelalcon commented 3 years ago

K, after https://github.com/google/copybara/commit/6d33db4b5d6e13d6de770e314139b7fb2571f8f0 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 commented 3 years ago

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

ljharb commented 3 years ago

any update?

nick-kanakis commented 3 years ago

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

rubenLindstrom commented 2 years ago

Also interested!