Skip to content

cli/command/task: keep multiline errors in table rows#7066

Draft
maxpetrusenkoagent wants to merge 1 commit into
docker:masterfrom
maxpetrusenkoagent:hermes/oss-pr-2026-06-21-docker-cli-6431
Draft

cli/command/task: keep multiline errors in table rows#7066
maxpetrusenkoagent wants to merge 1 commit into
docker:masterfrom
maxpetrusenkoagent:hermes/oss-pr-2026-06-21-docker-cli-6431

Conversation

@maxpetrusenkoagent

Copy link
Copy Markdown

- What I did

Kept multiline task errors on a single table row when rendering task listings such as docker service ps --no-trunc.

Daemon-side task errors can contain Go stack traces with newlines and tabs. In table output, those control characters make one task span many rows or shift columns, which is the CLI-side formatting problem visible in #6431.

Addresses #6431.

- How I did it

Normalized CRLF, LF, CR, and tab characters to spaces when formatting the task Error field for table output.

The change is scoped to table rendering only. Custom non-table formats such as --format '{{.Error}}' continue to preserve the original multiline error text.

- How to verify it

Ran:

scripts/with-go-mod.sh go test ./cli/command/task -run 'TestTaskContextError(PreservesNewlinesForCustomFormat|ReplacesNewlines)' -count=1
scripts/with-go-mod.sh go test ./cli/command/task ./cli/command/service ./cli/command/node ./cli/command/stack -count=1
scripts/with-go-mod.sh go test ./cmd/docker -run '^$' -count=1
git diff --check

Second-agent review:

Reviewer: hermes chat -Q
Result: CLEAN after fixing the first review's blocking tab-normalization finding.
Note: claude -p was attempted first but failed authentication with HTTP 401, so the required fallback reviewer was used.

- Human readable description for the release notes

Fixed task table output so multiline task errors, such as stack traces shown by `docker service ps --no-trunc`, stay on a single row.

- A picture of a cute animal (not mandatory but encouraged)

🐳

Signed-off-by: maxpetrusenkoagent <max.petrusenko.agent@gmail.com>
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.

1 participant