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

Migrate Worldwide Organisations to Editionable Worldwide Organisations #8971

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

brucebolt
Copy link
Member

@brucebolt brucebolt commented Apr 18, 2024

This migrates all WorldwideOrganisation records (and their associations) to EditionableWorldwideOrganisation records.

The migration is done inside a transaction, with a check of various things (e.g. that the presented content remains the same) so the entire migration can be aborted if any part fails.

I've gone against our convention of not adding code comments, as I feel they are useful here in explaining what is actually being migrated in each step.

Trello card

@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 27 times, most recently from 156a0ff to bb6a510 Compare April 25, 2024 16:18
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 3 times, most recently from 7eb4b19 to cf7a8f7 Compare April 29, 2024 13:37
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 5 times, most recently from 7cda2b5 to df7811b Compare May 29, 2024 12:26
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 4 times, most recently from 963841d to 459ed87 Compare June 3, 2024 11:02
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 7 times, most recently from 42c5cd9 to ea2cf83 Compare June 12, 2024 12:09
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch 5 times, most recently from 2091608 to 2e252d8 Compare June 26, 2024 10:47
@brucebolt brucebolt marked this pull request as ready for review June 26, 2024 11:08
Copy link
Contributor

@callumknights callumknights left a comment

Choose a reason for hiding this comment

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

Think I'm as happy with this as I can reasonably be. Especially as this has run in integration with no issues 👍

Copy link
Contributor

@Gweaton Gweaton left a comment

Choose a reason for hiding this comment

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

Same as Callum - I've combed through as best I can and all seems to make sense, particularly after going through it together yesterday.

This migrates non-editionable worldwide organisations and all their
attributes to be editionable.

An integrity check of the migrated content (comparing Publishing API
presenter output) is carried out for all things that are migrated. If
any part of the integrity checks fail, the entire transaction will
rollback and the migration will fail.

Note 1: this migration is irreversible.

Note 2: there are some legacy worldwide organisations that were created
prior to some validations being put in place, therefore they have
invalid values. The migration is skipping validations where necessary
(using different strategies, as required) to ensure the values are
unchanged when migrating over. Users will be alerted to the invalid
content next time they edit the document.

Note 3: we cannot use a data migration as they do not have access to
presenters and helpers that are needed to perform the consistency check
before commiting the transaction.
@brucebolt brucebolt force-pushed the migration-worldwide-orgs branch from 2e252d8 to 752f9aa Compare July 1, 2024 06:16
@brucebolt brucebolt merged commit 3f6bb42 into main Jul 1, 2024
19 checks passed
@brucebolt brucebolt deleted the migration-worldwide-orgs branch July 1, 2024 07:45
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.

3 participants