Skip to content

Version action #1243

Open
Open

Description

@gabestein

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

  1. converted this from a draft issue on May 13, 2025
  2. gabestein commented on Jul 10, 2025

    @gabestein
    MemberAuthor

    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:

    • Add a publish/update button that, when clicked, creates a new version from the latest content of all fields, with a version message. Restricted to editor and admin members at all levels.
    • Store multiple versions of published pubs
    • Add an API route that retrieves only published pubs, with options to retrieve just the latest or all versions
    • Add an action that publishes/updates a pub from the current head, so they can be triggered by movement
    • Add a versions interface to pub details that allows versions to be deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions