waterloo-rocketry / minerva-rewrite

The rewrite of Waterloo Rocketry's custom slackbot
MIT License
1 stars 2 forks source link

Implement Periodic Event Checking #59

Closed QuantumManiac closed 10 months ago

QuantumManiac commented 10 months ago

Description

Implemented functionality to allow for periodic checking for upcoming calendar events, which can then be used to generate event reminder messages in Slack.

The current implementation checks for events that are 5 minutes and 6 hours away, as those are the times that old minerva uses to send its two event reminders per message. The function will detect that an event is to be reminded for as long as it's within +/- 2.5 minutes of the target time until meeting.

I have also built up the foundations for actually posting the meeting reminders, as it was necessary to write up functionality for reviewer testing.

Apologies, the diff on this is a slight mess as I added a linting command (yarn lint) midway through development and there were a lot of unlinted files that it linted.

This PR closes #18.

Developer Testing

Testing done:

Reviewer Testing

Testing this functionality is a bit tricky as the reminder check only executes every five minutes.

  1. Create a Google Calendar event on the Dev Google Calendar, making sure to add all the necessary metadata (minimally, a channel name - ensure that channel actually exists in the dev slack)
  2. Move the event to a suitable start time to test the functionality with (e.g. moving the event to +5 mins or +6 hours from the next five-minute mark is good to test those meeting reminders)
  3. Wait for the five-minute mark so the function executes
  4. Ensure that a message was posted to a channel in the format of I should be generating a reminder for Software at Fri Dec 29 2023 17:10:00 GMT-0500 (Eastern Standard Time) with reminder type SIX_HOURS!

If the message was not posted, ensure that minerva is actually in the channel.


This change is Reviewable