Mechanics of moving an other-repo to the monorepo
Blog post from Aspect Build
Integrating projects into a Bazel monorepo involves a careful, step-by-step process to ensure seamless merging and maintain developer workflow parity. The process begins with ensuring that both the monorepo and the other repository are similarly structured and governed, allowing for smooth incorporation into the monorepo's Bazel workspace. Communication with developers is crucial, as open pull requests in the other repository should be completed before the migration to avoid complications. A key step involves preserving the git history of the other repository by using a git plugin to rewrite its history into a subdirectory format, followed by merging it into the monorepo with a merge commit. During this process, it is essential to prevent divergence by temporarily halting new commits in the other repository and adjusting branch protection settings if necessary. Once the merge is complete, developers need to be reoriented to work within the monorepo's trunk-based development environment, and CI/CD workflows should be configured to leverage Bazel's capabilities, despite its initial setup complexities. The ultimate goal is to integrate the repositories effectively without disrupting existing workflows or losing critical historical data.