Skip to content

refactor: consolidate docker handling between CLI and TUI via oav-lib#5

Merged
jorgenosberg merged 2 commits into
mainfrom
refactor/docker-consolidation
Jun 22, 2026
Merged

refactor: consolidate docker handling between CLI and TUI via oav-lib#5
jorgenosberg merged 2 commits into
mainfrom
refactor/docker-consolidation

Conversation

@jorgenosberg

Copy link
Copy Markdown
Collaborator

Continues the refactor work to share logic and resources between CLI and TUI, here for the Docker utility/processing layer

Copilot AI review requested due to automatic review settings June 17, 2026 11:53
@jorgenosberg jorgenosberg self-assigned this Jun 17, 2026

Copilot AI 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.

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, streaming spawn, 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 direct std::process::Command handling.

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 install installs 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.

Comment thread crates/tui/src/main.rs Outdated
Comment thread crates/tui/src/main.rs Outdated
Comment thread crates/cli/src/docker.rs
@jorgenosberg jorgenosberg merged commit aed6637 into main Jun 22, 2026
4 checks passed
@jorgenosberg jorgenosberg deleted the refactor/docker-consolidation branch June 22, 2026 12:18
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.

2 participants