SlackR25Bot - UW

This project was built for Classroom Technologies & Events at the University of Washington.

Background

The University has been updating their course scheduling from an onsite instance of R25 (unable to link because documentation doesn’t exist on the internet anymore) - a product from CollegeNET. Part of that process involved moving the scheduling database off-site. This allowed for a new integration to our Slack instance that could contact the R25 web service, now hosted on the CollegeNET servers, rather than secured locally on one of the UW’s servers.

Timeline

I came up with the idea for this project around April 18th, 2018, after talking to some colleagues about transitioning other internal tools that leveraged the local SQL database over to the R25 web service after the system transitioned to the cloud. Our department had recently been granted access to the web service, and I had spent the earlier part of the month translating Python scripts that had been digesting local SQL results to talking to the R25 web service and digesting XML instead. I spent about a week researching the possible integrations between Slack and external apps, and decided to use a Slack Slash Command for the integration’s implementation. The first version of the app was released on May 4th.

Implementation

Full details on the README

To quickly get up and running I started out with AWS Lambda and getting up to speed with what was necessary to get an AWS Lambda function working on the web. This led me to Serverless as a way of accelerating development and management of AWS resources.

The first version of the integration used only one Lambda function, but in order to echo commands back to the user in a channel and also respond later asynchronously, two Lambda functions are required. This is because each Lambda function can only reply to the request / trigger that started it once. If the Lambda function replies to Slack to acknowledge receipt of the command, then it won’t be able to reply later once the R25 data has been retrieved and processed. If the Lambda function waits until it’s gathered and processed all the R25 data, then it might miss the 3-second window to acknowledge the Slack command, and even if it does reply within the time frame, the confirmation of the command happens after the results are returned to Slack, making the confirmation show up not only late, but out of order. Thus two Lambda functions are required: one to parse and return acknowledge the command and another to query and process the R25 web service data.

Screenshots

Invoking

Invocation

Invocation

Help

Help

Help


project  aws  lambda  sns  slack  UW