Hi all!
I'm fairly new to Rust (coming from the JS/TS world with a few years of mobile dev experience, both Android and iOS) and I'm trying to hack some utility things to learn more about the language and how to write idiomatic Rust.
I want to share with you my first "real" CLI I've built that me and my teammates used at work to migrate a bunch of repositories from our Bitbucket to a new GitHub organization. Moving 300+ repositories manually would be a real pain in the ass, so I naturally thought about automating this. The first option was hacking some bash scripts or using zx
for scripts in TS but then an idea came to my mind that I could use Rust for it, as I've heard it's a great project idea for beginners to create CLI that solves their real-life problems
That's how migrate-bb-to-gh was born.
This is not the latest creation (dating April/May 2022) but I finally got over myself and decided to share it here and ask for a code review.
Some more info on how it works
It lets you choose (via interactive prompts using dialoguer
) which repositories you want to migrate from the Bitbucket organization to the GitHub organization with some additional settings like what should be the default branch, which Team should get access to this new repository (if you don't have a proper Team set up, you can set up it via CLI and add members to the team as well), assign proper access to the repository for selected teams, etc.
The migration is split into 2 steps:
- You select what you want to migrate and how, this stores all migration actions in a JSON file that you can double-check, edit, and share with someone on the team
- Run the actual migration based on the file with migration actions
I would really appreciate it if you had some time to check the code and let me know your opinion of it. Unfortunately, I don't have any colleagues working in Rust so couldn't think of another place to ask for this.
Link to the repo: https://github.com/arkus7/migrate-bb-to-gh