fix: Startup no longer freezes during migration checks#1181
Conversation
Keep the input replay verification bridge out of normal Editor startup by requiring the Unity test define and disabling auto references on the demo editor assembly. Add a focused asmdef contract test so demo-only InitializeOnLoad hooks do not rejoin the regular startup path.
Opening the migration wizard during startup should not scan every project automatically. Store the V2-to-V3 upgrade signal in SessionState, consume it once for the auto-open path, and keep manual opens idle until Check is clicked. - Run migration previews on a background task and marshal UI progress back to the main thread. - Remove startup target-scan scheduling and cover the behavior with focused EditMode tests.
Manual migration opens should not imply that no migration work exists before the user checks. Use a distinct disabled label for the unchecked state and reduce preview scan cost by reusing source text and code-text masks across migration analysis phases. - Throttle progress UI updates while preserving completion updates. - Cache source reads and code masks during preview scans. - Cover button state and scan cache behavior with focused tests.
Late progress continuations can arrive on the Unity main thread after the migration wizard has already rendered the final preview result. Mark the preview inactive before showing the final state so queued progress cannot put the window back into scanning mode.
📝 WalkthroughWalkthroughThis PR implements automatic third-party tool migration scanning triggered during editor startup when a major version transition to v3 is detected. It adds session-state persistence for the auto-scan flag, refactors the migration wizard window to support both manual and automatic entry points, and optimizes file I/O and regex masking during preview planning. ChangesThird-Party Tool Migration Auto-Scan Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 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 docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationFileService.cs (1)
29-34: 💤 Low valueRedundant null validation on
readAllTextparameter.Line 33 uses both
Debug.Assertand a null-coalescingthrow, which is redundant for precondition enforcement. Based on learnings, useDebug.Assertto document and enforce programmer preconditions without adding redundant runtime exceptions for internal contract violations.♻️ Simplify to Debug.Assert only
internal ThirdPartyToolMigrationSourceFileCache(Func<string, string> readAllText) { Debug.Assert(readAllText != null, "readAllText must not be null"); - _readAllText = readAllText ?? throw new ArgumentNullException(nameof(readAllText)); + _readAllText = readAllText; }🤖 Prompt for 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. In `@Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationFileService.cs` around lines 29 - 34, The constructor ThirdPartyToolMigrationSourceFileCache currently uses both Debug.Assert(readAllText != null, ...) and a null-coalescing throw when assigning _readAllText, which is redundant; remove the runtime null check (the "?? throw new ArgumentNullException(nameof(readAllText))") and instead assign _readAllText = readAllText after keeping the Debug.Assert to document the internal precondition for readAllText.
🤖 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.
Nitpick comments:
In
`@Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationFileService.cs`:
- Around line 29-34: The constructor ThirdPartyToolMigrationSourceFileCache
currently uses both Debug.Assert(readAllText != null, ...) and a null-coalescing
throw when assigning _readAllText, which is redundant; remove the runtime null
check (the "?? throw new ArgumentNullException(nameof(readAllText))") and
instead assign _readAllText = readAllText after keeping the Debug.Assert to
document the internal precondition for readAllText.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 18c1eccb-3b38-40d1-a24d-862719e1b5be
⛔ Files ignored due to path filters (1)
Assets/Tests/Demo/Editor/uLoopMCP.Tests.Demo.Editor.asmdefis excluded by none and included by none
📒 Files selected for processing (13)
Assets/Tests/Editor/OnionAssemblyDependencyTests.csAssets/Tests/Editor/SetupWizardWindowTests.csAssets/Tests/Editor/ThirdPartyToolMigrationFileServiceTests.csAssets/Tests/Editor/ThirdPartyToolMigrationWizardWindowTests.csAssets/Tests/Editor/UnityCliLoopEditorSessionStateRepositoryTests.csAssets/Tests/Editor/UnityCliLoopEditorSessionStateTestFactory.csPackages/src/Editor/Domain/UnityCliLoopEditorSessionStateService.csPackages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSessionStateRepository.csPackages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationFileService.csPackages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.csPackages/src/Editor/Presentation/PresentationEditorStartup.csPackages/src/Editor/Presentation/Setup/SetupWizardWindow.csPackages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs
Summary
User Impact
Changes
Verification
Packages/src/Cli~/dist/darwin-arm64/uloop compile --project-path <PROJECT_ROOT>(0 errors, 0 warnings)codex-review v3-beta(no actionable findings after the stale progress issue was fixed)