Publish: write only changed items (don't re-version unchanged pages, assets, theme or asides) #5

Open
opened 2026-10-10 18:23:09 +00:00 by rhelwig · 3 comments
Owner

Every release re-versions every page, asset, theme and aside, even when nothing changed. validateReleaseRequest requires every record to share the release publishBatchId.

Seen on 2026-10-10: publishing one new post plus a small theme/aside change took about 20 writes. All 11 existing pages had an identical bodyHash to their previous Platform version. Only id, createdAt, previousVersionId, publishBatchId and sequence differed. Only-changed releases would need about 7 writes.

Wanted:

  • Releases can reference unchanged prior version IDs instead of creating new versions.
  • Only changed items are written.
  • This touches Admin review prep, the Auth checks (validateReleaseRequest / inspection) and Stub resolution.

Cuts fees, time, and the number of steps that can fail. It matters most for large sites.

Follow-up notes: https://git.ronhelwig.com/rhelwig/DecentSite/src/branch/main/docs/PUBLISH-FOLLOWUPS-2026-10-10.md

Every release re-versions every page, asset, theme and aside, even when nothing changed. `validateReleaseRequest` requires every record to share the release `publishBatchId`. **Seen on 2026-10-10:** publishing one new post plus a small theme/aside change took about 20 writes. All 11 existing pages had an identical `bodyHash` to their previous Platform version. Only id, createdAt, previousVersionId, publishBatchId and sequence differed. Only-changed releases would need about 7 writes. **Wanted:** - Releases can reference unchanged prior version IDs instead of creating new versions. - Only changed items are written. - This touches Admin review prep, the Auth checks (`validateReleaseRequest` / inspection) and Stub resolution. Cuts fees, time, and the number of steps that can fail. It matters most for large sites. Follow-up notes: https://git.ronhelwig.com/rhelwig/DecentSite/src/branch/main/docs/PUBLISH-FOLLOWUPS-2026-10-10.md
Author
Owner

Design is written up (doc only, no code) in PR #10: docs/SPECS.md § Only-changed releases (planned).

  • Unchanged version records from the parent release are reused verbatim, so they keep their original batch.
  • inspectReleaseRequest checks that each reused record is in the parent manifest and already exists on Platform.
  • Requests that reuse records use release-request version: 2, so older Auth builds fail closed.
  • No schema change.

Expected for ronhelwig.com release 2: about 20 writes down to about 7. Implementation has not started.

Design is written up (doc only, no code) in PR #10: `docs/SPECS.md` § *Only-changed releases (planned)*. - Unchanged version records from the parent release are reused verbatim, so they keep their original batch. - `inspectReleaseRequest` checks that each reused record is in the parent manifest and already exists on Platform. - Requests that reuse records use release-request `version: 2`, so older Auth builds fail closed. - No schema change. Expected for ronhelwig.com release 2: about 20 writes down to about 7. Implementation has not started.
Author
Owner

First implementation PR: #11 (branch feat/only-changed-versioning, aaeec1b). It adds release-request version 2, has Admin reuse unchanged versions (opt-in with DECENT_RELEASE_REUSE_UNCHANGED=1, which needs Auth 0.1.20+), and makes validation/inspection fail closed on bad reuse. Tests: 176/176 pass.

Still to do after #11: an Admin setting instead of the environment variable, "unchanged (already on Platform)" wording in Auth plus a count on the fee screen, and rollback by reference. Once Auth 0.1.20 is built and installed, we'll measure the write-count saving with the #6 timing logs.

First implementation PR: #11 (branch feat/only-changed-versioning, aaeec1b). It adds release-request version 2, has Admin reuse unchanged versions (opt-in with DECENT_RELEASE_REUSE_UNCHANGED=1, which needs Auth 0.1.20+), and makes validation/inspection fail closed on bad reuse. Tests: 176/176 pass. Still to do after #11: an Admin setting instead of the environment variable, "unchanged (already on Platform)" wording in Auth plus a count on the fee screen, and rollback by reference. Once Auth 0.1.20 is built and installed, we'll measure the write-count saving with the #6 timing logs.
Author
Owner

Status: the first increment of only-changed releases is on main (PR #11, merge 745c57ed08).

  • With the flag on, Admin reuses unchanged content, asset, theme and aside versions. It only issues a version-2 release request when something is actually reused, so first releases keep working on older Auth.
  • Auth 0.1.20+ is needed to approve a version-2 (reuse) request. The tablet is on 0.1.20 now. The Pixel is still on an older build and will not accept reuse requests until it's updated.
  • Opt-in is enabled on the laptop Admin through a systemd drop-in, ~/.config/systemd/user/decent-site-admin.service.d/reuse-unchanged.conf:
    [Service]
    Environment=DECENT_RELEASE_REUSE_UNCHANGED=1
    
    then systemctl --user daemon-reload && systemctl --user restart decent-site-admin. To disable it, delete that file, reload and restart. Putting the same line in ~/.config/decent-site/admin.env (the unit's EnvironmentFile) also works.

I'm leaving this open until a real publish is measured: the write count and fee should drop to just the changed items. Timing data from #6 should show it.

Status: the first increment of only-changed releases is on `main` (PR #11, merge 745c57ed0850aeee60d3cb890233450c4d137bae). - With the flag on, Admin reuses unchanged content, asset, theme and aside versions. It only issues a version-2 release request when something is actually reused, so first releases keep working on older Auth. - Auth **0.1.20+** is needed to approve a version-2 (reuse) request. The tablet is on 0.1.20 now. The Pixel is still on an older build and will not accept reuse requests until it's updated. - **Opt-in is enabled on the laptop Admin** through a systemd drop-in, `~/.config/systemd/user/decent-site-admin.service.d/reuse-unchanged.conf`: ``` [Service] Environment=DECENT_RELEASE_REUSE_UNCHANGED=1 ``` then `systemctl --user daemon-reload && systemctl --user restart decent-site-admin`. To disable it, delete that file, reload and restart. Putting the same line in `~/.config/decent-site/admin.env` (the unit's EnvironmentFile) also works. I'm leaving this open until a real publish is measured: the write count and fee should drop to just the changed items. Timing data from #6 should show it.
Sign in to join this conversation.
No labels
feature request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rhelwig/DecentSite#5
No description provided.