Create morph types via MiniLcm API instead of seeding (alt to #2344)#2347
Create morph types via MiniLcm API instead of seeding (alt to #2344)#2347myieye wants to merge 6 commits into
Conversation
…t time of project creation
…n seeding. Modify CreateMorphTypeChange to handle creating the same morph type multiple times due to migrations.
Alternative to reintroducing unconditional morph-type seeding. Keeps the seeding decisions from this branch (seed only when SeedNewProjectData is set or via the migrate-when-missing path, not on download/import). Instead of throwing when MorphTypeSync encounters a morph type the target lacks, add a CreateMorphType API method so missing canonical morph types are created during import/sync. - IMiniLcmWriteApi.CreateMorphType: implemented by CrdtMiniLcmApi (via the existing idempotent CreateMorphTypeChange) and threaded through the wrappers; FwDataMiniLcmApi rejects it since FieldWorks morph types are a fixed inventory. - MorphTypeSync.Add now creates instead of throwing. - Tests depending on morph types seed them in MiniLcmApiFixture; the download test opts out to keep a pristine replica that fills in via sync. - MigrationTests: give each theory its own RegressionTestHelper (the migrate-once static cache collided across theories) and exclude the migration-seeded morph types (random commit id) from the exact snapshot comparison. The regenerated-snapshot test still covers them via guid scrubbing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
UI unit Tests 1 files 62 suites 26s ⏱️ Results for commit 0cdc4a0. |
C# FwHeadless Unit Tests48 tests 48 ✅ 16s ⏱️ Results for commit 0cdc4a0. |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
| { | ||
| throw new InvalidOperationException( | ||
| $"MorphTypes are predefined and cannot be created. Unexpected morph type: {currentMorphType.Kind} ({currentMorphType.Id}). This indicates a data inconsistency."); | ||
| await api.CreateMorphType(currentMorphType); |
There was a problem hiding this comment.
it seems like this is the only functional difference between this PR and #2344? The rest are fixing tests.
Alternative direction to #2344 for the morph-type seeding issue (#2343). Branches off the seeding rework on
bug/morph-type-seeding-2343(so it includes those commits) and takes the other path:Keeps the decision about where/when morph types are seeded — only when
SeedNewProjectDatais set, or via the migrate-when-missing path; not on project download or fwdata import.Instead of reintroducing unconditional seeding so
MorphTypeSyncdoesn't throw, this addsCreateMorphTypeto the MiniLcm write API and hasMorphTypeSync.Addcreate the morph type. Missing canonical morph types now arrive through the normal import/sync path.CrdtMiniLcmApi.CreateMorphTypeuses the existing (idempotent)CreateMorphTypeChange; the validation/normalization/notify wrappers delegate.FwDataMiniLcmApirejects creation since FieldWorks morph types are a fixed inventory.MiniLcmApiFixture;DownloadProjectTestsopts out to keep a pristine replica that fills in via sync.MigrationTests: each theory gets its ownRegressionTestHelper(the migrate-once static cache collided across theories); the migration-seeded morph types (random commit id) are excluded from the exact snapshot comparison and covered by the guid-scrubbed regenerated-snapshot test.Local validation:
LcmCrdt.Tests(465),MiniLcm.Tests(8336), andFwLiteProjectSync.Tests(169/170) green. The one local failure (ImportsANewlyCreatedWritingSystem) is a pre-existing Windows-vs-Linux font difference — fails identically on the base commit, passes on Linux CI.🤖 Generated with Claude Code