Use named GUIDs for predefined-data seed commits#2278
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. 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:
📝 WalkthroughWalkthroughThis PR refactors predefined data seeding to use per-project seed commit IDs derived from project UUIDs via UUIDv5, replacing hard-coded fixed GUIDs for morph types, parts of speech, complex form types, semantic domains, and custom views. Method signatures are updated to accept ChangesPer-Project Predefined Data Seeding
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/FwLite/LcmCrdt/CurrentProjectService.cs`:
- Around line 114-119: The migration check currently only looks for the
per-project seed ID (PreDefinedData.MorphTypesSeedCommitId(projectData.Id)) and
will erroneously reseed projects that used the old global/fixed seed id; update
the AnyAsync predicate on dbContext.Set<Commit>() to consider both IDs (the
current PerProject ID and the legacy fixed ID provided by PreDefinedData, e.g.
PreDefinedData.LegacyMorphTypesSeedCommitId or a similarly named helper), so
that AddPredefinedMorphTypes(dataModel, projectData) is only called when neither
the new nor the legacy commit id exists; keep the retrieval of projectData and
the call to PreDefinedData.AddPredefinedMorphTypes unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0ede9480-3b64-4b91-b279-b4ca55119435
📒 Files selected for processing (5)
backend/FwLite/LcmCrdt.Tests/MiniLcmApiFixture.csbackend/FwLite/LcmCrdt/CrdtProjectsService.csbackend/FwLite/LcmCrdt/CurrentProjectService.csbackend/FwLite/LcmCrdt/LcmCrdt.csprojbackend/FwLite/LcmCrdt/Objects/PreDefinedData.cs
Each AddPredefined* now derives its seed commit-id per-project via UUIDv5 (Uuid.NewNameBased), so the LexBox CrdtCommits PK no longer collides across projects — the seed row gets attributed to its own project instead of whichever client pushed first. AddPredefined* signatures now take ProjectData instead of (clientId, projectId). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The linq2db v6 + EF Core 10 work in 8d2b22a and 525cfd7 accidentally reverted PR #2278 ('Use named GUIDs for predefined-data seed commits'). This restores PreDefinedData, CrdtProjectsService, CurrentProjectService, the MiniLcmApiFixture call site, and the UUIDNext PackageReference, while keeping the intended linq2db.AspNet -> linq2db.Extensions rename.
Each
AddPredefined*now derives its seed commit-id per-project via UUIDv5 (Uuid.NewNameBased), avoiding the cross-projectCrdtCommitsPK collision a constant id would cause.Signature changes from
(DataModel, Guid clientId)to(DataModel, ProjectData)so each call has bothIdandClientIdwithout risk of mismatch.Conflicts trivially with #2277 at
MigrateDb— whichever lands second needs a small rebase.