Skip to content

feat(domain): Interactivity Wizard for domain commands - #235

Open
rts1-godaddy wants to merge 17 commits into
mainfrom
feat/domain-register-wizard
Open

feat(domain): Interactivity Wizard for domain commands#235
rts1-godaddy wants to merge 17 commits into
mainfrom
feat/domain-register-wizard

Conversation

@rts1-godaddy

Copy link
Copy Markdown
Collaborator

Summary

  • Adds gddy domain register, an interactive step-by-step wizard that guides users through the entire domain registration flow in a single session: discovery, configuration, contacts, review, and purchase.
  • 5-step flow with forward/back navigation and step counter header
  • Ctrl+C handling with clean "no charges made" exit message
  • State machine tracking domain, pricing, options, contacts, and quote
1. Discovery — prompt for a domain, check availability, offer suggestions when taken
2. Options — period (1–10yr), WHOIS privacy, auto-renew, custom nameservers
3. Contacts — use account defaults, load from contacts.toml, or enter manually with validation
4. Review & Confirm — order summary box, legal agreements, explicit consent; graceful 402 handling with browser redirect to payment methods
5. Execute — submit registration with idempotency key, poll operation status, timeout guidance
  • Multi-entry points
domain available → offers "register this domain?" when available
domain suggest → offers "register one of these?" after results
domain quote → offers "purchase now?" after pricing
  • New CLI guide: gddy guide domain-register
  • Updated domain group description to mention register

Copilot AI lite review requested due to automatic review settings August 25, 2026 18:27

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.

Pull request overview

This PR introduces a new gddy domain register interactive wizard to guide users through domain discovery, configuration, contact collection, review/consent, and execution, and integrates wizard entry points from other domain commands.

Changes:

  • Added a multi-step, back/forward domain registration wizard (domain register) plus a new markdown guide.
  • Added “handoff into registration” prompts from domain available, domain suggest, and domain quote.
  • Introduced a generic async retry helper for transient network errors and added new TUI dependencies (dialoguer, console, indicatif).

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
rust/src/retry.rs New async retry helper with exponential backoff and transient-error heuristic.
rust/src/main.rs Wires the new retry module into the binary; leaves auto-interactive disabled (commented).
rust/src/domain/suggest.rs Offers interactive handoff into the registration wizard from suggestions.
rust/src/domain/register/wizard.rs Implements wizard runner/state, step header, and back/continue/cancel flow.
rust/src/domain/register/steps/review.rs Wizard “Review & Confirm” step: quote fetch, agreements display, consent, payment-required handling, cache write.
rust/src/domain/register/steps/options.rs Wizard “Options” step: period/privacy/auto-renew/nameserver prompting.
rust/src/domain/register/steps/mod.rs Declares the wizard step modules.
rust/src/domain/register/steps/execute.rs Wizard “Execute/Register” step: submit registration + poll async operation.
rust/src/domain/register/steps/discovery.rs Wizard “Discovery” step: availability check and suggestions when taken.
rust/src/domain/register/steps/contacts.rs Wizard “Contacts” step: account defaults vs contacts.toml vs manual entry + optional save.
rust/src/domain/register/mod.rs Adds domain register command spec, interactive/non-interactive entrypoints, and result shaping.
rust/src/domain/register/bridge.rs Bridge helpers to launch wizard from other commands when interactive.
rust/src/domain/quote.rs Adds interactive “purchase now?” handoff into the wizard after quoting.
rust/src/domain/mod.rs Registers the new register command and guide; updates domain group description.
rust/src/domain/guides/domain-register.md New user guide for the interactive registration flow and entry points.
rust/src/domain/available.rs Adds interactive “register this domain?” handoff when availability is true.
rust/src/config/settings_form.rs Small match-guard refactor in settings validation.
rust/Cargo.toml Adds new TUI dependencies required by the wizard.
rust/Cargo.lock Locks new transitive dependencies for dialoguer/console/indicatif.
.gitignore Ignores .cursor/ directory.
Suppressed comments (3)

rust/src/domain/register/bridge.rs:55

  • unwrap_or(false) on dialoguer interactions swallows prompt errors/cancellation (Ctrl+C/EOF) and treats them as a declined registration. It would be better to surface a consistent "prompt cancelled" error so the caller can handle interruption explicitly.
    let proceed = Confirm::new()
        .with_prompt("Would you like to register one of these domains?")
        .default(false)
        .interact()
        .unwrap_or(false);

rust/src/domain/register/bridge.rs:68

  • unwrap_or(items.len() - 1) swallows prompt errors (including Ctrl+C) and forces the fallback selection. This can lead to surprising behavior where an interrupted prompt is treated as "enter a different domain" rather than a cancellation/error.
    let selection = dialoguer::Select::new()
        .with_prompt("Select a domain")
        .items(&items)
        .default(0)
        .interact()
        .unwrap_or(items.len() - 1);

rust/src/domain/register/bridge.rs:105

  • unwrap_or(false) on the confirmation prompt swallows errors/cancellation and treats them as a normal “no”. For consistency with the rest of the wizard prompts (and to ensure Ctrl+C is handled cleanly), this should return a "prompt cancelled" error instead of defaulting.
    let proceed = Confirm::new()
        .with_prompt(format!("Would you like to purchase {domain} now?"))
        .default(false)
        .interact()
        .unwrap_or(false);

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rust/src/domain/register/mod.rs Outdated
Comment thread rust/src/domain/register/steps/execute.rs Outdated
Comment thread rust/src/domain/register/steps/execute.rs Outdated
Comment thread rust/src/domain/register/bridge.rs Outdated
Comment thread rust/src/domain/register/steps/options.rs Outdated
Comment thread rust/src/domain/register/wizard.rs Outdated
@jpage-godaddy

Copy link
Copy Markdown
Collaborator

Collected findings going through the flow:

  1. The steps start at 2/5 when I start from gddy domain suggest --interactive

  2. Order summary renders a bit wonkily:

  ┌────────────────────────────────────────┐
  │ 📋 Order Summary                │
  ├────────────────────────────────────────┤
  │ Domain:     iguanahats.shop│
  │ Period:     2 years                    │
  │ Price:      60.98 USD     │
  │ Renewal:    119.98 USD/yr              │
  │ Privacy:    Yes                        │
  │ Auto-renew: Yes                        │
  └────────────────────────────────────────┘
  1. Registration didn't complete (not our bug, but wanted to explain the situation that occurred), and then I got two layers of next steps and an only partially-filled-out summary.
  ─ Step 5/5: Register

⏳ The registration was submitted successfully but the registry hasn't confirmed yet.
   Your domain will be registered — this is normal for some TLDs.
   Check progress with: gddy domain operation status 1d6d86ea-70b0-4d9a-8447-f448b4b43765
   Charged: 60.98 USD

Next steps:
  • gddy domain get iguanahats.shop
  • gddy dns set iguanahats.shop --type A --name @ --data <ip>
Domain: iguanahats.shop
1yr Price:
1yr Renewal:
Currency: USD

Next steps:
gddy domain get <domain>
    See the registered domain's details

- Number mid-flow steps relative to the entry point (1/4 from suggest, not 2/5)
- Pad the order summary with visible width so ANSI styles keep the box aligned
- Drop duplicate stderr next-steps; envelope owns a single footer with domain filled
- Render register-shaped human output when the wizard returns via suggest/available/quote
Comment thread rust/src/domain/register/steps/contacts.rs Fixed
Comment thread rust/src/domain/register/steps/contacts.rs Fixed
* Dynamic list of years based on the quote api.
* Doesn't show the pricing table if purchase is cancelled or interrupted
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.

4 participants