Skip to content

chore: Domain editor-settings service wrapper removed in favor of direct port use - #1531

Merged
hatayama merged 2 commits into
v3-betafrom
refactor/c4-remove-editor-settings-service-passthrough
Jul 6, 2026
Merged

hatayama merged 2 commits into
v3-betafrom
refactor/c4-remove-editor-settings-service-passthrough

Conversation

@hatayama

@hatayama hatayama commented Jul 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Removes the UnityCliLoopEditorSettingsService pass-through wrapper from the Domain layer; consumers now depend on IUnityCliLoopEditorSettingsPort directly.

User Impact

Changes

  • Deleted the wrapper class: all 11 methods were 1:1 forwards to IUnityCliLoopEditorSettingsPort; the only precondition in the chain already lives in the sole implementation UnityCliLoopEditorSettingsRepository, so nothing is lost.
  • The service file was converted in place (git mv, GUID preserved) into the standalone IUnityCliLoopEditorSettingsPort.cs Domain file, with a boundary-focused doc comment.
  • CompositionRoot, 3 Infrastructure and 4 Presentation consumers retyped to the port with consistent editorSettingsPort naming (including UnityCliLoopApplicationServices.EditorSettingsPort and the window helpers).
  • Test factory and 3 test fixtures retyped/renamed; OnionAssemblyDependencyTests residency guard repointed to the port; StaticFacadeStateGuardTests path list entry for the deleted file removed.

Verification

  • dist/darwin-arm64/uloop compile — 0 errors, 0 warnings
  • uloop run-tests (EditMode, UnityCliLoopEditorSettingsRecoveryTests|UnityCliLoopPackageRemovalSettingsResetterTests|SetupWizardWindowTests|OnionAssemblyDependencyTests|StaticFacadeStateGuardTests) — 221/221 passed
  • grep -rnw "UnityCliLoopEditorSettingsService" across Packages/, Assets/, tools/ — zero remaining references

Review in cubic

All 11 UnityCliLoopEditorSettingsService methods forwarded 1:1 to
IUnityCliLoopEditorSettingsPort, and the only precondition in the chain
already lives in the sole port implementation
(UnityCliLoopEditorSettingsRepository), so the wrapper added no behavior.
Consumers across CompositionRoot, Infrastructure, and Presentation now
depend on the port directly, with port-based naming throughout. The
service file becomes the standalone port interface file (git mv keeps
the meta GUID), and the residency/facade guard tests are repointed.
@coderabbitai

coderabbitai Bot commented Jul 5, 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: 3dd1c4b0-5d29-4683-8944-04e2d61300f3

📥 Commits

Reviewing files that changed from the base of the PR and between 5288cd8 and 5017c83.

📒 Files selected for processing (2)
  • Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
  • Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs

📝 Walkthrough

Walkthrough

This PR replaces the editor settings service with a domain port interface and rewires editor composition, startup, presentation, and tests to use the port-backed settings boundary.

Changes

Settings Port Migration

Layer / File(s) Summary
Port contract
Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs
Adds the new editor-settings persistence interface with recovery, read/write/update, wizard version, and flag operations.
Composition and startup wiring
Packages/src/Editor/CompositionRoot/UnityCliLoopApplicationRegistration.cs, Packages/src/Editor/CompositionRoot/UnityCliLoopEditorBootstrapper.cs, Packages/src/Editor/Infrastructure/InfrastructureEditorStartup.cs, Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRecoveryScheduler.cs, Packages/src/Editor/Infrastructure/Settings/UnityCliLoopPackageRemovalSettingsResetter.cs
Application registration, bootstrapper initialization, infrastructure startup, recovery scheduling, and package removal reset logic now pass and invoke IUnityCliLoopEditorSettingsPort.
Presentation windows and model
Packages/src/Editor/Presentation/PresentationEditorStartup.cs, Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs, Packages/src/Editor/Presentation/UnityCliLoopSettingsModel.cs, Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
Setup wizard and settings UI wiring now stores, retrieves, and persists editor settings through the registered port.
Test updates
Assets/Tests/Editor/UnityCliLoopEditorSettingsTestFactory.cs, Assets/Tests/Editor/SetupWizardWindowTests.cs, Assets/Tests/Editor/UnityCliLoopEditorSettingsRecoveryTests.cs, Assets/Tests/Editor/UnityCliLoopPackageRemovalSettingsResetterTests.cs, Assets/Tests/Editor/OnionAssemblyDependencyTests.cs, Assets/Tests/Editor/StaticFacadeStateGuardTests.cs
Test helpers and fixtures switch to port creation and port-based assertions, and dependency guard expectations are updated to match the new type.

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

Possibly related PRs

  • hatayama/unity-cli-loop#1131: Both PRs touch package-removal/setup-wizard reset wiring in InfrastructureEditorStartup and UnityCliLoopPackageRemovalSettingsResetter.
  • hatayama/unity-cli-loop#1166: Both PRs modify the editor-startup and settings-window initialization paths in PresentationEditorStartup and UnityCliLoopSettingsWindow.
  • hatayama/unity-cli-loop#1079: Both PRs adjust the InfrastructureEditorStartup settings-recovery flow and its related assembly-dependency test expectations.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing the editor-settings service wrapper in favor of direct port use.
