Gitea: GitHub Migrations for Enterprise GitHub servers

Created on 9 Jun 2020  路  16Comments  路  Source: go-gitea/gitea

Hi Gitea Developers,

When using repository migrations (mirroring) there is support for GitHub, that will offer to migrate not only the code, but also Issues, Pull Requests and similar by using the GitHub API to fetch the additional content.

Please make it possible to do the same also when not using the public GitHub, i.e. "github.com".

There are enterprise GitHub instances out there, typically something like "github.company.com" or so, that will work the same, but are some "isolated" GitHub.

Currently unfortunately only the code migration is possible from such enterprise GitHub instances.

Thank you and best regards

@coldcoff

kinbug

Most helpful comment

Good idea. I added a comment to https://github.com/go-gitea/gitea/issues/8689.

This is not really a new platform / new migration.

As it is just "GitHub with different URLs" (and the software version running there is probably a bit older than the public GitHub) the task is hopefully only to make some hardcoded GitHub URLs configurable/extendable.

So it might be a lower hanging fruit.

All 16 comments

So @lunny's PRs 6290 and 6200 solved the base functionality and I believe the issue to support more platforms is #8689. So maybe it would be better to add it over there, to have everything at one place?

Good idea. I added a comment to https://github.com/go-gitea/gitea/issues/8689.

This is not really a new platform / new migration.

As it is just "GitHub with different URLs" (and the software version running there is probably a bit older than the public GitHub) the task is hopefully only to make some hardcoded GitHub URLs configurable/extendable.

So it might be a lower hanging fruit.

If the only difference between public github and enterprise github is the domain? I would like to send a PR to support enterprise gihtub but I cannot access any enterprise github instance and could not test it. If anyone would like to help testing, please let me know.

@lunny trial can be found here: https://enterprise.github.com/trial

Is this solved by #12619 ?

Probably. Is there some test / nghtly build already I can use to try that? I saw that's just merged to master.

You can use https://try.gitea.io (can make repo private and delete after testing)

Nope, unfortunately not. That one is not able to connect to our companies enterprise GitHub.

Hmm, it may be worth spinning up a local instance of Gitea to see if it generated any errors trying to migrate (the logs on try would probably be a nightmare to parse through)

Theoretically it should use the same API as GitHub, so I'm curious where it's choking.
If I have some extra time I might try testing with the trial of GH Enterprise.

Thanks for checking! 馃檪

Please let me know when there is any "-rc1" or "nightly" or so for me to test, if you need that.

https://dl.gitea.io/gitea/master always has the latest build of the master branch.

We also provide a docker with the tag latest that always has the latest version of Gitea

I downloaded the lastest trunk and gave it a try.

The page says that I need an access token to migrate additional stuff, so I entered some.

Although I specified a path to our enterprise instance:
image

The migration failed and I saw in the log:
2020/09/14 13:31:49 modules/task/task.go:51:handle() [E] Run task failed: GET https://api.github.com/repos/COMPANY/REPO: 401 Bad credentials []

So obviously the auth is tried against (hardcoded?) public GitHub, not the enterprise one?

Could you try to remove the username on your URL?

Was coming from that :-) Same.

The "Run task" goes against: https://api.github.com/... instead of https://api.github.COMPANY.com/

Aha, I believe I know where the issue is. We are creating a new client rather than a new enterprise client.

I will try to get a PR in sometime today. As noted in the go-github docs, the two clients behave the exact same, they just have different baseURL and uploadURL properties.

This is (hopefully) fixed by https://github.com/go-gitea/gitea/pull/12863

I will try spinning up a trial version of GHE to test it soon:tm:

Was this page helpful?
0 / 5 - 0 ratings