Skip to content

feat!: add no_truncate opt-out for table columns in human output#40

Merged
jpage-godaddy merged 4 commits into
mainfrom
no-truncate-option
Jul 7, 2026
Merged

feat!: add no_truncate opt-out for table columns in human output#40
jpage-godaddy merged 4 commits into
mainfrom
no-truncate-option

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds TableColumn::no_truncate(bool), a builder flag that exempts a column from the human-output table renderer's 40-char width cap.
  • Fixes the root cause behind godaddy-cli's domain agreements truncating URLs in table output (unrelated caller-side fix will follow once this is published).
  • no_truncate columns are still bounded by a much higher NO_TRUNCATE_MAX_WIDTH (4096 chars) rather than being fully unbounded, so a pathologically long field value can't blow up table width/memory. Header length always takes precedence over this cap, so a column header is never truncated or misaligned even in the unrealistic case it exceeds it.
  • Fixes a related pre-existing bug (surfaced during review) where a column's computed width could shrink below its own header's length, breaking header/separator alignment in table output — affects both the registered-view and columnless rendering paths.

Breaking change

TableColumn gains a new public field (no_truncate). All of TableColumn's fields are public, so this breaks any downstream code constructing it via an exhaustive struct literal instead of TableColumn::new(...) + builder methods. Marked feat!:/BREAKING CHANGE: so release-please bumps the minor version per this project's pre-1.0 versioning rules (CONTRIBUTING.md).

Test plan

  • cargo test — all unit, integration, and doc tests pass, including new regression tests (no_truncate_column_keeps_long_values_intact, no_truncate_column_still_caps_pathologically_long_values, column_width_never_shrinks_below_a_long_header, human_view_no_truncate_column_preserves_long_values_in_table_output)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • Verified locally against godaddy-cli via a [patch.crates-io] override that a .with_view column with .no_truncate(true) renders a full untruncated URL
  • Driven through 4 rounds of Copilot review to a clean pass; one CI failure during the loop was a pre-existing flaky exec_provider test unrelated to this diff (confirmed by rerun)

🤖 Generated with Claude Code

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

Adds a TableColumn::no_truncate(bool) opt-out to preserve long values (e.g., URLs) in human table output by removing the existing 40-character width cap for opted-out columns, and introduces regression tests to prevent truncation regressions.

Changes:

  • Extend TableColumn with a no_truncate flag and builder method.
  • Update the human table renderer to compute widths without the 40-char cap when no_truncate is enabled.
  • Update existing tests for the new TableColumn field and add new regression tests for long, untruncated values.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/output/human.rs Adds no_truncate to TableColumn and updates table width calculation + unit regression test.
tests/exhaustive_output.rs Adds an integration-style regression test ensuring long URLs are preserved in human table output.
tests/foundation.rs Updates expected TableColumn struct literals to include the new no_truncate field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/output/human.rs
Comment thread src/output/human.rs
Table output truncates any column value over 40 characters, which makes
URL-bearing columns (e.g. godaddy-cli's `domain agreements`) unusable.
Adds a `TableColumn::no_truncate` builder flag so callers can exempt
specific columns from the width cap, bounded by a much higher
NO_TRUNCATE_MAX_WIDTH to avoid unbounded padding for pathological values.

BREAKING CHANGE: TableColumn gains a new public field (no_truncate).
Since all of TableColumn's fields are public, this breaks any downstream
code constructing it via an exhaustive struct literal instead of
TableColumn::new(...)/the builder methods.
@jpage-godaddy jpage-godaddy changed the title feat: add no_truncate opt-out for table columns in human output feat!: add no_truncate opt-out for table columns in human output Jul 7, 2026
@jpage-godaddy jpage-godaddy requested a review from Copilot July 7, 2026 23:01

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/output/human.rs Outdated
Comment thread src/output/human.rs Outdated
TableColumn::no_truncate and its rustdoc said values are "never
truncated", but the renderer still caps them at NO_TRUNCATE_MAX_WIDTH.
Reword to avoid downstream consumers assuming truly unbounded output.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/output/human.rs
widths[index] was seeded from the header length but then clamped by
.min(40)/.min(NO_TRUNCATE_MAX_WIDTH), which could push it below the
header's own length for an unusually long header. render_table never
truncates headers (only pads), so that column's header would overflow
past the padded separator/row cells, breaking table alignment.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/output/human.rs
The cap is applied before the header-length floor, so an (unrealistic)
header exceeding the cap is never truncated or misaligned. Document
this precedence explicitly rather than reordering, which would
reintroduce the header-overflow bug this cap's neighbor fix addressed.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@jpage-godaddy jpage-godaddy merged commit 4adb998 into main Jul 7, 2026
4 checks passed
@jpage-godaddy jpage-godaddy deleted the no-truncate-option branch July 7, 2026 23:35
jpage-godaddy pushed a commit that referenced this pull request Jul 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.0](cli-engine-v0.3.5...cli-engine-v0.4.0)
(2026-07-07)


### ⚠ BREAKING CHANGES

* add no_truncate opt-out for table columns in human output
([#40](#40))

### Features

* add no_truncate opt-out for table columns in human output
([#40](#40))
([4adb998](4adb998))
* render guide markdown for human output with termimad
([#38](#38))
([d4d8383](d4d8383))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.

3 participants