Skip to content

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

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

feat(domain): Interactivity Wizard for domain commands#235
rts1-godaddy wants to merge 5 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 on lines +174 to +179
// In non-interactive mode, we skip the wizard UI and execute the steps
// directly (availability check → quote → register), relying on flags for
// all configuration.
let final_state = wizard::run_wizard(state, step_ctx, 0).await?;

build_result(&final_state)
spinner.set_message(format!("Registering {}...", &domain));
spinner.enable_steady_tick(std::time::Duration::from_millis(100));

let idempotency_key = uuid::Uuid::new_v4().to_string();
Comment on lines +1 to +2
//! Step 4: Execute — submit the registration using the cached quote, poll the
//! async operation, and display the result.
Comment on lines +21 to +25
let proceed = Confirm::new()
.with_prompt(format!("Would you like to register {domain}?"))
.default(false)
.interact()
.unwrap_or(false);
Comment on lines +10 to +11
/// Available registration periods (years).
const PERIOD_OPTIONS: &[u64] = &[1, 2, 3, 5, 10];
Comment on lines +172 to +177
StepResult::Back => {
if current > start_at {
current -= 1;
}
// If already at start, the step will re-run (loop continues).
}
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