gh-gei
gh-gei copied to clipboard
Validate GHES version when starting a migration with GHES as source
gh gei only supports migrations from GitHub Enterprise Server (GHES) where the ES instance is running at least v3.4.1.
If you try to run a migration from an unsupported version, this leads to obscure error messages that aren't obvious to the user. From reading through support tickets, this is happening reasonably frequently.
In the CLI, we should do a pre-flight check before running a migration to check the version of the GHES instance we're connecting to.
We can do this by making an unauthenticated request to GET /api/v3/meta, which returns a response like this:
HTTP/2 200
{
"verifiable_password_authentication": true,
"installed_version": "3.7.1"
}
@timrogers Please continue to allow migrations from GHEC -> GHEC while using the --ghes-api-url argument. This is very important for @github/professional-services folks who need to demo and troubleshoot gei but don't want to spin up a GHES instance and populate it with repos and metadata.
Perhaps check installed_version if it exists in the response and error if version is < 3.4.1 . If installed_version not exist in the response, continue.
@robandpdx Thanks for the feedback! That's a great use case to be aware of.