Skip to content

feat(cms): add revision history, rollback, and publishAt timestamps - #351

Merged
olliethedev merged 4 commits into
mainfrom
feat/issue-339-after-v6
Nov 6, 2026
Merged

olliethedev merged 4 commits into
mainfrom
feat/issue-339-after-v6

Conversation

@olliethedev

@olliethedev olliethedev commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #339.

CMS create/update/restore transaction
  validate and authorize the record and relation targets
  write the active item, including optional publishAt
  append an immutable version snapshot

Entry editor
  optional local-time publication timestamp
  revision drawer → inspect snapshot → confirm restore

Rollback reuses the normal update lifecycle, retains ownership and history, and restores slug, fields, relations and schedule. Existing (contentTypeId, slug) reads and dependent-plugin data payloads stay intact. publishAt is scheduling metadata; applications retain publishing and visibility policy.

Evidence

  • Before: CMS entries had no saved revision inventory or schedule column.
    After: 161 CMS tests passed on the initial implementation. After review corrections, 73 focused CMS tests, 13 School tests, 9 Job Board tests and 12 Core endpoint-inventory tests pass. Coverage includes populated-SQLite migration, revision lifecycle, dependent course/job writes, denied access, slug conflicts, relations, pagination and unchanged timestamp precision. All three touched packages typecheck and build.
  • Before: Editors could not inspect or roll back previous values.
    After: Two Chromium E2E scenarios pass again after the corrections against the generated Next.js consumer: save, inspect, cancel/confirm restore, schedule restoration/clearing, failed-history retry, older-page loading, mobile layout and Escape/focus return.
  • Captioned demo, all screenshots and verification. Seven recorded beats passed; all seven frames plus mobile light/dark screenshots inspected. This durable archive requires the owner's login and LAN/private Tailscale access; it is not a public GitHub upload.
  • Direct media: Revision drawer screenshot, mobile screenshot, MP4 walkthrough. Same owner-login access requirement.
  • Registry regenerated from the merged stable-v6 base; docs production build, focused Biome and whitespace checks pass. Root full-suite checks intentionally left to CI, per assignment.

Merge Danger

Door: two-way

Apply the additive database migration before serving this plugin: new contentRevision model with unique item/version keys and a nullable contentItem.publishAt. Existing history starts at the next write; past revisions cannot be reconstructed. Rolling application code back can retain the additive schema.

Blast Radius: CMS

Content writes now append a snapshot in their transaction, including School course creation/edit/archival and automatic Job Board archival. Unedited editor schedules retain seconds and milliseconds. Old revisions incompatible with the current content schema or relation permissions fail without replacing the active entry.

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
better-stack-docs Ready Ready Preview Nov 6, 2026 3:27am UTC
better-stack-playground Ready Ready Preview Nov 6, 2026 3:27am UTC

Request Review

@olliethedev

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T03:30:06.134646Z bc7f2ec Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee7b8bac3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size

9 of 194 bundles changed.

Module Gzip base → PR Gzip change Minified change
@btst/plugin-cms/client/components 259231 → 261093 B +1862 B (+0.7%) +7663 B (+0.8%)
@btst/plugin-cms/client 261785 → 263606 B +1821 B (+0.7%) +7672 B (+0.8%)
@btst/plugin-cms/api 114140 → 115014 B +874 B (+0.8%) +4196 B (+0.8%)
@btst/plugin-school/api 106554 → 106747 B +193 B (+0.2%) +552 B (+0.1%)
@btst/plugin-ecommerce/api 109164 → 109334 B +170 B (+0.2%) +542 B (+0.1%)
@btst/plugin-job-board/api 102079 → 102245 B +166 B (+0.2%) +611 B (+0.1%)
@btst/plugin-cms/client/hooks 114330 → 114480 B +150 B (+0.1%) +816 B (+0.2%)
@btst/plugin-cms/query-keys 96124 → 96203 B +79 B (+0.1%) +519 B (+0.1%)
@btst/plugin-ui-builder/client/hooks 113577 → 113578 B +1 B (+0.0%) 0 B (0.0%)

10ef1f7 → bc7f2ec. Standalone costs; rows overlap. Moved paths appear as new/removed entries, not application savings.

Measured 22 packed archives separately; full report includes their compressed bytes without installed dependencies.

Full report and measurements

@olliethedev

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: bc7f2ec022

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@olliethedev
olliethedev merged commit df2f825 into main Nov 6, 2026
66 of 69 checks passed

This branch was successfully deployed

2 active deployments
Preview – better-stack-docs — bc7f2ec0 Deployed Nov 6, 2026 by vercel[bot]
Preview – better-stack-playground — bc7f2ec0 Deployed Nov 6, 2026 by vercel[bot]
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.

CMS: content revision history, rollback drawer, and scheduled publishAt timestamps

1 participant