Skip to content

fix(docker): forward --tail flag in compose logs - #1885

Merged
pszymkowiak merged 1 commit into
developfrom
fix/compose-logs-tail-flag-v2
May 14, 2026
Merged

pszymkowiak merged 1 commit into
developfrom
fix/compose-logs-tail-flag-v2

Conversation

@pszymkowiak

Copy link
Copy Markdown
Collaborator

Problem

rtk docker compose logs --tail=20 web falls through to the passthrough handler because clap had no --tail field on the Logs subcommand → 0% token savings. Additionally, run_compose_logs always fetched 100 lines regardless of user input.

Solution

  • Add #[arg(long, default_value_t = 100)] tail: u32 to ComposeCommands::Logs
  • Thread the value through to the docker invocation
  • Default unchanged (100 lines), so bare rtk docker compose logs behaves as before

Origin

Ports the core fix from #580 (by @slice-mihird), retargeted onto current develop layout (src/cmds/cloud/container.rs). The original PR bundled several unrelated changes and was based on pre-#826 src/ layout, making rebase non-trivial — this PR carries only the --tail fix.

Credit preserved via Co-authored-by.

Relates to #578. Will close #580 once merged.

Test plan

  • cargo fmt --all
  • cargo clippy --all-targets -- -D warnings (clean)
  • cargo test --all (1870 passed)
  • Manual: rtk docker compose logs --tail=20 <svc> shows filtered output for 20 lines

Previously `rtk docker compose logs --tail=20 web` would fall through to
the passthrough handler because clap had no `--tail` field on the `Logs`
subcommand, resulting in 0% token savings. Additionally, `run_compose_logs`
always fetched 100 lines regardless of user input.

- Add `#[arg(long, default_value_t = 100)] tail: u32` to `ComposeCommands::Logs`
- Thread the value through to the docker invocation
- Default unchanged (100 lines), so bare `rtk docker compose logs` behaves as before

Ports the core fix from #580, retargeted onto current develop layout
(`src/cmds/cloud/container.rs`). Relates to #578.

Co-authored-by: Mihir Dash <[email protected]>
@CLAassistant

CLAassistant commented May 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pszymkowiak
pszymkowiak merged commit 5f1d8b0 into develop May 14, 2026
17 of 18 checks passed
@aeppling aeppling mentioned this pull request May 15, 2026
Fungraphic pushed a commit to Fungraphic/rtk that referenced this pull request May 19, 2026
fix(docker): forward --tail flag in compose logs
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.

3 participants