Repository navigation
Description
Motivation
- So admins can easily specify versions of pubs they want to make public.
- So contributors and editors can work on "draft" versions of pubs without worrying about them being made public.
- So developers can more easily query only from pubs meant to be public without resorting to confusing field/timestamp conventions.
- So all pub fields can be versioned in public-facing outputs, resolving a longstanding legacy issue of
Worth saying: there are probably multiple ways to accomplish the above, so feedback welcome. This is one idea we're looking for feedback on that comes from our prior history table work, some experience with Arcadia and Thomas's Legacy sprint, and Gabe's research into other CMSs. We like it because it balances accomplishing the goals while staying "PubPub-y" and not adding new features. But there's definitely an argument it could be more built into the core of how Pubs work.
Requirements
- A new action that allows users to create versions of pubs at a given time
- Allows users to either create a version of the current state, or specify a past date-time. If the latter, ideally a preview of the pub would appear.
- Allows users to specify a relationship field that the version will be created on. Required(?)
- Allows users to specify the type of pub created for the version (defaulting to the same type as the Pub that's having a version)
- Allows users to specify the stage where the version will be created (defaulting to no stage)
Acceptance Criteria
One Big Open Q:
This could either create a complete copy of the values of the pub from either the current version or the pub history table at the specified timestamp, or it could simply be a timestamp that could be used to assemble the contents of the version from the history table (or maybe there's some way to do an in-between where fields are from history until edited? idk!)
Pros for making actual copies of data:
- Does not add a new concept, really, and creates less dev work to resolve how to assemble views of pubs, API routes for fetching pub data from the history table, etc.
- Allows users to edit versions in place
- May reduce consistency issues, particularly with related fields and transcluded editor elements
Pros for timestamp:
- DRY / less db usage / etc.!
- Restricts version editing, which in some philosophical ways is good, since you want those to be relatively permanent
Activity
gabestein commentedon Jul 10, 2025
After some more conversations/use, really feels like this should be a first-class feature rather than an action, a la strapi. Basically, we should treat all pubs as drafts and: