Skip to content

fix(dns plugin): shorten long record values in the default table - #107

Merged
scotwells merged 5 commits into
mainfrom
feat/truncate-long-values
Aug 26, 2026
Merged

fix(dns plugin): shorten long record values in the default table#107
scotwells merged 5 commits into
mainfrom
feat/truncate-long-values

Conversation

@scotwells

@scotwells scotwells commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

A zone with a DKIM key was hard to read. tabwriter sizes a column to its widest cell, so a single 400-byte TXT value indents STATUS across every row in the zone — the cost of one long value is paid by every short one.

The default table now shortens a value to 56 columns and says how many it shortened:

NAME                       TYPE   TTL   VALUE                                                      STATUS
00965e5610ec4505aacd8d96   TXT    5m    "heritage=external-dns,external-dns/owner=external-dns-…   Programmed

922 records — 922 Programmed
922 values shortened to fit — see them in full with -o wide or -o json

-o wide, -o json and -o yaml are unchanged and still carry the value in full. Nothing is cut silently.

Related

Three readability fixes for datumctl dns record list, reviewed and merged bottom-up:

  1. fix(dns plugin): shorten long record values in the default table #107 — shorten long values (base: main)
  2. feat(dns plugin): add --no-managed to list only your own records #108--no-managed to hide records another system writes
  3. fix(dns plugin): shorten machine-written names in the default table #109 — shorten machine-written names

All three follow #102, which added the plugin, and are UX fixes found while using it against real staging zones. The plugin ships from #106's release plumbing and is installed via datum-cloud/datumctl-plugins#22.

This is the base of the stack. #109 supersedes part of its "note" section: the NAME column is bounded there.

A zone with a DKIM key was hard to read. tabwriter sizes a column to its widest cell, so one 400-byte TXT value indents STATUS across every row in the zone — the cost of one long value is paid by every short one.

The default table now shortens a value to 56 columns and reports how many it shortened, pointing at `-o wide` and `-o json`, which are unchanged and still carry the value in full. Nothing is cut silently.

The width is measured rather than guessed. Across real zones the values people actually read in a table — addresses, hostnames, SPF records, ACME challenge tokens — bunch up below the mid-fifties, with a clean gap above them: at 48 columns a third of a typical zone's rows get cut, while at 56 it is one in a hundred and the long TXT values this exists for are still shortened.

Truncation counts runes rather than bytes, so a multi-byte value is never cut mid-character, and the ellipsis is inside the budget, so the column never exceeds the width.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scotwells and others added 2 commits August 25, 2026 20:54
`--managed` could only answer half the question. It showed the records Datum writes for you, but there was no way to ask the opposite — what did I put here — and in a zone where another system writes most of the records, that is the more useful view.

`--no-managed` is that view. It is the spelling people reach for, and a negated flag reads better in a script than a value on a positive one.

`--managed=false` means the same thing. It already parsed before this filter existed, where it silently meant "no filter", so someone who typed the intuitive thing got the unfiltered list back and no indication their flag had done nothing. Leaving it inert now would be the more surprising choice.

Passing both flags is a usage error rather than a precedence puzzle resolved silently, and an absent flag still means no filter, which is what separates it from `--no-managed`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Excluding the records Datum manages fixed one zone's width but not the general case: any system that writes into DNS puts an encoded identifier in the owner name, and Datum does not label a third party's records as managed.

Names split cleanly into two populations. The ones people write are conventions with fixed shapes — @, www, _dmarc, _acme-challenge, a DKIM selector — and run to about twenty characters. The ones machines write carry an identifier and start around thirty-two: a hex digest at 32, a UUID at 36, or the 52 characters a base32-encoded 256-bit key costs. 40 sits in the gap, so a hand-written name is shown whole and an encoded one is cut.

Cutting a name costs more than cutting a value, because a name is an argument: `record describe` and `record delete` take one. The footer now counts names separately from values and points at the output that carries them in full, and `-o name` — which exists to turn a row back into something you can pass to those commands — is never shortened.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JoseSzycho
JoseSzycho previously approved these changes Aug 26, 2026
kevwilliams
kevwilliams previously approved these changes Aug 26, 2026
fix(dns plugin): shorten machine-written names in the default table
feat(dns plugin): add --no-managed to list only your own records
@scotwells
scotwells dismissed stale reviews from kevwilliams and JoseSzycho via 3510faf August 26, 2026 16:55
@scotwells
scotwells merged commit 492adf9 into main Aug 26, 2026
1 check passed
@scotwells
scotwells deleted the feat/truncate-long-values branch August 26, 2026 16:57
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