Automating simple tasks

When I first started my development career I was nervous about scripting things. I felt that if I wasn’t using some sort of GUI tool I had a higher potential for error. So I was afraid to automate my tasks even the most simple ones. I thought the risk wasn’t worth the reward. I thought if it only takes me a minute each time to do that task why would I spend more than that time creating an automated script. As I gain more experience in my career my view has changed on this. The turning point was only a couple of days ago. Over the holiday break I read The Passionate Programmer: Creating a Remarkable Career in Software Development (Pragmatic Life) and it really opened my eyes that everything we do over and over again should be automated. Not only tasks that take hours but even simple tasks that could take only a short period of time. So I started automating some of my work tasks. These are tasks that I repeat over and over again.

The first task that I automated was creating branches for Github. I found myself doing something similar to this over and over again.


git remote update; git co -b [ticketId]_description upstream/[branch]; git push [repo] [branch]

This process would only take me a little bit of time. I had never thought about automating it because the time it took wasn’t very long. After reading the book I decided to give it a try to see if it made it easier or faster. It turns out that I now save over half the time per branch creation. It may not seem like a lot of time at first but when you do it multiple times per day it adds up.

After I automated that process I thought what other tasks do I do over and over again that could potentially be automated. At my job we create pull requests for each branch when it’s ready to be merged. We use Github so the process that I was following was to go up to Github and use the GUI provided. Well it turns out that Github has an API that is very easy to use. So I created a automated script for creating pull request’s. Now instead of it taking me a minute or more to create a simple pull request it takes around 10 seconds. Again the time savings adds up. For example most days I will create up to three or more pull requests per day. You can see how the time saved really adds up.

I wasn’t satisfied with that level of automated. So I decided to take it up another level. Each pull request we create we then need to turn around and go down to our ticket tracking system and put that pull request link in there. We use PivotalTracker for ticket tracking. Well that seems like a tedious task especially since I am already using the Github API to create the pull request. So I added that to my automated process. So now to make a pull request and update the ticket status I can do so in around 10 seconds. This allowed me to cut the whole process pull request to updating the ticket to be under 15 seconds. What use to take me more than a minute now takes under a half of a second.

The point of this post is that automating even the simplest of tasks is important. It can make a huge difference. My thought process now when I get a new task is how can I automate the tedious part of the task. That way I can spend more time dealing with complex issues that are not able to be automated. If you are new to automation I would start with something simple. Don’t try to automate your entire process through one script. Possibly create multiple smaller scripts so you can do it over time.

Leave a Reply

Your email address will not be published. Required fields are marked *