Repository navigation
Add the change set aggregate and its state machine - #2453
Merged
Merged
Conversation
This was referenced Oct 18, 2026
pournasserian
added a commit
that referenced
this pull request
Oct 18, 2026
Closes #2454 ## What `SignInTests.cs` imports `FluentCMS.Core.Audit` for `InitiatorKinds` instead of `FluentCMS.Infrastructure.Audit`, which it used for nothing else. ## Why #2449 moved `InitiatorKinds` to `FluentCMS.Core.Audit`, and #2450 was written against the old namespace. Each passed CI alone, but together they break the build on `v2` and in every pull request into it, such as #2453. Build with warnings as errors and all unit and integration tests pass with the fix. ## Checklist - [x] Linked to an issue a maintainer has confirmed - [x] Targets `v2` - [x] Tests or docs updated where behaviour changed - [x] No tool-generated co-author trailers or footers
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 #2452
What
The first slice of F-CHG (#2418): the change set model in Core, with no storage yet.
FluentCMS.Core.ChangeSets):ChangeOperationis a create, update or delete on an item of kind entry, entity, media, schema or rule (CHG-01). It names the item by kind and id and the version it was based on. A create has no base version; an update or delete names version 1 or later.Createreports every problem at once. Schema is the one kind that exists today: an operation on a content type uses its id andContentType.Version.ChangeSethas an id, site id (SCH-07), rationale, sources, initiator, operations, state and rejection reason.Openchecks the site, the rationale and each source, and reports every problem at once, with the position of each blank source. Operations are added withAddOperationwhile the set is open, an item appears at most once, and entity and content operations can share a set (CHG-09).ChangeSetTransitionsis the explicit CHG-04 table.TransitionToandRejectreturnResult. A move the table does not define is refused, and the error names the states the set can move to, or says the state is final. A set leaves open only with at least one operation (CHG-01).Reject(reason)needs a non-blank reason and stores it.TransitionTo(Rejected)is refused withrejection_reason_missing, so there is no way to reject without one.Why
F-CHG is next after F-SCH in the build order (#2432), and this is the first slice the epic suggests. Storage waits for the next slice so it does not collide with the F-SCH storage slice, which owns migrations this round. That slice adds the application services, the stored set and its operations, migrations for both providers, and an audit event with the initiator for every transition (AUD-N1), because the audit log needs a unit of work.
The epic places CHG-08 in its last slice. The stored reason moves here because the table cannot define the rejected state without it; offering the reason as rule feedback stays with F-RUL.
Some choices worth a look:
ContentType.Version), not a version row id. The audit log'sPreviousVersionIdis aGuid, so the storage slice maps one to the other.ContentTypeis immutable because each version is its own row; a set is one row whose state moves.Tests
Unit tests in
tests/FluentCMS.Tests/ChangeSets:TransitionTo(Rejected)is refused; a rejection stores its trimmed reason.No new package and no new project reference. No model change, so no migration.
Checklist
v2