Skip to content
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

GitHub Migrations for Enterprise GitHub servers #11815

Closed
coldcoff opened this issue Jun 9, 2020 · 16 comments · Fixed by #12863
Closed

GitHub Migrations for Enterprise GitHub servers #11815

coldcoff opened this issue Jun 9, 2020 · 16 comments · Fixed by #12863
Labels

Comments

@coldcoff
Copy link

coldcoff commented Jun 9, 2020

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

@techknowlogick techknowlogick added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jun 9, 2020
@alexanderadam
Copy link

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?

@coldcoff
Copy link
Author

Good idea. I added a comment to #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.

@coldcoff coldcoff mentioned this issue Jun 10, 2020
24 tasks
@lunny
Copy link
Member

lunny commented Jun 19, 2020

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.

@techknowlogick
Copy link
Member

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

@jolheiser
Copy link
Member

Is this solved by #12619 ?

@coldcoff
Copy link
Author

coldcoff commented Sep 1, 2020

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

@jolheiser
Copy link
Member

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

@coldcoff
Copy link
Author

coldcoff commented Sep 1, 2020

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

@jolheiser
Copy link
Member

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! 🙂

@coldcoff
Copy link
Author

coldcoff commented Sep 3, 2020

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

@zeripath
Copy link
Contributor

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

@coldcoff
Copy link
Author

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?

@lunny
Copy link
Member

lunny commented Sep 14, 2020

Could you try to remove the username on your URL?

@coldcoff
Copy link
Author

Was coming from that :-) Same.

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

@jolheiser
Copy link
Member

jolheiser commented Sep 14, 2020

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.

@lafriks lafriks added type/bug and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Sep 14, 2020
@jolheiser
Copy link
Member

This is (hopefully) fixed by #12863

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

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants