Tag Archives: git

Github ProTip

I recently noticed that Github changed their interface. They did a great job at making it faster and it actually looks more appealing. At least to me. I also noticed with their updates they added something called a ProTip at the bottom right before you make a comment.

If you see the attached image you will see what I am referring to. I think ProTip is a term that has just come up and is already being over used. I feel that if you use that term you are saying you are better than everyone else on that subject. You are considering yourself a pro. Which is fine but why do you have to tell me your a pro. If your really a pro won’t the context of what your saying be take as such. What’s the point in adding this on to a statement. I won’t read it unless your a pro. Also if you add ProTip in front of what your saying there is less of a chance of me reading it. Now every time I have to make a Github comment I get to see ProTip.

Thoughts?

Screen-Shot-2014-01-30-at-15128-PM-2

Github Reliability

I have been using Github for work for the last couple of years. I have noticed that their service has been getting less and less reliable throughout the years. They are the leader when it comes to Git hosting. So it’s hard just to turn them off completely at this point. Plus I am using it at work so I don’t have much say in moving off of it. It’s sad to see it as overall their feature set is really good. They have been very innovative throughout the years. I have been very impressed by their pull request feature and many more. I have also been impressed by how easy they make Git. Saying that they have their own set of issues you have to deal with on a monthly basis. I have noticed more and more that they go down often.

It seems that at least once a month Github will go down for a small time period. This can range from a couple of minutes up to ten or so minutes. It’s never hours of downtime. They seem to respond to the issue fast and get it fixed. I feel that most downtime can be avoidable or should be worked at so it is avoidable. We don’t see Google services go down once a month. In the last couple of years I haven’t seen any Google services  I use to down at all even. Yes in the technology world unexpected things happen from time to time but it shouldn’t be every month. I think Github has forced us to at least think about other hosting providers.

One name that comes to mind is bitbucket. It seems that their feature set is also very rich but they may not have as many downtime issues as Github. I have never used their service but it seems to be gaining in popularity. I really hope to see Github be able to get it together but if not companies are going to have to start thinking about using other Git hosting solutions. It’s also possible to roll your own Git server but of course you won’t get all the rich features of these service platforms.

To be clear right now the best Git hosting service is Github. Even if it goes down a couple times a month. The intention of this post wasn’t to bash Github. I do feel they work hard to keep their service up. I just feel that some of their downtime could be avoided. That is of course without knowing their infrastructure.

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.

Ruby to automate Git and Github tasks

I am trying to automate my Github process more. I started by creating a script that will take some plain text and put it into a branch name format. The format is one that I defined. From there I thought it would be nice to automate sending up a pull request. That seems to take the most time. So I decided to create a Ruby script for that to. I put those scripts inside my Github repository so that anyone could benefit from them. All of this is using the Github API so you can reference their documentation for further details.

https://github.com/wallerjake/github