You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(simulate): wrap --full-messages health output to the terminal width #613
Raised by @adamwg in review of #554. Simulate's health output uses fixed widths (internal/health/format.go):
wrapRunes = 100: --full-messages wraps condition messages at 100 columns.
messageRunes = 120: one-line descriptions truncate the message at 120 runes, with an ellipsis.
Help output and styled output already size themselves to the terminal (cmd/crossplane/help.go:247, internal/style/style.go:34): each calls term.GetSize(os.Stdout.Fd()) and caps the result at 120. Health output doesn't, so --full-messages wraps badly in narrow terminals and wastes width in wide ones.
How could Crossplane help solve your problem?
Pull the two existing term.GetSize + min(…, 120) call sites into one shared helper.
Pass a width into health.Lines and health.Block instead of reading the terminal inside the formatter. Each caller (internal/plan/output.go, internal/simulate/result.go, internal/diff/renderer/health.go) sets it from the helper.
When stdout isn't a terminal (pipes, CI logs, tests), fall back to the current fixed width, so output stays deterministic there.
Keep the one-line truncation fixed for now. It counts only the message, not the marker, tier and condition before it. Fitting it to the terminal needs prefix-aware budgeting, which can be its own change.
If #612's refactor lands first, the width becomes a renderer option there instead of being plumbed through each path.
Filed by an AI agent (Claude Code) on behalf of @jcogilvie.
Activity