-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add confluence to parents migration script #9287
Conversation
return [...parents, ...parents.map(convertConfluenceOldIdToNewId)]; | ||
} | ||
// checking that we got a mix of old and new IDs, with the old ones matching the new ones | ||
for (const parent of parents) { |
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.
you're just checking the validity of the code above here no?
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.
i'm checking the validity of the new code in connectors that upserts the parents
confluence: { | ||
transformer: (nodeId, parents) => { | ||
// case where we got old IDs exclusively: we add the new IDs to them | ||
if ( |
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.
In that case why not just do a ...parents, ...parents.map() and then uniq (so that it can be run mulitple times on the same doc?)
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.
if there is some kind of inconsistency with what we upsert we won't know about it no?
ofc if i run the script and see assert errors at the first line i'll just change that to what you suggest :p
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.
fyi changed all of that to make it idempotent: I turn all old IDs into new ones and then do a unique
# Conflicts: # front/migrations/20241211_parents_migrator.ts
confluence: { | ||
transformer: (nodeId, parents) => { | ||
return [ | ||
...new Set([...parents, ...parents.map(convertConfluenceOldIdToNewId)]), |
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.
We want the mapped parents first so that parents[0] = nodeId right?
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.
right
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.
fixed
Description
Risk
Deploy Plan
n/a