Friday, May 4, 2012

Hubot Project Automation

I'd been curious to try Hubot, a GitHub chatbot written in node.js that can interact with users in IRC, Campfire and other chat systems and do any number of tasks which are defined in CoffeeScript. I was interested in the project automation scripts that others had written and contributed to the hubot-scripts repository, such as the teamcity and jira integrations. I was also interested in discovering if having a hubot in our chatroom would encourage the adoption of chat within the project team.

It took a couple of hours to get set up and working with Campfire. There were a few gotchas and pieces of unclear documentation along the way, but soon enough I had my hubot installed and working, and I tried a few of the contributed scripts.  It didn't help that the server on which I wanted to run Hubot didn't have node.js installed, so some of that time was the node setup.

Hubot Scripts
It's easy to find yourself staring at the github folder of contributed scripts, wondering what they all do. I encourage you to go look at the script catalog instead, which is a little more amenable to skim-reading. A lot of them are simple humor things which weren't really my area of interest for hubot -- I was more interested in fuctional integrations.

The scripts that are there tend to be pretty limited; if you wanted to do anything sophisticated, you're probably going to have to do it yourself. I was hoping for a little more, to be honest.

That said, the scripts look fairly easy to write, and if you're already familiar with CoffeeScript or you're interested in picking it up, I don't think it's going to be a big barrier to entry.  It would be nice to have more sophisticated well-documented examples showing how to do a few things like respond to externally-triggered events.

In any case, much of the things I might want a hubot to do are going to be specific to the projects and environments of a particular project and company, and those things aren't going to be things that others will write.

Automating with Hubot vs. Other Tools
I haven't personally written any Hubot scripts, so I can only speculate at what Hubot would be good at and where other tools would be a better fit.

Looking at the technology and the kinds of integrations that have already been written, I feel like Hubot's basis in CoffeeScript and Node.js give it a lot of affinity with web technologies. That means that integrating with other systems using REST and JSON is pretty easy in a way that wouldn't be for shell scripts. If you're doing a lot of these kinds of integrations, you'd probably find that Hubot's a good fit. If what you really want to do is interact with the filesystem on a server, I suspect you'd find it easier to do that with shell scripts and build tools.

Encouraging Chat Usage
After trying out Hubot briefly, I'm going to have to say that I don't think it's sufficient to really encourage the use of chat. If you're already using a chat room, then being able to invoke those things from the chat room you're already in and in a way that's visible to the rest of the team is potentially worth the trouble.

If you're not in a chat room already, then everything you might have a hubot do is probably simpler to do with shell scripts, build tools (e.g. maven, ant, rake, make), and custom command-line programs (e.g. awesome-cli-ruby) than loading a chat room and using a chat robot.

Hubot is a neat bit of technology. If you're already using team chat, and particularly if you're distributed I'd definitely suggest checking it out. But if you're not using team chat, then I don't think that Hubot will be the driver that will make that happen.

No comments:

Post a Comment