Skip to content

feat: DNS record management + domain list, with output-field discovery#65

Merged
jpage-godaddy merged 5 commits into
rust-portfrom
dns-ops
Jun 17, 2026
Merged

feat: DNS record management + domain list, with output-field discovery#65
jpage-godaddy merged 5 commits into
rust-portfrom
dns-ops

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

What & why

Adds DNS record management and domain listing to the CLI, plus field discoverability across commands. All backed by the existing spec-generated domains-client crate, extended with the relevant operations of the same v1 Domains API.

New commands

  • gddy dns list|add|set|delete — manage a domain's DNS records.
    • --type is case-insensitive; --data is repeatable; set/delete are Destructive (preview with --dry-run).
    • delete rejects NS/SOA (registry/GoDaddy-managed — not deletable via the records API) with a clear message instead of an opaque conversion error.
  • gddy domain list [--status …] — list the domains in your account.

Command restructure

  • api listapi domain list + api endpoint list --domain … (refined during review). The old api list emitted two different shapes (API-domain summaries vs endpoints-by-domain) under a single default_fields, which projected the endpoint shape down to empty {} objects (latent in JSON; surfaced in the human table once cli-engine 0.3.0 honors default_fields). Split into two commands, each with one consistent shape, default_fields, and output schema.

domains-client

  • Extended the trimmed OpenAPI spec to include the DNS-record operations (synthesizing the list-all / by-type GETs the published spec omits) and GET /v1/domains.
  • Synthesized GETs preserve the optional X-Shopper-Id header so the list-all / by-type builders expose it like the documented recordGet (refined during review).
  • Made read-only response types tolerant of GoDaddy's sparse payloads (it omits spec-required fields like contactRegistrant/renewDeadline and returns nameServers: null), and stripped date-time/uuid formats so the lean reqwest/rustls dependency stack is unchanged.
  • Derive schemars::JsonSchema on the generated types (pinned to cli-engine's schemars) for --schema.

Field discovery

  • Registered output schemas across env/api/application/domain/dns read and mutation commands — including the dns add/set/delete confirmation outputs (added during review) — via a small output_schema! macro, so <cmd> --help lists the available fields and --schema works. Genuinely passthrough/streaming commands (api call, webhook events, actions describe, application deploy) are intentionally left schema-less.

Robustness

  • domain list and dns list propagate JSON serialization errors as CliCoreError instead of silently masking them as {} (refined during review).

Engine

  • Bump cli-engine to 0.3.0: human output now honors default_fields (curated tables instead of every column; --fields all / --output json for everything), and --schema reports clearly when a command has no registered schema. The 0.3.0 breaking changes (human views no longer inferred; new CommandSpec/MiddlewareRequest fields) don't affect this crate.

Verification

cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test --workspace all clean (gddy 164, domains-client 9, generate-api-catalog 8). Offline httpmock tests cover the record/list client ops (incl. sparse nameServers: null payloads); unit tests cover type validation, the NS/SOA delete guard, and list flag rules.

Note: targets rust-port (this is the Rust-port lineage, not the legacy TS CLI on main).

🤖 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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Add `gddy dns` (list/add/set/delete records) and `gddy domain list`, backed by
the spec-generated domains-client crate extended with the record + list-domains
operations of the same v1 Domains API.

domains-client:
- Trim spec to include the DNS-record ops (synthesizing the list-all/by-type
  GETs the published spec omits) and GET /v1/domains; relax read-only response
  types and strip chrono/uuid formats so the lean dep stack is unchanged.
- Derive schemars::JsonSchema on generated types for `--schema` support.

gddy:
- `gddy dns list|add|set|delete` — case-insensitive --type, repeatable --data,
  Destructive tier on set/delete; delete rejects NS/SOA (API-managed) with a
  clear message instead of an opaque conversion error.
- `gddy domain list [--status]` — list owned domains.
- Register output schemas across env/api/application/domain/dns commands (via a
  small `output_schema!` macro) so `<cmd> --help` and `--schema` list fields.
- Bump cli-engine to 0.3.0 (human output now honors default_fields; --schema
  reports when no schema is registered).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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 13 out of 14 changed files in this pull request and generated 5 comments.

Comment thread rust/src/domain/mod.rs Outdated
Comment thread rust/src/dns/mod.rs Outdated
Comment thread rust/src/dns/mod.rs
Comment thread rust/src/dns/mod.rs
Comment thread rust/src/dns/mod.rs
… schemas

- domain list / dns list: propagate `serde_json::to_value` errors instead of
  masking them as `{}`.
- dns add/set/delete: register output schemas so `--help`/`--schema` list their
  result fields, consistent with the read commands.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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 13 out of 14 changed files in this pull request and generated 1 comment.

Comment thread rust/src/api_explorer/mod.rs Outdated
The single `api list` emitted two different shapes (API domains vs endpoints
with --domain), so its one default_fields projected the endpoint shape to empty
`{}` objects (in JSON pre-existing; the cli-engine 0.3.0 bump extended it to the
human table). Split into two commands, each with a single consistent shape,
default_fields, and output schema:
- `api domain list`            -> {domain,title,endpoints,baseUrl}
- `api endpoint list --domain` -> {operationId,method,path,summary}

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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 13 out of 14 changed files in this pull request and generated 1 comment.

Comment thread rust/domains-client/scripts/regenerate-spec.sh
The synthesis filtered recordGet's params down to path params, dropping the
optional X-Shopper-Id header the record routes support. Keep header params so
the list-all / by-type builders expose .x_shopper_id() like recordGet does;
regenerated openapi/domains.oas3.json.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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 13 out of 14 changed files in this pull request and generated no new comments.

@jbrooks2-godaddy jbrooks2-godaddy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor suggestions, I do think it's worth fixing the validation issue so that dry-run works correctly

Comment thread rust/src/api_explorer/mod.rs
Comment thread rust/src/dns/mod.rs Outdated
Comment thread rust/src/dns/mod.rs Outdated
Comment thread rust/src/domain/mod.rs
Addresses review (@jbrooks2-godaddy):
- Move `--type` validation into clap value-parsers (general + delete-only that
  rejects NS/SOA) and make `--name` require `--type` via clap, so invalid input
  fails at parse time — before cli-engine's --dry-run/auth short-circuits.
  Previously `--dry-run dns delete --type NS` reported success and
  `dns list --name www` reached auth instead of failing locally.
- `dns delete` --type help lists only the deletable types.
- Update the godaddy-cli project skill for the `api domain/endpoint list` split.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

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 14 out of 15 changed files in this pull request and generated no new comments.

@jpage-godaddy jpage-godaddy merged commit fa66cfa into rust-port Jun 17, 2026
2 checks passed
@jpage-godaddy jpage-godaddy deleted the dns-ops branch June 17, 2026 15:33
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