search menu icon-carat-right cmu-wordmark

ChatOps in the DevOps Team

Todd Waits
PUBLISHED IN
CITE

In the post What is DevOps?, we define one of the benefits of DevOps as "collaboration between project team roles." Conversations between team members and the platform on which communication occurs can have a profound impact on that collaboration. Poor or unused communication tools lead to miscommunication, redundant efforts, or faulty implementations. On the other hand, communication tools integrated with the development and operational infrastructures can speed up the delivery of business value to the organization. How a team structures the very infrastructure on which they communicate will directly impact their effectiveness as a team. ChatOps is a branch of DevOps focusing on the communications within the DevOps team. The ChatOps space encompasses the communication and collaboration tools within the team: notifications, chat servers, bots, issue tracking systems, etc.

In a recent blog post, Eric Sigler writes that ChatOps, a term that originated at GitHub, is all about conversation-driven development. "By bringing your tools into your conversations and using a chat bot modified to work with key plugins and scripts, teams can automate tasks and collaborate, working better, cheaper and faster," Sigler writes.

Most teams have some level of collaboration on a chat server. The chat server can act as a town square for the broader development teams, facilitating cohesion and providing a space for team members to do everything from blowing off steam with gif parties to discussing potential solutions to real problems. We want all team members on the chat server. In our team, to filter out the noise of a general chat room, we also create dedicated rooms for each project where the project team members can talk about project details that do not involve the broader team.

More than a simple medium, the chat server can be made intelligent, passing notifications from the development infrastructure to the team, and executing commands back to the infrastructure from the team. Our chat server is the hub for notifications and quick interactions with our development infrastructure. Project teams are notified through the chat server (among other methods) of any build status they care to follow: build failures, build success, timeouts, etc.

Chatbots are autonomous programs that operate and live on the chat server. We have two bots that operate on our chat servers built using the jabber-bot Ruby library. Other chat bot options are python-jabberbot, Lync chat bots, and GitHub's Hubot. Chat bots can be as simple or complex as the team needs them to be.

Our proof-of-concept "DevBot" started small by allowing us to type in commands to dynamically get a command line tip from the website commandlinefu.com. While initially frivolous, the development of this bot allowed our team to develop rapport and trust with one another. As team members realized the power of what the bot could do, it quickly morphed into a utility that would allow us to log work activities to a database, or query the status of the build server. Our bots are written in Ruby and allow us to quickly add commands and integrate with external and internal resources as allowed by policy.

After the success of our first bot, we created a second bot that allowed direct interaction with our issue tracker from the chat window. We could create cases, get a list of active cases by user, and resolve or open new cases from the chat window. Essentially, this gave us the power to contextually create cases based on the current conversation without leaving the chat window.

For example, team members are having conversations with someone and realize they need to adjust a task estimate, they do so from the chat window. They do not need to load a separate tool. They send a chat message to the bot to update an estimate of a particular task.

The code below, for example, would look for the word "estimate," a case number, and the estimate value in a chat message. When the bot sees the appropriate message, it executes a command adding the estimate to the case number supplied with the credentials of the user chatting with the bot.

def estimate(user, msg)
    casenum = msg[0]
    estimate = msg[1]

  fb = fb_session(user)

  fb.command(:edit, :ixBug => casenum, :hrsCurrEst => estimate)
end

bot.add_command(
    :syntax => 'estiamte <CASENUM> <HOURS>',
    :description => 'Adds entered hours as estimate to specified case.',
    :is_public => true,
    :regex => /^estimate\s+(.+)\s+(.+)$/
  ) do |from, msg|
    #user = prepuser(from)
    estimate(from, msg)
    puts "#{from} estimated #{msg[1]} hours on case #{msg[0]}"
    "#{from} estimated #{msg[1]} hours on case #{msg[0]}"
end

The chat bot can be an excellent way to on-board new members of a DevOps team. Coding and implementing new features for the bots allows new team members the opportunity to interact with various systems at a deep level very quickly. The team members get a feel for how the infrastructure and team work together, and they do it on a relatively low-risk project. By building functionality onto a chat bot, team members learn the issue tracker, version control, chat server, and build server, to name just a few. Veteran team members immediately see how the new team member adds value to the team.

Finding ways to make communication more effective and actionable will go a long way to extending DevOps capabilities of a team.

Every two weeks, the SEI will publish a new blog post offering guidelines and practical advice to organizations seeking to adopt DevOps in practice. We welcome your feedback on this series, as well as suggestions for future content. Please leave feedback in the comments section below.

Additional Resources

To listen to the podcast, DevOps--Transform Development and Operations for Fast, Secure Deployments, featuring Gene Kim and Julia Allen, please visit http://url.sei.cmu.edu/js.

Get updates on our latest work.

Each week, our researchers write about the latest in software engineering, cybersecurity and artificial intelligence. Sign up to get the latest post sent to your inbox the day it's published.

Subscribe Get our RSS feed