Skip to content

Script to write a csv with partner info into biztech users, profiles, members, and register for specific event (blueprint 2026)#640

Open
elijahzhao24 wants to merge 3 commits intodevfrom
partner-profile-script
Open

Script to write a csv with partner info into biztech users, profiles, members, and register for specific event (blueprint 2026)#640
elijahzhao24 wants to merge 3 commits intodevfrom
partner-profile-script

Conversation

@elijahzhao24
Copy link
Member

@elijahzhao24 elijahzhao24 commented Jan 21, 2026

Pretty much the same flow as was previously in the code.

I did add an fallback method to call if the partner (email) is already registered as a user. Previously, we would just insta throw an error, but this new method should just fill in the missing pieces if their are any, and register for blueprint 2026.

I have not tested yet as i don't know how to run it.

The CSV reader is specially tailored to the columns in this the confirmed partner sheets:
https://docs.google.com/spreadsheets/d/1dlY2ESfsdsC7OFsnnz4ekoAEh60jXbtRUQKlvdEazAE/edit?gid=2142808681#gid=2142808681

@elijahzhao24 elijahzhao24 requested review from briannval and liuisaac and removed request for briannval January 21, 2026 06:35
// NOTE: ADJUSTED FOR BLUEPRINT 2026

// Fallback in case email already exists
async function upsertPartnerEntries(user) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a fallback here, just a PutCommand will handle creating new if it doesn't exist, or updating it in case it does

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we do
image
In the first pass, you have ConditionExpression: attribute_not_exists(id). I lowkey don't really know what that means but chatgpt is saying that means if user email already exists in any of those tables, DynamoDB throws ConditionalCheckFailedException

Copy link
Member Author

@elijahzhao24 elijahzhao24 Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will just automatically throw and without fallback, won't update partner profile or sign them up for blueprint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just remove the condition expression then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overwriting stuff may not be smart

} catch (error) {
if (error.name === "ConditionalCheckFailedException") {
console.log(`Entry already exists for ${user.email}`);
console.log(`Entry already exists for ${user.email}, attempting profile upsert`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, we should not need to have additional logic in the catch clause


const awsConfig = {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
accessKeyId: process.env.AWS_ACCESS_KEY_ID, // change this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be changed?

region: "us-west-2"
};

const destConfig = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it being used anywhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kevin added instructions in a file i just forgot to remove before commiting. Will remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants