fix: Speed up V3 custom tool migration auto-scan and show progress feedback
Merged
HA
3mo ago+279+279+012345678901234567890123456789-19-19-01234567890123456789
Summary
- Speeds up the V3 custom tool migration wizard that opens automatically after a V2-to-V3 upgrade, cutting both the wait before the window appears and the re-check right after it opens
- Shows scan progress in the Editor status bar while the wizard is checking for migration targets
User Impact
- Before: the auto-scan gave no visual feedback before the window opened, and once it opened, the exact same project scan ran again from scratch. On projects with many files (or on Windows with real-time antivirus scanning), this looked like a hang
- After: the auto-scan's result is reused for the post-open check, so the scan no longer runs twice. While scanning, the Editor's background task status bar shows "Unity CLI Loop: Checking for V3 custom tool migration targets..."
- The existing behavior of not showing the window at all when there is nothing to migrate is unchanged
Changes
- Added the same fingerprint-verified plan cache to the async preview path that the sync path already had, so the second scan right after the window opens hits the cache instead of rescanning
- Switched the auto-scan check from a cache-blind boolean check to a full preview call, so its result carries over into the cache
- Wrapped the auto-scan in
UnityEditor.Progress.Start/Report/Remove, relaying scan progress to the status bar and always removing the task on completion, exception, or cancellation (Progress.Start/Report/Removeare declared thread-safe in Unity's native bindings, so the reporter calls them directly from the background scan thread) - Fixed the file-inventory phase, which always reported a static 0/0 progress value, to report the actual number of files scanned so far
- Kept the existing boolean-only migration-target check (
HasMigrationTargetsAsync) in place rather than removing it: about 40 existing tests exercise it directly, and rewriting that whole suite is out of scope for this change - Made the plan cache's fingerprint check itself asynchronous: it previously walked the whole project via a synchronous
ProjectFileInventory.Createeven on a cache hit, which would have quietly re-introduced a blocking full scan on every cache reuse
Verification
dist/darwin-arm64/uloop compile: no errors or warningsdist/darwin-arm64/uloop run-tests(all 428ThirdPartyToolMigration-related tests): all green- Added regression tests (cache reuse, progress reporting) following TDD Red -> Green
- Manual check: opened the custom tool migration wizard on macOS and confirmed scan -> result display still works as before
- Not verified: the full auto-scan path reproduced via a real V2-to-V3 upgrade on Windows