refactor: consolidate docker handling between CLI and TUI via oav-lib#5
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the CLI/TUI refactor by moving Docker orchestration primitives into oav-lib and updating both frontends to share the same spawning/cancellation/output-streaming behavior.
Changes:
- Introduces
oav-lib::docker(engine checks, user helpers, streamingspawn, shared types) and rewires the CLI/TUI to use it. - Refactors the TUI pipeline to use a
DockerStep { cmd, log_path }wrapper and persist logs after container completion. - Updates the CLI’s Docker execution to build arg vectors and stream output via
oav-lib::docker::spawn, removing directstd::process::Commandhandling.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/tui/src/pipeline/orchestrator.rs | Switches pipeline execution to run DockerSteps and writes buffered logs to log_path. |
| crates/tui/src/pipeline/commands.rs | Returns DockerStep (command + log path) for lint/generate/compile invocations and updates tests accordingly. |
| crates/tui/src/main.rs | Uses Compose-aware Docker availability checks for enabling validation. |
| crates/tui/src/lib.rs | Re-exports oav_lib::docker from the TUI crate root. |
| crates/tui/src/docker/mod.rs | Removes the TUI-local docker module (migrated to oav-lib). |
| crates/lib/src/lib.rs | Exposes the new shared docker module from oav-lib. |
| crates/lib/src/docker/mod.rs | Adds shared docker module surface (engine/run/types) and re-exports. |
| crates/lib/src/docker/engine.rs | Adds daemon + compose availability checks and user identity helpers. |
| crates/lib/src/docker/run.rs | Provides shared streaming spawn implementation (no disk I/O). |
| crates/lib/src/docker/types.rs | Centralizes shared docker types and removes log_path from ContainerCommand. |
| crates/lib/Cargo.toml | Adds libc on Unix for user identity helpers. |
| crates/cli/src/docker.rs | Refactors CLI docker runner to use oav-lib spawn + streamed output logging. |
| crates/cli/src/steps/lint.rs | Builds docker arg vectors and uses new CLI docker runner API. |
| crates/cli/src/steps/generate.rs | Builds docker arg vectors (incl. user args) and uses new runner API. |
| crates/cli/src/steps/compile.rs | Builds docker compose … arg vectors and uses new runner API. |
| crates/cli/Cargo.toml | Drops direct libc dependency (now in oav-lib on Unix). |
| Cargo.lock | Updates lockfile for dependency moves/additions. |
Comments suppressed due to low confidence (1)
crates/lib/src/docker/engine.rs:30
- The remediation guidance in the Compose check error message is likely inaccurate:
docker plugin installinstalls Engine plugins, not the Docker Compose v2 CLI plugin. Consider pointing users to installing the Compose v2 CLI plugin / updating Docker (without prescribing an incorrect command).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the refactor work to share logic and resources between CLI and TUI, here for the Docker utility/processing layer