Skip to content

Remove CRDT morph-type migrate seeding - #2483

Open
hahn-kev-bot wants to merge 1 commit into
developfrom
tech-debt/morph-type-api-fallback
Open

Remove CRDT morph-type migrate seeding#2483
hahn-kev-bot wants to merge 1 commit into
developfrom
tech-debt/morph-type-api-fallback

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Closes #2350

I also decided that we could pretty easily shim in the canonical morph types in the JsInvokable api if there are none in the project as a sort of safety net.


AI summary

Summary

  • Remove the MigrateDb path that seeded canonical morph types when a CRDT project had none
  • Delete unused PreDefinedData; seed morph types explicitly in MiniLcmApiFixture via one AddChanges batch
  • As a UI stopgap, MiniLcmJsInvokable.GetMorphTypes() returns canonical morph-type copies when the underlying API returns none
  • Update seeding/regression tests for the new blank-project behavior

Test plan

  • dotnet test backend/FwLite/FwLiteShared.Tests --filter FullyQualifiedName~MiniLcmJsInvokableMorphTypeFallback
  • dotnet test backend/FwLite/LcmCrdt.Tests --filter FullyQualifiedName~MorphType
  • dotnet test backend/FwLite/LcmCrdt.Tests --filter "FullyQualifiedName~DownloadProjectTests|FullyQualifiedName~OpenProjectTests|FullyQualifiedName~MigrationTests.GetEntries"
  • Spot-check viewer on a blank CRDT project still shows morph types in the UI

Closes #2350.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Morph-type seeding was removed from database migration paths, test fixtures now seed or validate project states explicitly, and GetMorphTypes() supplies cloned canonical types when the API returns an empty array.

Changes

Morph-type lifecycle

Layer / File(s) Summary
Migration flow and regression setup
backend/FwLite/LcmCrdt/CurrentProjectService.cs, backend/FwLite/LcmCrdt.Tests/Data/RegressionTestHelper.cs, backend/FwLite/LcmCrdt.Tests/Data/DownloadProjectTests.cs, backend/FwLite/LcmCrdt/CrdtProjectsService.cs
Database migration no longer seeds missing morph types, and regression initialization uses project-context setup without conditional data migrations.
Project morph-type fixtures and expectations
backend/FwLite/LcmCrdt.Tests/MiniLcmApiFixture.cs, backend/FwLite/LcmCrdt.Tests/MorphTypeSeedingTests.cs, backend/FwLite/LcmCrdt.Tests/OpenProjectTests.cs
Fixtures seed canonical morph types explicitly, while tests cover blank projects and templated projects without redundant migration seeding.
Empty morph-type retrieval fallback
backend/FwLite/FwLiteShared/Services/MiniLcmJsInvokable.cs, backend/FwLite/FwLiteShared.Tests/Services/MiniLcmJsInvokableMorphTypeFallbackTests.cs
GetMorphTypes() returns cloned canonical morph types for empty results and preserves non-empty arrays, with both behaviors tested.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: hahn-kev

Poem

A rabbit checked the morph-type trail,
Found empty paths now bloom without fail.
Canonical copies hop in a row,
While seeded projects keep their flow.
“No duplicate carrots!” I cheer with delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes remove migrate-time morph-type seeding, add explicit fixture seeding, and update related tests, matching #2350's cleanup goals.
Out of Scope Changes check ✅ Passed The extra edits are supporting changes for the same morph-type cleanup and do not appear unrelated.
Title check ✅ Passed The title clearly summarizes the main change: removing CRDT morph-type migrate seeding.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the migration seeding removal and fallback behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tech-debt/morph-type-api-fallback

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hahn-kev
hahn-kev requested a review from myieye July 24, 2026 06:45
@argos-ci

argos-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 24, 2026, 6:46 AM
e2e (Inspect) ✅ No changes detected - Jul 24, 2026, 6:54 AM

@myieye

myieye commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

I opened #2492 as what I think is the best fix for the failing test. By making the dry run sync actually work in both directions it doesn't try to delete morph-types on the fwdata side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Morph-type data migration clean up

3 participants