-
Notifications
You must be signed in to change notification settings - Fork 2
New Alumni collection with upload script #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
|
[diff-counting] Significant lines: 181. |
c1914c9 to
96e096d
Compare
| try { | ||
| return validateAlumni(alumniRow); | ||
| } catch (validationError: unknown) { | ||
| throw new Error(`Row ${index + 2}: ${(validationError as Error).message}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, Adrienne! I think you do an awesome job handling edge cases and different formatting within the actual CSV. One quick comment - when you throw errors like these, it might be really useful for debugging purposes if you also included what field caused this error (name, email, etc). Otherwise, looks good!
| const fullPath = join(OUTPUT_FOLDER, image.fileName); | ||
| return downloadAndProcessImage(image.url, fullPath) | ||
| .then(() => console.log(`Processing complete for ${image.fileName}`)) | ||
| .then(() => console.log(`Processing complete door ${image.fileName}`)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change, I just think door should be for.
| about?: string; | ||
| } | ||
|
|
||
| const parseCSVRow = (row: string): string[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, Adrienne! I really like the clean type definitions. For the parseCSVRow function , I think it's a good start for handling CSV parsing. Since we're the ones creating the data, I don't think it's an issue now, but for some edge cases like nested quotes or line breaks inside quoted fields, it might not work as well. Otherwise, looks good!
Summary
This PR adds a new alumni collection with a CSV upload script for the development of the alumni database
upload-alumni-data-db.tsscript to upload alumni data from a CSV into the databasepackage.jsonLinear
move alumni to new collection
Test Plan
To test the script:
npm run upload-alumniin backendNotes