refactor: use Supabase for membership data instead of JSON - #158
Conversation
The database was updated to use the full committee names instead of their abbreviations.
A view for compiling executive information, aggregating executives' positions into an array, and aggregating executives by term into an object was created in the database.
ehrelevant
left a comment
There was a problem hiding this comment.
Sorry for the delay in the review. I don't really have any problems regarding the changes you made to add Supabase, so as far as that's concerned, nice job!
That said, as you may notice from the changes I made, I ended up doing a couple more refactors in the codebase to clean up the models, integrate type validation into the queries, and optimize the fetches and data processing by a slight bit. Specifically, I made the following changes:
- Added parsing and type validation for environment variables
- Revised Member-related and Exec-related valibot schemas to match the database queries
- Added a step for parsing the queried data using valibot
- Replaced most of the data processing in fetching executives with a database view (see
execs_by_termview added to the Database) - Replaced the abbreviated committee names with their full committee names
- Removed obsolete JSON files and attempted to remove most of the unnecessary code involved in JSON parsing for the member and exec data
- Updated the GitHub actions workflow to inject the required environment variables (I made them secrets, but this should not have any effect on the deployments either way)
Anyhow, @syncopascual could you kindly review my changes before we merge this in?
|
The changes look good to me! I'm wondering if there's a way for us to fix the GitHub Actions |
|
It's an issue with the secrets not being properly injected into the workflow. It normally shouldn't be hard to fix, but I may have made a mistake with the setup somewhere. I'll go make a few more attempts later before merging this in, but if it doesn't work, I'll just bypass the checks and merge this already, then I'll try fixing this directly. |
|
Alright, so the issue was that repository environment variables don't get passed to workflows in forks. I fixed this by separating the CI workflow from the build and deploy workflow, and only letting the former run in PRs. Anyhow, I'll be merging this in. Thank you very much for your contribution! |
Refactors the backend of the website to fetch membership and executive board data from Supabase instead of using the JSON-based implementation from previous iterations of the website.
Notes
Changes/fixes in progress
src/lib/components/cards/MemberCardTag.svelte2425B:Director for Engineering), which are now separated in the db (so no parsing is needed). For now, the implementation just matches the format of the JSON implementation but using data from the db instead.