feat(docker): add compact filter for docker compose up#2991
Open
DimMarr wants to merge 1 commit into
Open
Conversation
Compose up was previously always skipped by the rewrite hook (rtk-ai#336) since no filter existed for it, so it silently bypassed rtk instead of being tracked. Add a compact summary for detached runs (-d/--detach), grouping containers/networks by their final status instead of repeating a line per status transition (Created -> Starting -> Started, or Running -> Waiting -> Healthy for entities with healthchecks). Foreground `up` (no -d) still streams logs indefinitely, so it now passes through untouched rather than being skipped outright — it's tracked but unfiltered, consistent with other passthrough paths. Verified end-to-end against a real docker compose project (4 containers, one with a healthcheck plus an orphan-container warning): 61% token savings on that fixture.
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.
Summary
docker compose upwas previously always skipped by the rewrite hook (see the#336tests insrc/discover/registry.rs) since no compact filter existed for it yet — it silently bypassed rtk entirely instead of being tracked.This adds a compact summary for detached runs (
-d/--detach): entities are grouped by their final status instead of repeating a line per status transition (e.g.Created -> Starting -> Started, orRunning -> Waiting -> Healthyfor entities with healthchecks).Foreground
up(no-d) streams logs indefinitely, so instead of being skipped outright it now passes through untouched (tracked but unfiltered) — consistent with how other long-running/interactive cases are handled elsewhere incontainer.rs.src/cmds/cloud/container.rs:format_compose_up(filter) +run_compose_up(detached vs. foreground dispatch)src/main.rs: newComposeCommands::Upvariant, wired into theDockermatch armsrc/discover/rules.rs: rewrite pattern extended to includecompose upsrc/discover/registry.rs: updated the two#336tests that assertedupwas skipped (now asserts it rewrites, for both the detached and foreground forms);down/configremain correctly skipped since they still have no filtertests/fixtures/docker_compose_up_raw.txt: real fixture captured from a livedocker compose up -drun (4 services, one with a healthcheck, plus a real orphan-container warning line)Test plan
cargo fmt --all --checkpassescargo clippy --all-targets— no issuescargo test— all tests pass except one pre-existing, unrelated failure (git_checkout_dirty_tree_error_keeps_file_list, caused by a French-localized git error message on my system; reproduces identically on unmodifieddevelop)Createdvs. containerStarted), empty/whitespace input, no-warning casedocker composeproject (4 containers, one with a healthcheck, one orphan-container warning):rtk rewrite "docker compose up -d postgres redis"→rtk docker compose up -d postgres redis;rtk rewrite "docker compose down"still correctly skipped (unchanged, out of scope for this PR)