Skip to content

feat(stacks): migrate database.go from survey to huh#130

Open
blsmth wants to merge 6 commits intomainfrom
122-migrate-database-to-huh
Open

feat(stacks): migrate database.go from survey to huh#130
blsmth wants to merge 6 commits intomainfrom
122-migrate-database-to-huh

Conversation

@blsmth
Copy link
Copy Markdown
Contributor

@blsmth blsmth commented Apr 1, 2026

Summary

  • Replace survey-based prompts in stacks/database.go with huh form builders
  • Extract four pure form builder functions: DatabaseEngineForm, DatabaseAuroraForm, DatabaseInstanceClassForm, DatabaseMultiAZForm
  • Add teatest-based tests for all form builders covering default selection and alternate selection paths

Closes #122

blsmth added 6 commits March 16, 2026 11:08
Add charmbracelet/huh alongside existing survey for incremental migration.
Set up testscript-based CLI integration tests with version and help scripts.
Add YesNoOptions, YesNoToBool, and PrintQuestionHeader helpers to ui package.
Replace survey.Select with huh.Select[int] for the task picker in
scheduled-tasks delete. Uses typed options to store the index directly
instead of survey's OptionAnswer pattern.
Add ui/uitest package with helpers for driving huh forms in tests via
charmbracelet/x/exp/teatest: RunForm, SelectNth, SelectFirst,
TypeAndSubmit, WaitDone.

Extract ScheduledTaskDeleteForm from the Cobra handler so the form
can be tested independently with simulated keypresses. Tests verify
selecting first, second, and last options all bind the correct index.
Includes .tape script for reproducible recording with charmbracelet/vhs.
Extract ClusterSelectForm builder. Change AskForCluster signature from
response interface{} to *string for type safety. Skip prompt when
--cluster flag is already provided (fixes #115).

Closes #120
Replace survey-based AskQuestions in database.go with extracted huh form
builder functions (DatabaseEngineForm, DatabaseAuroraForm,
DatabaseInstanceClassForm, DatabaseMultiAZForm). Add teatest-based tests
for all four form builders.

Closes #122
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.

Migrate stacks/database.go from survey to huh

1 participant