Skip to content

chore: remove unused Roslyn worker cleanup test hook - #1643

Merged
hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/remove-dead-worker-directory-deleter-seam
Jul 8, 2026
Merged

hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/remove-dead-worker-directory-deleter-seam

Conversation

@hatayama

@hatayama hatayama commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Remove an unused Roslyn worker directory cleanup test hook after its only consumer was deleted for EditMode freeze prevention.
  • Keep production temporary-directory cleanup and failure logging unchanged.

User Impact

  • No user-visible behavior changes are intended.
  • Shared compiler worker shutdown still deletes its temporary directory directly and still logs IOException or UnauthorizedAccessException cleanup failures.

Changes

  • Remove the unused host facade and session swap method for the worker directory deleter.
  • Remove the delegate field whose only purpose was supporting that test seam.
  • Invoke the delegate's original production operation, Directory.Delete(path, true), directly inside the existing cleanup try/catch.

Verification

  • Confirmed the removed identifiers had no rooted C#, test, tooling, JSON, Markdown, serialization, or reflection references.
  • Confirmed history: the seam's only test was removed with the real-worker EditMode fixture in the freeze-prevention change.
  • Unity compile: 0 errors, 0 warnings.
  • SharedRoslynCompilerWorkerHostTests: 23/23 passed.
  • ExternalCompilerPathResolverTests: 15/15 passed.
  • StaticFacadeStateGuardTests: 20/20 passed.
  • Public/type and member/local dead-code scanner passes completed; removed identifiers are absent.
  • git diff --check: passed.

Compatibility

  • Directory existence checks, session state clearing, lock boundaries, exception filters, warning payloads/messages, and lifecycle callers are unchanged.
  • No public API or IPC protocol declaration changed.

Review in cubic

Restore direct temporary-directory deletion after the only test that swapped the
delegate was removed as part of the EditMode freeze prevention work.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: def187a6-3f8b-440c-868a-22adc40ab70c

📥 Commits

Reviewing files that changed from the base of the PR and between a895558 and 65b9677.

📒 Files selected for processing (2)
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerSession.cs
💤 Files with no reviewable changes (1)
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs

📝 Walkthrough

Walkthrough

This change removes the test-only SwapWorkerDirectoryDeleterForTests hooks and the _deleteWorkerDirectory field from SharedRoslynCompilerWorkerHost and SharedRoslynCompilerWorkerSession. Shutdown cleanup in TryDeleteWorkerDirectory now calls Directory.Delete(workerDirectoryPath, true) directly instead of invoking the removed delegate.

Changes

Worker Directory Deletion Cleanup

Layer / File(s) Summary
Remove test hooks and inline directory deletion
Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs, Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerSession.cs
Removes SwapWorkerDirectoryDeleterForTests from both classes and the _deleteWorkerDirectory field; TryDeleteWorkerDirectory now calls Directory.Delete(workerDirectoryPath, true) directly, keeping existing exception handling.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the removal of an unused Roslyn worker cleanup test hook.
Description check ✅ Passed The description is clearly related to the code changes and correctly explains the cleanup hook removal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 refactor/hatayama/remove-dead-worker-directory-deleter-seam

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.

@hatayama
hatayama merged commit 0b18b5e into v3-beta Jul 8, 2026
10 checks passed
@hatayama
hatayama deleted the refactor/hatayama/remove-dead-worker-directory-deleter-seam branch July 8, 2026 23:34
RyanXie123 pushed a commit to RyanXie123/unity-cli-loop that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant