DEV Community

Cover image for Hello, Rota! A Slackbot for Rotation Management
Kim Maida
Kim Maida

Posted on

Hello, Rota! A Slackbot for Rotation Management

Improving Remote Work Through Internal Tooling

Ever since I started working fully remote 4-ish years ago, I've been interested in the tools and automation that makes peoples' lives easier in tech remote work culture.

I'd like to give a shout-out to my former employer here: Auth0 pioneered my appreciation for automation tools in Slack and their customizability, flexibility, and power for making remote communication and workflows appear to just work, automagically.

In fact, prior to my arrival at the company, Auth0 had built a @concierge Slackbot that was so integrated into the company culture that I thought it was a core feature of Slack itself. It wasn't until I'd moved onto my next role that I realized @concierge had been built custom for Auth0 by Auth0 dev tools engineers. The Developer Tools team at Auth0 builds solutions and toolchains for the company, internally, to vastly improve productivity and workflows within the organization.

As I moved on to my next fully remote role at Gatsby, I found areas where I could — ostensibly — meaningfully contribute to the internal tooling ecosystem myself. And indeed, if I ever took on a role that was not Developer Relations in the future, an internal dev tools team is the first place I could see myself being very happy.

Rota: What is the Task at Hand?

At many tech companies, teams have a need for regularly staffed rotations. Rota exists to help manage rotations.

For example, perhaps a content team needs blog post drafts to be reviewed each week. It doesn't make sense for one person to be responsible for this all the time, so instead the responsibility is shared among team members with one person reviewing each week. Perhaps an OSS organization has issues that need triage or pull requests that need review; these tasks also rotate amongst team members.

Maybe someone outside the rotation needs to contact whoever is currently on-call for a rotated task, but they don't know at any given time who to reach out to. They could go look up names on a list or a calendar, or they could blast out a message to the entire Slack channel, or use a @usergroup that notifies everyone on the team, but this is unscalable and highly disruptive, especially as a company grows.

Rota In Action

Using Rota, we can set up new rotations, staff them, assign people to be on call, rotate the assignment, and send messages to whoever is currently staffing any given rotation.

You can create, name, and describe new rotations:

create a new rotation with a simple "new" command, a name, and a description of the rotation

You can then assign a "staff list" (usernames of everyone who should take part in the rotation, in assigning order):

add a staff list to an existing rotation

Then you can assign someone to the rotation either by username, or by assigning the next user on staff. When assigning the rotation, you can also pass an optional handoff message:

assign the next person in the rotation and send them a handoff message

The handoff message is then delivered to the new assignee in a direct message from @rota:

dm from Rota with handoff message

If anyone needs to contact the person who is on-call for any existing rotation, they can easily do so without needing to know who is currently assigned.

urgent message for the rotation

The assigned user then receives a DM from @rota notifying them of the message that needs their attention:

DM received from message for on-call rotation user

Rota Commands

At the time of this writing, Rota supports the following commands:

  • @rota new "[new-rotation-name]" [description] creates a new rotation; rotation names can contain only lowercase letters, numbers, and hyphens. Technically the description is optional, but everyone will benefit if you provide one.
  • @rota delete "[rotation]" deletes the rotation completely (use with caution!).
  • @rota "[rotation]" description [new description] updates the description for a rotation.
  • @rota "[rotation]" staff [@user1 @user2 @user3] adds staff to a rotation; a space-separated list of usernames is expected as a parameter with usernames in the order of desired rotation (rotations with a staff list can be assigned using assign next).
  • @rota "[rotation]" reset staff clears a rotation's staff list (use with caution!).
  • @rota "[rotation]" assign [@user] [optional handoff message] assigns someone to the rotation and, optionally, sends a DM to them with handoff information.
  • @rota "[rotation]" assign next [optional handoff message] assigns the next person in the staff list to a rotation and, optionally, sends a DM to them with handoff information.
  • @rota "[rotation]" unassign removes the current user assignment for a rotation.
  • @rota "[rotation]" who reports the name of a rotation's assigned user.
  • @rota "[rotation]" about displays the rotation's description and on-call user publicly, and displays the staff list only to the user who issued the commend (this is to prevent excessive notifications for everyone on staff).
  • @rota "[rotation]" [message] sends a direct message to the on-call user for the rotation, notifying them that your message needs attention.
  • @rota list displays a list of all currently known rotations.
  • @rota help shows how to use the bot.

Note: More commands may be added as development evolves and progresses over time. Visit the rota-slackbot GitHub repo for any updates.

Want to Use Rota?

Rota is free and open source. Its source code is available on GitHub at kmaida/rota-slackbot, along with instructions for setting the app up in your own Slack workspace. Rota's README lists the commands that Rota supports, as well as tips for using Rota with other Slack features (like reminders) and third party apps (like Gator, for scheduling messages). Rota was developed for internal team use at Gatsby, so it has been tested for that purpose and its continued development will focus on internal tooling benefits.

Important Technical Details

Because Rota is free, it is not distributed in a way that allows you to go to the Slack app directory and install it from the marketplace. It needs to have settings for your workspace, needs to have a database specific to your workspace, and also needs to be deployed to your hosting. Detailed instructions for all of the above are provided in the repo's README.

If I were to distribute Rota publicly, it would not be possible for the app to remain free. Public distribution would require provisioning data stores for each workspace it is installed in and would significantly increase hosting costs and maintenance overhead.

Maintenance and Contribution

I will be actively maintaining rota-slackbot at Gatsby during my tenure, as long as the bot is being actively used internally. If you'd like to aid in development work with Rota, please fork it on GitHub. To set expectations: because Rota is purpose-built for a specific organization, feature requests will be addressed if they have significant value add. Community contributions to the codebase are welcome.

Thank You!

I had a great time building Rota, and my hope is that it helps internally at my organization, but also that it helps others who share similar challenges in their teams and companies elsewhere. 🎉

Top comments (1)

Collapse
 
plainice profile image
Dan Willoughby

Thanks for the write up!

I've also seen this problem in multiple jobs I've had where there is a need to have an easy way to share team responsibilities. I'm excited to see that you've tackled the same problem, as it gives me hope others are looking for solutions to this.

At two of my previous jobs I made an in-house Slack bot similar to yours :). Just this year though, I decided to make a generic Slack bot (installable through the Slack app store) that anyone can use called Tellspin (tellspin.app). Tellspin automatically rotates users on a custom schedule (daily, weekly, etc) using built-in contact methods in Slack (e.g. @dev-on-call or @meeting-host).