Repository navigation
Give entries the states change sets move them through - #2522
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2521
What
The next F-CNT (#2416) slice: entries have the CNT-01 states (draft, in review, published, reverted and archived), and only change sets move them. Builds on entry operations in change sets (#2519).
FluentCMS.Core.Content):EntryState, carried byEntryandEntrySummary.EntryStates.Reviewlists the change set states that hold an item in review (checks running, checks failed, awaiting review, approved).EntryStates.AfterPublishsays what a publish leaves an entry as: published for a create or update, archived for a delete, and reverted for any item of a revert.GetAsyncandListAsyncshow an entry as in review while any set in a review state holds an operation on it. The query is one subquery onChangeSetOperationsandChangeSets, so two sets reviewing one entry keep it in review until neither does, and a rejected or reopened set gives it back its earlier state with nothing to undo.Entries.Stateand written only by publish, in the same conditional update that moves the published version. A new entry starts as a draft.IEntryDirectoryhas no way to set a state, and writes, soft deletes and restores leave it alone.Statedefaults toDraft, entries that already have a published version becomePublished, and a check constraint allows only the four stored states.Why
CNT-01 wants states that only governance moves. Storing only what publish decides, and reading in review from the sets themselves, means no write path can change a state, and there is no remembered "state before review" to get wrong when sets overlap.
Choices worth a look:
LatestVersionagainstPublishedVersion.Tests
Unit (Core):
Restoretakes the state.Integration, each on SQLite and PostgreSQL:
GetAsyncandListAsyncagree at every step.Downworks on both providers.The full suite ran locally against a
postgres:17container as well as SQLite. No new package and no new project reference.Checklist
v2