Skip to content

feat(dns): show priority, port, service and protocol in listings, delete previews and set results - #379

Open
jpage-godaddy wants to merge 2 commits into
mainfrom
dns-sparse-columns
Open

jpage-godaddy wants to merge 2 commits into
mainfrom
dns-sparse-columns

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What changes for users

SRV records under one name used to look identical wherever gddy listed them. Three services at chat showed the same type, name, data and TTL in dns list, in the preview dns delete --dry-run prints, and in the records dns set reports, so there was no telling which one a delete would remove.

The columns that tell them apart now appear, only when a listed record has a value for them:

Output A, TXT, CNAME and other plain records SRV records
dns list unchanged adds Priority, Weight, Port, Service and Protocol
dns delete --dry-run unchanged (data, status, record ID) the same, plus those columns
dns set result unchanged the same columns in the Records table

An MX record adds Priority; a CAA record adds Flag and Tag; HTTPS and SVCB records add Parameters. TLSA records add no extra columns, because their data already carries usage, selector, matching type and certificate. The delete preview and the per-record results of a real delete label TLSA records the same way, so two that differ only in usage or matching type can be told apart before a delete removes them. JSON output gains the same fields on the records that have them.

set and delete also no longer print an empty Records: or Plan: line for the section a result doesn't carry. A real set has no plan, a --dry-run has no records, and a delete that matched nothing has no records.

Under the hood

Verification

  • cargo check --workspace, cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, cargo test --workspace (1283 tests in the main crate) and ./rust/scripts/check-module-size.sh all pass, against the published cli-engine 0.10.6 with no local patch.
  • Run live against a throwaway zone in the test environment:
    • a listing of A records adds no columns, MX adds only Priority, and three SRV services under one name are distinguishable by service and port;
    • delete --dry-run on those three services lists each by service and port before anything is removed;
    • set (real and --dry-run), delete --dry-run and a no-match delete print no blank Records: or Plan: line, and their real nested tables are still there.
  • On a narrow terminal the engine still hides the lowest-priority columns first, and the footer says so. A whole-zone listing at 80 columns can hide the SRV columns when another record's data is very long; --type SRV or --fields avoids it.
  • TLSA is covered by unit tests only. The test zone has no DNSSEC, so a TLSA record cannot be created there.

🤖 Generated with Claude Code

…ete previews and set results

SRV records under one name used to look identical in `dns list`, in the preview
`dns delete --dry-run` prints, and in the records `dns set` reports: three
services showed the same type, name, data and TTL, so there was no telling which
one a delete would remove. The columns that tell them apart now appear:

- `dns list` adds Priority, Weight, Port, Service, Protocol, Flag, Tag and
  Parameters, each only when a listed record has a value for it. A listing of
  A, TXT and CNAME records looks exactly as before; an MX record adds Priority,
  a CAA record adds Flag and Tag, an SRV record adds the SRV columns.
- `dns delete --dry-run` and the result of `dns set` show the same columns for
  the records they list.
- JSON output gains those fields on the records that have them.

`set` and `delete` no longer print an empty `Records:` or `Plan:` line for the
section a result doesn't carry (a real `set` has no plan, a `--dry-run` has no
records, a `delete` that matched nothing has no records).

Updates cli-engine to 0.10.6, which provides both behaviours.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

TLSA delete previews omit usage, selector, and matchingType, leaving distinct records indistinguishable apart from IDs; use merged_tlsa_data and add coverage with populated numeric fields.

1 open issue
What changed in this PR

This PR makes type-specific DNS records easier to distinguish in listings, delete previews, and set results, building on the record reporting introduced in #359.

Changes:

  • Shares optional record-detail columns across DNS outputs, showing them only when populated.
  • Hides empty Records and Plan sections using cli-engine 0.10.6.
  • Adds rendering and field-consistency tests and clarifies underscore formatting in the guide.
File Description
rust/​src/​dns/​set/​outcome.rs Tests SRV detail rendering and plain-record output.
rust/​src/​dns/​set/​mod.rs Adds shared detail columns and hides empty result sections.
rust/​src/​dns/​records.rs Defines shared detail fields, columns, and value extraction.
rust/​src/​dns/​records_tests.rs Tests detail-field consistency and extraction.
rust/​src/​dns/​list.rs Expands default columns and tests conditional rendering.
rust/​src/​dns/​guides/​dns.md Clarifies underscore formatting in listings.
rust/​src/​dns/​delete.rs Adds record details to delete previews and rendering tests.
rust/​Cargo.toml Raises the cli-engine requirement to 0.10.6.
rust/​Cargo.lock Updates cli-engine and Windows dependency references.

Review effort: Balanced

Comment thread rust/src/dns/delete.rs Resolved
…elete previews

`dns delete --dry-run` and the per-record results of a real delete labelled a TLSA
record by its certificate alone. Two records that share a certificate, port and
protocol but differ in usage, selector or matching type looked identical, and a
delete by name removes every one of them. They are now labelled the way `dns list`
shows them: usage, selector, matching type, then the certificate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the DNS output improvements.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

2 participants