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

Closed
ikesau opened this issue Jan 14, 2025 · 2 comments
Closed

Create a Gdoc content migration workflow #4451

ikesau opened this issue Jan 14, 2025 · 2 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
}
@danyx23
Copy link
Contributor

danyx23 commented Feb 4, 2025

It would be worth checking out if anyone has solved this problem before (there are a few high profile users of ArchieML in Google Docs)

@danyx23
Copy link
Contributor

danyx23 commented Feb 4, 2025

We chatted about three different ways of tackling this:

  • extending our full ArchieML pipeline all the way back to GDrive AST and patch the document so as not to delete :skip sections
  • we could have explicit schema versions as part of the document metadata and have humans manually upgrade those (according to a guide). There could also be an admin UI that makes this part easier.
  • we could write migrations that operate on Gdrive AST -> Gdrive AST functions that just delete/add/modify the properties that change

@danyx23 danyx23 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2025
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

2 participants