feat(onboarding): add Docker environment migration - #368
Conversation
Greptile SummaryAdds an optional Docker Desktop and OrbStack migration workflow to onboarding and the Help menu, backed by source detection and daemon migration RPCs.
Confidence Score: 3/5This PR should not merge until executable plans preserve the reviewed source-stop confirmation and migration activity is tracked across all simultaneously active windows. A re-prepared plan can introduce undisclosed source-container stops, and one migration window finishing can prematurely disable close and shutdown protection for another active migration. Files Needing Attention: ArcBox/Views/Onboarding/OnboardingMigrationModel.swift, ArcBox/App/ApplicationCoordinator.swift
|
| Filename | Overview |
|---|---|
| ArcBox/Views/Onboarding/OnboardingMigrationModel.swift | Implements preview, plan validation, execution, and reconnection, but omits source-stop blockers from executable-plan matching. |
| ArcBox/App/ApplicationCoordinator.swift | Adds migration windows and shutdown protection, but a single shared Boolean cannot safely represent concurrent migration-capable windows. |
| ArcBox/Integrations/Docker/DockerContextManager.swift | Adds Docker Desktop and OrbStack source discovery with ambiguity and CLI-failure handling. |
| ArcBox/Views/Onboarding/OnboardingView.swift | Integrates migration preview and execution states into first-run and replay onboarding. |
| Packages/ArcBoxClient/Sources/ArcBoxClient/ArcBoxClient.swift | Exposes the generated daemon migration service through the existing client wrapper. |
| ArcBoxTests/DockerContextManagerTests.swift | Covers previous-context selection, malformed output, stale contexts, and ambiguous sources. |
| ArcBoxTests/OnboardingMigrationModelTests.swift | Verifies reconnection-code classification but does not cover executable-plan drift. |
Sequence Diagram
sequenceDiagram
participant User
participant View as OnboardingView
participant Model as MigrationModel
participant Docker as Docker CLI
participant Daemon as ArcBox daemon
User->>View: Open migration assistant
View->>Model: loadPreview()
Model->>Docker: Detect Docker context/socket
Docker-->>Model: Migration source
Model->>Daemon: PrepareMigration(dryRun)
Daemon-->>Model: Preview and blockers
Model-->>View: Show resources and confirmations
User->>Model: Migrate now
Model->>Daemon: PrepareMigration(executable)
Daemon-->>Model: Plan ID
Model->>Daemon: RunMigration(plan ID)
Daemon-->>Model: Stream progress and terminal event
Model-->>View: Completed or failed
Reviews (1): Last reviewed commit: "feat(onboarding): add Docker environment..." | Re-trigger Greptile
| && response.replacementsRequired == replacementsRequired | ||
| && Set(response.warnings) == Set(warnings) |
There was a problem hiding this comment.
Executable plan omits stop blockers
When the source gains a running container that uses a migrated volume after preview, matches(_:) accepts the re-prepared plan without comparing its blockers, causing ArcBox to stop source containers without the disclosure and confirmation shown for that action.
| && response.replacementsRequired == replacementsRequired | |
| && Set(response.warnings) == Set(warnings) | |
| && response.replacementsRequired == replacementsRequired | |
| && (!response.plan.blockers.isEmpty) == stopsSourceContainers | |
| && Set(response.warnings) == Set(warnings) |
| private func migrationActivityChanged(_ isExecuting: Bool) { | ||
| isMigrationExecuting = isExecuting | ||
| guard !isExecuting else { return } | ||
| migrationCompletionWaiter?.resume() | ||
| migrationCompletionWaiter = nil |
There was a problem hiding this comment.
Shared migration state clears early
If migrations execute concurrently in Getting Started and the dedicated assistant, the first model to finish sets the shared Boolean to false and resumes shutdown, allowing the other window to close or the client and daemon to shut down while its migration remains active.
Knowledge Base Used: App Startup Flow
| import ArcBoxClient | ||
| import Foundation | ||
| import GRPCCore | ||
| import Observation |
There was a problem hiding this comment.
Imports violate repository ordering
The new file places ArcBoxClient before the Foundation system-framework import, violating the repository's required import organization and potentially failing its import-order lint check.
| import ArcBoxClient | |
| import Foundation | |
| import GRPCCore | |
| import Observation | |
| import Foundation | |
| import Observation | |
| import ArcBoxClient | |
| import GRPCCore |
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Safety
Dependency
Draft: do not merge until arcboxlabs/arcbox#575 is merged, a daemon release containing it is published, and
arcbox.versionis bumped here. The current v0.6.3 daemon does not support safe stream reattachment.Validation
make generate-xcodeprojmake lintmake test