github / gh-gei

Migration CLI for GitHub to GitHub migrations
MIT License
311 stars 83 forks source link

Validate preconditions and show user-friendly messages #990

Open kmaehashi opened 1 year ago

kmaehashi commented 1 year ago

Description

We have been actively utilizing the migration tool for shifting repositories from GHES to GHEC. The tool has been serving us well, and we are grateful for its convenience.

However, we often face complications arising from preparation mistakes (especially PATs). These issues often result in migration failure and require additional troubleshooting.

Currently, we are using a wrapper tool for the gh gei command to check pre-conditions as follows:

timrogers commented 1 year ago

@kmaehashi Thanks for taking the time to reach out ❤️ I definitely agree with you that validations are crucial and can add a huge amount of value.

I believe that we already have most - although maybe not all - of these validations. I'll have to do some detailed digging to figure out the gaps.

Would you be willing to share the source of your wrapper tool? I'd love to take a look. Feel free to email me at timrogers@github.com if you don't want to share publicly.

dylan-smith commented 1 year ago

Currently the only fail fast explicit checks we do (for GHES sources) are that the target repo does not exist and the target org does exist.

The GEI API calls will do some more checks but that won't happen until after archive generation is complete.

timrogers commented 1 year ago

@dylan-smith Thanks! Good point on the GHES thing - I was thinking about the GHEC flow where we benefit earlier from the GitHub API's checks. I definitely think we could benefit from more checks in the CLI.

kmaehashi commented 1 year ago

Hi @timrogers, I've just shared the details via email. Hope this helps! 🙂