Kyoso-Team / kyoso

A web application that takes osu! tournaments beyonds spreadsheets.
http://kyoso.sh
GNU Affero General Public License v3.0
1 stars 1 forks source link

Create testers procedures #67

Open L-Mario564 opened 3 weeks ago

L-Mario564 commented 3 weeks ago

Currently, we're using an environment variable that is an array of osu! user IDs to verify who's allowed to test. At first, it was a fairly very easy and straight forward thing to manage, but as the array grows with more testers, it's hard to keep track who's ID is who (in case they need to be removed) and adding someone means re-deploying the test build just for that.

Instead of using an environment variable, we'll store the testers in the Redis DB, not in the Postgres DB because this is only relevant in test builds and not used in prod or dev (although dev is sort of relevant so we can test this).

For each procedure:

Add tester

Using Redis, if the testers key isn't define, create it as an empty array. Append the following object:

{
  osuUserId: /* From input */,
  username: undefined
}

Input: osuUserId.

Conditions

Remove tester

Remove the array element that contains the user with the inputted osu! user ID.

Input: osuUserId.

Conditions

Misc. tasks

export interface Tester {
  osuUserId: number;
  username?: string;
}