Skip to content

feat(config): add gddy config with punycode and currency preferences - #336

Open
jpage-godaddy wants to merge 4 commits into
mainfrom
engine-config-cmds
Open

jpage-godaddy wants to merge 4 commits into
mainfrom
engine-config-cmds

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds gddy config so people can view and change their preferences instead of passing a flag on every command or editing a file by hand (DEVEX-1295).

  • gddy config get|set|unset|list|path. config list shows every setting with its description and default; config set rejects unknown settings and invalid values with a fix.
  • punycode: show domain names in their ASCII form instead of Unicode (gddy config set punycode true).
  • currency: the currency shopping prices are shown in, as an ISO 4217 code (gddy config set currency GBP). It applies to shopping catalog search|get|lookup and shopping checkout create. shopping checkout update still changes a checkout's currency only when --currency is passed, so a saved setting never re-prices an existing checkout.

A saved preference is only a default. The flag and the matching environment variable (GDDY_PUNYCODE, GDDY_CURRENCY) override it, in that order, and --punycode=false turns the encoded form back off for one command. A config file that is malformed or holds an invalid value is reported with a fix rather than silently read as defaults.

The preference is checked before domain purchase, domain quote, domain nameservers set, domain auto-renew set, domain transfer-lock set and hosting domain attach send their request, so a bad saved value fails up front instead of hiding the result (operation ID, quote token, attachment details) of a change that already went through.

domain auto-renew set and domain transfer-lock set now take --punycode and follow the saved punycode preference like the other domain commands, so the domain in their result and in the suggested next step appears in Unicode by default or in its ASCII form when requested.

The domain, DNS and shopping guides describe the settings.

Upgrades cli-engine to 0.10.3, which provides the config commands and typed settings.

Testing

  • Precedence tests (flag, environment variable, saved setting, default) for both preferences, including a broken config file and an invalid saved value.
  • Validation tests for currency through the real config set path.
  • The invalid-GDDY_PUNYCODE case runs in a child test process, so it cannot affect other tests that parse domain commands.
  • Checked by hand that domain purchase, domain quote, domain nameservers set, domain auto-renew set, domain transfer-lock set and hosting domain attach fail with the config error, before any auth or network step, when config.toml is broken.
  • cargo check, clippy -D warnings, cargo test --workspace, cargo fmt --check and the module-size check all pass.

🤖 Generated with Claude Code

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

Preference validation can report failure after a purchase, nameserver update, or domain attachment has already been submitted.

3 open issues
What changed in this PR

Adds persistent CLI preferences, extending internationalized domain support with saved display settings and shopping currency defaults.

Changes:

  • Registers gddy config with validated, typed preferences.
  • Adds flag → environment → saved-setting precedence.
  • Updates guides, tests, and dependencies.
File Description
rust/​src/​shopping/​mod.rs Registers currency support.
rust/​src/​shopping/​guides/​shopping.md Documents currency preferences.
rust/​src/​shopping/​currency.rs Resolves currency precedence and tests it.
rust/​src/​shopping/​checkout/​create.rs Applies preferred currency.
rust/​src/​shopping/​catalog/​search.rs Applies preferred currency.
rust/​src/​shopping/​catalog/​lookup.rs Applies preferred currency.
rust/​src/​shopping/​catalog/​get.rs Applies preferred currency.
rust/​src/​prefs.rs Defines and validates preferences.
rust/​src/​main.rs Registers the configuration schema.
rust/​src/​idn.rs Resolves domain-display preferences and tests precedence.
rust/​src/​hosting/​domain/​list.rs Applies domain-display preferences.
rust/​src/​hosting/​domain/​get.rs Applies domain-display preferences.
rust/​src/​hosting/​domain/​attach.rs Applies domain-display preferences.
rust/​src/​environments/​test_support.rs Extends environment-variable test helpers.
rust/​src/​domain/​suggest.rs Applies domain-display preferences.
rust/​src/​domain/​quote.rs Applies domain-display preferences.
rust/​src/​domain/​purchase.rs Applies domain-display preferences.
rust/​src/​domain/​operation.rs Applies domain-display preferences.
rust/​src/​domain/​nameservers.rs Applies domain-display preferences.
rust/​src/​domain/​list.rs Applies domain-display preferences.
rust/​src/​domain/​guides/​domain-purchase.md Documents saved display settings.
rust/​src/​domain/​get.rs Applies domain-display preferences.
rust/​src/​domain/​available.rs Applies domain-display preferences.
rust/​src/​dns/​set/​mod.rs Resolves domain-display preferences.
rust/​src/​dns/​list.rs Applies domain-display preferences.
rust/​src/​dns/​guides/​dns.md Documents preference precedence.
rust/​src/​dns/​delete.rs Resolves domain-display preferences.
rust/​src/​dns/​add.rs Resolves domain-display preferences.
rust/​Cargo.toml Enables configuration and environment support.
rust/​Cargo.lock Updates dependency versions.

Review effort: Balanced

Comment thread rust/src/domain/purchase.rs Outdated
Comment thread rust/src/domain/nameservers.rs Outdated
Comment thread rust/src/hosting/domain/attach.rs Outdated
@jpage-godaddy
jpage-godaddy added this pull request to stack #338 October 20, 2026 22:26
@jpage-godaddy
jpage-godaddy requested a balanced review from Copilot October 20, 2026 22:47

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

Process-wide environment mutation can interfere with unsynchronized parallel parser tests and cause intermittent failures.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread rust/src/idn.rs Outdated

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

Static review found no unresolved blocking issues in preference validation, precedence, or resolution before mutations.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Base automatically changed from punycode to main October 22, 2026 23:21
jpage-godaddy and others added 3 commits October 22, 2026 16:26
Add `gddy config get|set|unset|list|path` for viewing and changing saved
preferences instead of passing a flag on every command or editing a file
by hand. `config list` shows every setting with its description and default,
and `config set` rejects unknown settings and invalid values with a fix.

Two preferences are available:

- `punycode` shows domain names in their ASCII form instead of Unicode.
- `currency` sets the currency shopping prices are shown in (for example
  GBP). It applies to `shopping catalog search|get|lookup` and
  `shopping checkout create`. `shopping checkout update` still changes a
  checkout's currency only when `--currency` is passed, so a saved setting
  never re-prices an existing checkout.

A saved preference is only a default. The flag and the matching GDDY_*
environment variable (GDDY_PUNYCODE, GDDY_CURRENCY) override it, in that
order, and `--punycode=false` turns the encoded form back off for one
command. A config file that is malformed or holds an invalid value is
reported with a fix rather than silently read as defaults.

The domain and shopping guides describe both settings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…meserver and attach changes

`domain purchase`, `domain quote`, `domain nameservers set` and
`hosting domain attach` looked up the domain display preference after
their request had already gone through. A malformed config file or an
invalid saved value could then show a configuration error even though the
domain had been registered, the quote saved, the nameservers changed or
the domain attached, hiding the operation ID or details the user needs.

These commands now check the preference first and fail before doing
anything, so the error is reported while nothing has changed.

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

An invalid GDDY_PUNYCODE makes every domain command fail to parse, so
setting it in the test process could break any other test that parses a
domain command at the same moment. The invalid-value case now runs in a
child test process and leaves the shared environment alone.

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

`domain auto-renew set` and `domain transfer-lock set` now take
`--punycode` and follow the saved `punycode` preference like the other
domain commands. The domain in their result, and in the suggested next
step, appears in Unicode by default or in its ASCII form when requested.
The preference is checked before the change is sent, so a bad saved value
is reported up front.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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.

2 participants