All-in one: Mono-repo repositories
We favor "mono-repo" repositories. That is everything that belongs to a customer's project goes into one single Git repository: All the different subprojects also-known-as "services" (backend, frontend, mobile app), any technical documentation and any infrastructure code.
How we benefit
We heavily benefit from mono-repos in various ways:
- one single
git cloneandgit pullto fetch the entire code base of a single project - one single merge request (pull request in GitHub slang) for code changes that affect multiple services at once; we encourage all of our developers to work full-stack, although it's not strictly required, people can still have their favorite service in the stack they prefer working on
- one single unified deployment configuration and pipeline which treats all services the same
- the entire project ("app") including all of its services is automatically versioned via the corresponding commit hash; we aim for making every single commit deployable as-is
- easy rollback: just revert to a previous commit which was known to work; the entire stack can be deployed to that point-in-time; unless the database schema had changed – we don't do schema downgrades
- there's only one single artifact that we need to hand over to a customer when they ask for "the code"; in worst case the repository is exported as one ZIP file
Downsides: Surely there are some but practically we haven't encountered any so far; and with pragmatism being one of our core values, we won't list any theoretical downsides here. Other teams may have practically run into them – we didn't (yet).
Only two branches: dev and prod
While we use only one single repo per project, we still have multiple branches, but usually only these two:
Branch dev: This is where all new code is merged into and auto-deployed to the development environment, for immediate testing by the developers and product owners
Branch prod: This is where production code lives. Product owner wants a full product roll out? We merge into dev into prod. Critical patches? We merge commits both into prod and into dev.
Besides dev and prod there are no other branches which keeps the main super repo clean. Want to your own branch? Fork the main repo first!