HackIllinois / api

The Official API supporting HackIllinois
https://api.hackillinois.org
Other
23 stars 51 forks source link

Add food wave util #543

Closed Timothy-Gonzalez closed 1 year ago

Timothy-Gonzalez commented 1 year ago

Blocked by #544, as it prevents PUT /profile/ from working

Timothy-Gonzalez commented 1 year ago

Need to use GET then PUT it seems.

Timothy-Gonzalez commented 1 year ago

This should be good!

Note that to test this locally, you must first create a bunch of users, register them all, apply decisions to them all, finalize those decisions, rsvp them, and then create their profiles. It will be required to use the HackIllinois-Impersonate header, and you may get 500s do to not being able to add roles (since they are fake users), but it will keep working.

Timothy-Gonzalez commented 1 year ago

Worked on prod on 309/310 users, took 11m23.242s. In theory, this means it will always work and is perfectly coded.

Okay, so the 310th user didn't have a profile, because their first name and last name were not set on user creation, because the mail service rate limited, so creation of a profile error education, because it doesn't allow empty names, but user does.

TL;DR; My code was working fine and helped find the poor user that RSVPd during the mail service outage

Timothy-Gonzalez commented 1 year ago

One more thing Jared forgot to mention: The script needs to assign each user that is assigned to a food wave to a notification topic (e.g. "FoodWave1", "FoodWave2"). The topics FoodWave1 and FoodWave2 already on prod, so all that needs to be done is assigning each appropriate user.

Timothy-Gonzalez commented 1 year ago

Success on 727/727 users, only took 15:43.59. Going to add a little message and some quality things.