In 2017 we were 5 developers maintaining 160 repositories. It felt like tech debt kept piling up and like we would never be able to do productive work outside of maintaining existing projects.
Luckily there are a long list of great tools out there that saved us from drowning in maintenance work. We chose to automate every step of the way and these are the great tools that made it possible.
GitLab is able to offer pleasant source code hosting, deeply integrated with a flexible and powerful CI/CD solution. And the best thing? You can use it for free – at least the community edition. It can be as simple as running
terraform apply to get your own gitlab instance running. (This does link to a production ready setup of GitLab, using a cluster of servers, so be aware of the cost of that.)
Delightful testing that just works out of the box. With snapshots that allow for quick yet effective tests for simple cases.
Formatting your code doesn't feel like a lot of work but it's something you have to do all day & every day. When you can delegate that to a tool like prettier, you can focus your attention on business logic and code structure, something the machines can not do for you (yet).
Releasing a new version should be simple.
standard-version makes sure that every time you release a new version of your package, the change log is generated automatically and added to the repository.
The above mentioned
standard-version works well when your commits formatted so that the full changelog can be autogenerated and structured accordingly. Commitlint will make sure that you don't accidentally forget to adhere to the correct commit format.
It's not much fun to keep your dependencies up to date. It doesn't feel like you're doing much productive work and requires you to check if a new version is available in the first place. Renovate does much of that for you: The tool is able to keep many dependencies up to date, it's highly configurable and is able to create pull requests against your repositories as dependencies are updated. You can see my favourite configuration in this gist.
Lerna allows you to manage multiple related packages in a single repository. Our custom data processing framework
fireant was made up from multiple components – the runtime
fireant-core, the adapter to AWS SQS and to Google PubSub (you can read about how we tried to switch once, the deployment generator, tooling to quickly run & test
fireant locally during development and
create-fireant-worker, a tool that made it very easy to create a new worker & deployment and a couple more. Initially all of those items had their own repositories with tight dependencies between them. Lerna allowed us to manage these related packages in one repository while separating their different concerns clearly in terms of source code structure as well as production bundles.
Unfortunately this is not a public project, so I can't link to it. We built a little ChatOps script that sends a message to one of our Slack channels, every time a new version of any of our packages was published. Since publishing always occurred in the GitLab CI (see above) and always contained a changelog, we were able to reliably post the latest changelog and keep the whole team informed.
I can't imagine that everyone knows all of these tools in and out. Luckily most of them just work out of the box once you have your repository set up. And in order to make it easy to set up a repository with them, I introduced our custom
dev-scripts, inspired by Kent C. Dodds'
kcd-scripts. For now, I'll let Kent explain why custom toolkits are great.