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

Create a Gdoc content migration workflow #4451

Open
ikesau opened this issue Jan 14, 2025 · 0 comments
Open

Create a Gdoc content migration workflow #4451

ikesau opened this issue Jan 14, 2025 · 0 comments

Comments

@ikesau
Copy link
Member

ikesau commented Jan 14, 2025

Core problem

We currently have no way to programmatically update the content of google documents, if ever we want to migrate an archie component to have a different shape.

Proposed solution

Create some sort of migration tooling that:

  1. Takes a migration specification
  2. Iterates through all published gdocs
  3. Operates on them (probably as raw blocks)
  4. Converts them back to archie
  5. Replaces the google document content with the new archie
  6. Republishes the post

Possible usecases

Technical considerations

If we operate on raw blocks to update the shape of a component, we'll potentially have to create a "version 1 backup" of the TS interface

e.g.

import { RawBlockImage } from "@ourworldindata/types"

type OldRawBlockImage = {
  // the values this block used to have, before the migration
}

function migrateImage(block: OldRawBlockImage): RawBlockImage {
  // stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant