Salient Information Delivery

Right place, right time

Dane Hillard
ITHAKA Tech
3 min readJun 20, 2016

--

This story originally outlined how we enabled better deployment coordination via information delivered in HipChat. Now, we use Slack; Atlassian recently chose to partner with Slack for real-time messaging. The article is updated to reflect how our Slack messages look!

We use Slack to communicate between individuals and teams.

In the spirit of better ChatOps, we surface information about our deployments within Slack since we’re already using it all the time.

Historically, the notifications from our deployment platform, Sagoku, comprised nearly the minimal amount of information we could muster:

“Something happened.”

Slack messages can easily be sent to rooms by creating a Slack webhook, which results in a URL something like this:

The hook should be generated per-use case and named something indicative of what its notifications are all about, i.e. “Deployments.” We were sending a short JSON payload to this endpoint to get our notifications:

This achieved the goal of alerting us when a deployment succeeded, but after some time we noticed the same follow-up questions recurring pretty often.

  • Who deployed this?
  • What was the reason for this deployment?

The workflow to answer these questions was something like this:

  1. Browse to the Sagoku deployment interface
  2. Click “Deployments”
  3. Find the most recent deployment of very-important-service, noting the team and name of the person who initiated the deployment
  4. Click the deployment’s permalink
  5. Note the git hash
  6. Browse to GitHub and search for that git hash in the commit list on various pull requests until found
  7. (╯°□°)╯︵ ┻━┻

We needed a better way.

Slack has fancy tools for creating clean informative blocks in messages. Leveraging these along with some key pieces of information from our deployment platform allowed us to surface the information we’d been craving quickly.

Let’s step through this one.

  • “New deployment” is clickable and points to the deployment’s permalink in the Sagoku interface
  • The what, where, and who are called out very explicitly
  • The why, i.e. the changes to the code that necessitated this deployment, are linked to as directly as possible, pointing to a search on GitHub for pull requests containing the git hash of the deployment
  • The status of the deployment, either “Successful” or “Failed” (and color-coded!)

A few key things had to happen to make this possible. First, it took some time to understand the Slack message format. Fortunately they have a tool for building messages that can then be templated. Then came the realization that we could build a GitHub search query to show pull requests containing a specific commit. Finally, for each deployment, we needed the following information available to send in our JSON to Slack:

  • The deployment ID
  • The name of the application that was deployed
  • The environment in which the application was deployed
  • The user who created the deployment
  • The status of the deployment
  • The HEAD git commit hash

Once the data we needed was made available in Sagoku, it was just a matter of plugging it all into the JSON payload in Slack’s message format:

This had the additional benefit of creating a copy-and-paste-able payload we could use across many of our applications without having to manually update fields per application.

We’ve increased our at-a-glance information in a digestible way which has saved us time and brain power — especially as we grow and have to coordinate across more teams! If you’d like to learn more about what you can do with Slack, make sure to check out their API documentation.

Have a great Slack or general ChatOps tip? Let us know below! Meanwhile, if you are looking for a place that is always trying to work smarter, make sure to check out our open positions.

--

--

Dane Hillard
ITHAKA Tech

Publishing Python Packages 🐍📦 ⬆️ Practices of the Python Pro 🐍📘 Technical architect at ITHAKA