Content upgrade steps: a site control panel to list and run content migrations
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- backend, developer-experience, full-stack
Research direction
Start with the content step declaration and runner proposal in this issue, then read plone/repoplone#96 and plone/aurora#379 for the existing upgrade format and migration case. The issue leaves the endpoint location, runtime step registration, and deployment behavior open, and spans backend, build, UI, and CLI work. Done means content steps can be listed and safely run with dry runs, progress, and resume.
Written by the indexing model from the issue text.
Description
Context
plone/repoplone#96 proposes upgrade steps declared in each package's upgrades/upgrades.json. Repoplone runs only the "kind": "repo" steps, which change files in a repository. This issue covers the other kind, "kind": "content": migrations of content in a running site.
The first real case is plone/aurora#379, which renames blocks.__somersault__ to blocks.main and the @type to plate. Its plan has the same rename written twice: in JS, in Aurora's migrateContent (renamed when content is read), and in Python, in a backend upgrade step (renaming everything at once). The Plate value format belongs to the frontend and will keep changing, so the frontend should be able to ship the bulk migration too, reusing the same transform.
How content steps differ from repo steps
repo steps |
content steps |
|
|---|---|---|
| Changes | Files in the repository | Content in a running site |
| Runs once per | Repository | Site (dev, staging, production) |
| Ledger | .plone/upgrades.json, committed |
Stored in the site |
| Runner | repoplone upgrade |
A site control panel, plus a Node CLI |
| Undo | git |
Only from a backup |
Proposal
Declaration. Content steps use the same upgrades.json and fields (id, version, docs, requires) as repo steps. The step points to a module that exports a catalog query and a pure transform:
{
"id": "aurora/1.0.0/somersault-to-main",
"kind": "content",
"version": "1.0.0",
"title": "Rename the __somersault__ region to main",
"script": "./1.0.0/somersault-to-main.mjs"
}
export const query = { object_provides: 'plone.restapi.behaviors.IBlocks' };
// The same function migrateContent uses when content is read.
// Returns the new blocks, or null when there is nothing to change.
export function transform(blocks) {
if (!blocks.__somersault__) return null;
const { __somersault__, ...rest } = blocks;
return { ...rest, main: { ...__somersault__, '@type': 'plate' } };
}
Backend endpoint. Plain PATCH requests can't do this safely. They update modified, can add a version to each page's history, cost one round trip per object, and leave a site half migrated if a run fails. We need a small endpoint, for example @upgrade-content in plone.restapi, that:
- accepts batches of
{uid, blocks}and writes them without touchingmodifiedor the history; - reindexes what changed (
SearchableText, link integrity); - stores the per-site ledger (applied step ids, plus progress for a running step);
- takes a lock, so only one runner works on a site at a time;
- requires the Manager role.
This could ship in the same plone.restapi release that adds the plate registrations from #379.
Runner. Node runs the transforms, and the backend does the writes:
- A control panel in Aurora, like Plone's Add-ons/Upgrades panel. It lists pending content steps (with docs links) and later runs them. Each run starts with a dry run that shows how many objects would change and a sample diff.
- Runs are background jobs with their progress stored in the site, not long web requests. They resume from the last finished batch after a failure.
- A Node CLI (
aurora upgrade-content --site …) for CI and for sites without the UI.
Making steps available at runtime. Production images are often pruned and the server code is bundled, so a running server may not have node_modules/<pkg>/upgrades/. The build needs to collect content steps and their transforms into the server bundle, or content steps need to be registered through @plone/registry and point back to their ids in upgrades.json.
Phases
- Declare content steps in
upgrades.json, and make repoplone skip them (#96). - Add the plone.restapi endpoint and the ledger stored in the site.
- Add the control panel to list pending steps (read-only).
- Run steps from the control panel and the CLI, with dry run, progress and resume.
- Move #379's bulk rename to a content step. The Python step then becomes a thin wrapper, or goes away.
Open questions
- Does the endpoint belong in plone.restapi, plone.volto, or a new Aurora backend package?
- Which approach makes steps available at runtime: collect them into the bundle at build time, or register them through
@plone/registry? - Should content steps run automatically when a new version is deployed, or always need someone to start them?
- Should a step also be able to change versions in the history (#379 relies on the rename when content is read for those)?
Assisted-by: Claude Opus 5.5
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 9
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/aurora
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yOpen01 type: bug 99 tag: UX Accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
01 type: bug 99 tag: UX Accessibility
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
Similar issues
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug CRIT-3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
NASA-AMMOS/anms#426 ·