Description check ✅ Passed The description is detailed and directly describes the port migration, affected consumers, and verification steps.
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/c4-remove-editor-settings-service-passthrough

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs (1)

1091-1099: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale "settings service" wording in exception message.

Same issue as SetupWizardWindow.GetEditorSettingsPort(): the message still reads "Unity CLI Loop editor settings service is not registered." after the type was renamed to IUnityCliLoopEditorSettingsPort.

✏️ Proposed fix
-                throw new InvalidOperationException("Unity CLI Loop editor settings service is not registered.");
+                throw new InvalidOperationException("Unity CLI Loop editor settings port is not registered.");
🤖 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/Presentation/UnityCliLoopSettingsWindow.cs` around lines
1091 - 1099, The exception message in GetEditorSettingsPort still uses the old
“settings service” wording after the rename to IUnityCliLoopEditorSettingsPort.
Update the InvalidOperationException text in GetEditorSettingsPort to match the
current type/name used in this class, keeping it consistent with
SetupWizardWindow.GetEditorSettingsPort and the RegisteredEditorSettingsPort
check.
Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs (1)

364-372: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale "settings service" wording in exception message.

The exception message still says "Unity CLI Loop editor settings service is not registered." even though the field/type is now IUnityCliLoopEditorSettingsPort. Purely cosmetic, but could confuse future debugging.

✏️ Proposed fix
-                throw new System.InvalidOperationException("Unity CLI Loop editor settings service is not registered.");
+                throw new System.InvalidOperationException("Unity CLI Loop editor settings port is not registered.");
🤖 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/Presentation/Setup/SetupWizardWindow.cs` around lines 364
- 372, Update GetEditorSettingsPort so the InvalidOperationException message
matches the current IUnityCliLoopEditorSettingsPort naming instead of the stale
“settings service” wording. Keep the existing null check on
RegisteredEditorSettingsPort, but change the thrown message to reference the
editor settings port consistently so future debugging aligns with the type and
field names.
🤖 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/Presentation/Setup/SetupWizardWindow.cs`:
- Around line 364-372: Update GetEditorSettingsPort so the
InvalidOperationException message matches the current
IUnityCliLoopEditorSettingsPort naming instead of the stale “settings service”
wording. Keep the existing null check on RegisteredEditorSettingsPort, but
change the thrown message to reference the editor settings port consistently so
future debugging aligns with the type and field names.

In `@Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs`:
- Around line 1091-1099: The exception message in GetEditorSettingsPort still
uses the old “settings service” wording after the rename to
IUnityCliLoopEditorSettingsPort. Update the InvalidOperationException text in
GetEditorSettingsPort to match the current type/name used in this class, keeping
it consistent with SetupWizardWindow.GetEditorSettingsPort and the
RegisteredEditorSettingsPort check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 06be6d50-7c0b-4e58-b2d7-217d5d607149

📥 Commits

Reviewing files that changed from the base of the PR and between f4b7df4 and 5288cd8.

⛔ Files ignored due to path filters (1)
  • Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs.meta is excluded by none and included by none
📒 Files selected for processing (17)
  • Assets/Tests/Editor/OnionAssemblyDependencyTests.cs
  • Assets/Tests/Editor/SetupWizardWindowTests.cs
  • Assets/Tests/Editor/StaticFacadeStateGuardTests.cs
  • Assets/Tests/Editor/UnityCliLoopEditorSettingsRecoveryTests.cs
  • Assets/Tests/Editor/UnityCliLoopEditorSettingsTestFactory.cs
  • Assets/Tests/Editor/UnityCliLoopPackageRemovalSettingsResetterTests.cs
  • Packages/src/Editor/CompositionRoot/UnityCliLoopApplicationRegistration.cs
  • Packages/src/Editor/CompositionRoot/UnityCliLoopEditorBootstrapper.cs
  • Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs
  • Packages/src/Editor/Domain/UnityCliLoopEditorSettingsService.cs
  • Packages/src/Editor/Infrastructure/InfrastructureEditorStartup.cs
  • Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRecoveryScheduler.cs
  • Packages/src/Editor/Infrastructure/Settings/UnityCliLoopPackageRemovalSettingsResetter.cs
  • Packages/src/Editor/Presentation/PresentationEditorStartup.cs
  • Packages/src/Editor/Presentation/Setup/SetupWizardWindow.cs
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsModel.cs
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
💤 Files with no reviewable changes (2)
  • Packages/src/Editor/Domain/UnityCliLoopEditorSettingsService.cs
  • Assets/Tests/Editor/StaticFacadeStateGuardTests.cs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

Re-trigger cubic

Both GetEditorSettingsPort() accessors threw with wording that referenced
the deleted UnityCliLoopEditorSettingsService concept, which would
mislead anyone debugging an unregistered-port failure.
@hatayama
hatayama merged commit 87e603f into v3-beta Jul 6, 2026
10 checks passed
@hatayama
hatayama deleted the refactor/c4-remove-editor-settings-service-passthrough branch July 6, 2026 00:40
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