I hope everyone is lucky enough, to have that one annoying friend, the friend that tells you everything as is. Honestly. Usually, it’s quite welcoming, but sometimes. Sometimes it can be one big pain in the a@!.
Well, automation is that friend and more.
Why I personally like automation
The software engineering OCD of course! 🙃 That is not a 100% joke actually.
During my day-to-day development, I try to automate processes as much as I can. Or at the very least, I try to make a collection of steps easier to repeat. Currently, I’m very lucky to work in a Go environment and we use Cobra to create our internal CLI tools. Oh, the happiness! Each time I stumble upon a repetitive task I try to make a tool so I can make mine and the life of my colleagues easier.
Personally, I like automating steps, especially in the CI/CD workflow, to minimize my potential mistakes. In addition, when you set up your automation to be good, it can be painfully ruthless. If you go to higher measures with linting, when you just forget that one indentation and you get an 🔴. That’s so annoying! I love it! Because it stopped me from piling them so the next time I do formatting it’s not a huge change.
There are a lot of boring tasks that automation can solve. Running tests, builds, etc in parallel. One of the most boring, but crucial tasks is setting up your local environment. That is especially useful for new colleagues. Even though personally I don’t use them because of Goland, the VSCode Dev container setup is amazing. You specify everything there and all a new developer has to do is turn on VSCode and start the dev container, and voila you are good to go.
Setting up your CI/CD well can also help you carry the load of all the verifications. Let’s say even that you would locally run tests, vetting, linting, etc. Why not just do git push
and continue on, you will get your results soon enough.
You can even partially automate your PR review process. Introducing SonarQube to your CI, SonarQube can flag items for you, reducing the load on your colleagues for the first iteration at least.
Summing up. Automating our day-to-day tasks reduce the load you encounter, it will struggle with various setups so we don’t have to, it will be strict so we don’t become lazy, it won’t make silly mistakes with version bumping or the like, and the green marks simply feed the OCD.
Automation challenges
After attempting to sell the story of how nice it is, there is the other side of the medal as well. In the beginning, until you get the hang of it, it can be a bit challenging to set up.
When you switch to a new tech stack, a new git hosting platform or anything new. The pain is the biggest. Every little step is quite annoying. “Oh I forgot to run go fmt!”. The triggers for the CI won’t run when supposed to. They will consume too much time. You will fail and fail. But bear with it. Endure it a bit more and it will be rewarding. A bit of discipline is required.
The picture above is a perfect example. You will have to re-run your automation many, many times until you get with the flow of writing and expanding it. You might feel a bit stressed at that time, and you will be. But it’s an investment, just like everything else.
Going the extra mile
You can go even further. You can introduce an IaC (Infrastructure as Code) tool to your workflow. That brings version control, less forgetting, and taking care of a lot of things with it! For example, imagine you can just do
module "new_company_member" {
// some data here
// some data there
}
and off it goes and automates a lot of steps. Creates a Gmail workspace account. Creates an AWS IAM role, and assigns basic permission, sends invites for Slack, adds to mailing lists, alarm lists, etc. And in the case the member leaves the company, you just delete that patch of code, and all those items are revoked and deleted. So you didn’t forget to revoke that ssh keypair permission on that one instance for internal tools that could cost you.
In case you didn’t notice, I know it’s so hidden in the fine print. I’m a bit in love with it. I manage lot’s of my stuff with Terraform. For fun and practice as well. GitHub repositories, organizations, some account items, etc.
Summed up.
Automate as much as you can, all the boring tasks, all the verifications. Be strict with yourself (but make permission for emergency necessary flexibility of course). Make the CI/CD workflow. Let it be your honest friend.