Skip to content
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

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

aubin-tchoi
Copy link
Contributor

Description

Risk

  • Quite high, should def be run in dev to check that agent still work.

Deploy Plan

n/a

@aubin-tchoi aubin-tchoi requested a review from spolu December 11, 2024 15:06
@aubin-tchoi aubin-tchoi self-assigned this Dec 11, 2024
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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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 (
Copy link
Contributor

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?)

Copy link
Contributor Author

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

Copy link
Contributor Author

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)]),
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@aubin-tchoi aubin-tchoi merged commit 1daa880 into main Dec 11, 2024
3 checks passed
@aubin-tchoi aubin-tchoi deleted the migrate-confluence-parents branch December 11, 2024 22:09
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