Skip to content

Migrate AskForCluster from survey to huh#128

Open
blsmth wants to merge 1 commit intosurvey-to-huh-v2from
120-migrate-askforcluster-to-huh
Open

Migrate AskForCluster from survey to huh#128
blsmth wants to merge 1 commit intosurvey-to-huh-v2from
120-migrate-askforcluster-to-huh

Conversation

@blsmth
Copy link
Contributor

@blsmth blsmth commented Mar 21, 2026

Summary

  • Migrate AskForCluster shared helper from survey to huh
  • Extract ClusterSelectForm as a pure form builder function
  • Change AskForCluster signature from response interface{} to *string for type safety
  • Skip prompt when --cluster flag is already provided (fixes apppack app create --cluster flag still prompts for cluster selection #115)
  • Update all 3 callers (database, redis, app_pipeline)
  • Remove clusterSelectTransform — replaced by typed huh.NewOption(displayName, stackName)

Closes #120
Fixes #115

Changes

File Purpose
stacks/stacks.go Replace survey with huh; extract ClusterSelectForm; skip prompt when flag set
stacks/stacks_test.go teatest tests for cluster selection
stacks/database.go Update caller to pass &a.Parameters.ClusterStackName
stacks/redis.go Update caller to pass &a.Parameters.ClusterStackName
stacks/app_pipeline.go Update caller to pass &a.Parameters.ClusterStackName

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
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.

1 participant