tl-its-umich-edu / remote-office-hours-queue

Virtual queuing tool supporting Zoom video conferencing and/or in person meetings.
https://officehours.it.umich.edu/
Apache License 2.0
12 stars 28 forks source link

Resolve #466: Switch Zoom code over to use the package #481

Closed peijli closed 6 months ago

peijli commented 7 months ago

This pull request refactors the officehours_api.backends.zoom package and replaces custom implementation of Zoom API calls with functions from the PyZoom package, version 1.0.8. The requirements.txt file was updated to reflect this additional package.

We made substantial modifications for the _spend_authorization_code, _get_access_token, _create_meeting and _get_me functions, while maintaining the same public functions for ease of interface with existing modules of the office hour API. We also provided brief documentation with regards to our code changes in the form of comments and docstrings in the source code file.

Local Testing

We performed acceptance testing to ensure that the Zoom-related functionalities of this site stays identical from the perspective of the end user. During testing on a local environment, we modified the beginning of docker-compose.yml to reflect dummy environmental variables and a mocking instance of a Zoom application that we created.

---
version: '3.4'

services:

  web:
    build:
      context: src
    environment:
      - ALLOWED_HOSTS=*
      - DEBUG=True
      - DATABASE_URL=postgresql://admin:admin_pw@database/admin
      - FEEDBACK_EMAIL=office-hours-devs@umich.edu
      - ZOOM_CLIENT_ID=[DUMMY_ID]
      - ZOOM_CLIENT_SECRET=[DUMMY_SECRET]
      - TWILIO_ACCOUNT_SID=aaa
      - TWILIO_AUTH_TOKEN=bbb
      - TWILIO_MESSAGING_SERVICE_SID=ccc

We also added the command python -m pip install --no-cache-dir --upgrade pyzoom to the src/docker-entrypoint.sh script since our local Docker instances weren't able to automatically install and detect PyZoom otherwise.