Skip to content

feat: add lifter request handler

Note: this is largely just a starting point for getting ideas. It serves more as a baseline and an RFC than anything else.

The motivation for this is the number of requests the team gets to update details such as Instagram handles and dates of birth. These are relatively menial tasks, but as such should probably be handled automatically. This will allow lifters to self-serve more of the requests (they will still need to be reviewed by the team, but we can implement features like rolling up changes into a single PR for less context switching).

The suggestion in this case is a separate service (off the critical path of the website) that receives requests from the main server to perform various types of updates and raise pull requests for them. This service will maintain its own local version of the Git repository and do 2 main things to begin with:

  • Pull the latest changes when it receives GitLab webhook events, to ensure it stays up to date regularly
  • Receive requests containing a name alongside an Instagram handle and/or a date of birth and make the modifications locally before raising a pull request

This can be hosted separately to the main server if preferred, since the Git repository will likely use up a reasonable amount of storage and tasks like finding lifters to update may be CPU intensive. I have a Digital Ocean droplet in London that I'm happy to host this on for the time being while we experiment with it.

This change:

  • Adds the skeleton of a server using axum
  • Defines the incoming request types for GitLab webhooks and lifter requests
  • Defines some mock handlers for the two endpoints, simply logging out the data it receives
  • Adds a test to make sure we can deserialize the sample GitLab JSON

Merge request reports