Skip to content

chore: Simplify native CLI setup internals - #1623

Merged
hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/extract-native-cli-setup-command-runner
Jul 8, 2026
Merged

chore: Simplify native CLI setup internals#1623
hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/extract-native-cli-setup-command-runner

Conversation

@hatayama

@hatayama hatayama commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep native CLI setup behavior unchanged while separating process execution from setup orchestration.
  • Reduce the installer facade to orchestration and current-process environment updates.

User Impact

  • Native CLI install, uninstall, timeout, cancellation, and error-reporting behavior remain unchanged.
  • This internal separation makes future setup maintenance easier to review without changing the wire protocol or release inputs.

Changes

  • Move install and uninstall process execution into NativeCliSetupCommandRunner.
  • Route production callers and the three existing command-execution tests directly through the extracted owner.
  • Move INSTALL_PROCESS_WAIT_SLICE_MS with the execution logic; its private to internal visibility change is required by the uninstall completion caller.
  • Remove the now-unused System.Diagnostics and System.Text imports from NativeCliInstaller.
  • Preserve the existing process-race exception handling and out bool canceled contract as-is.

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" (0 errors, 0 warnings)
  • NativeCliInstallerTests (33 passed)
  • StaticFacadeStateGuardTests (20 passed)
  • Mechanically compared the moved method bodies before and after extraction after normalizing the required constant visibility change; no logic, string, or branch changes were found.
  • Confirmed that the runner has no reverse dependency on the installer, command builder, or uninstall completion waiter.

Review in cubic

Move install and uninstall process execution into a focused runner so the
installer remains responsible for orchestration and current-process state.
Keep command behavior and timeout handling unchanged while routing existing
tests directly through the extracted owner.
@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: 80cc2de4-dbe9-42b4-8422-9c83de8bce1f

📥 Commits

Reviewing files that changed from the base of the PR and between fcbe4d5 and 81fa670.

⛔ Files ignored due to path filters (1)
  • Packages/src/Editor/Infrastructure/CLI/NativeCliSetupCommandRunner.cs.meta is excluded by none and included by none
📒 Files selected for processing (3)
  • Assets/Tests/Editor/NativeCliInstallerTests.cs
  • Packages/src/Editor/Infrastructure/CLI/NativeCliInstaller.cs
  • Packages/src/Editor/Infrastructure/CLI/NativeCliSetupCommandRunner.cs

📝 Walkthrough

Walkthrough

The CLI install/uninstall process execution logic is extracted from NativeCliInstaller into a new NativeCliSetupCommandRunner class. NativeCliInstaller now delegates process start, output capture, timeout, and cancellation handling to the new runner, and tests are updated to call the runner directly instead of NativeCliInstaller.

Changes

CLI setup command runner extraction

Layer / File(s) Summary
New process execution runner
Packages/src/Editor/Infrastructure/CLI/NativeCliSetupCommandRunner.cs
Adds RunInstallCommand/RunUninstallCommand entry points, ProcessStartInfo construction with stdout/stderr redirection, async output capture, cancellation/timeout-aware wait loop, best-effort process kill, and failure/timeout message formatting helpers.
NativeCliInstaller delegation and cleanup
Packages/src/Editor/Infrastructure/CLI/NativeCliInstaller.cs
InstallAsync/UninstallAsync now call NativeCliSetupCommandRunner methods; uninstall polling uses the runner's wait-slice constant; local process-running methods, message builders, and the local wait-slice constant are removed; using directives adjusted.
Test call-site updates
Assets/Tests/Editor/NativeCliInstallerTests.cs
Three tests switch from NativeCliInstaller.RunInstallCommand/RunUninstallCommand to NativeCliSetupCommandRunner.RunInstallCommand/RunUninstallCommand, keeping the same assertions.

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

Possibly related PRs

  • hatayama/unity-cli-loop#1034: Refactors related install/uninstall command execution routed through the new NativeCliSetupCommandRunner in the same NativeCliInstaller code path.
  • hatayama/unity-cli-loop#1135: Modifies the same native uninstall execution flow in NativeCliInstaller that this PR delegates to the new runner.
  • hatayama/unity-cli-loop#1154: Also modifies NativeCliInstaller's uninstall implementation, touching the same file and flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: simplifying native CLI setup internals.
Description check ✅ Passed The description is directly aligned with the refactor and behavior-preservation goals of the changeset.
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/extract-native-cli-setup-command-runner

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.

@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 4 files

You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@hatayama
hatayama merged commit 394fa01 into v3-beta Jul 8, 2026
10 checks passed
@hatayama
hatayama deleted the refactor/hatayama/extract-native-cli-setup-command-runner branch July 8, 2026 15:26
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