feat(domain): Interactivity Wizard for domain commands - #235
Open
rts1-godaddy wants to merge 5 commits into
Open
feat(domain): Interactivity Wizard for domain commands#235rts1-godaddy wants to merge 5 commits into
rts1-godaddy wants to merge 5 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
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, anddomain 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)ondialoguerinteractions 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). | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.gddy guide domain-register