Skip to content

revert(experiment): separate create questions with flag parsings#401

Open
zimeg wants to merge 1 commit intomainfrom
zimeg-revert-multistep-create
Open

revert(experiment): separate create questions with flag parsings#401
zimeg wants to merge 1 commit intomainfrom
zimeg-revert-multistep-create

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Mar 15, 2026

Changelog

Experimental changes - N/A 🍀

Summary

This PR reverts #362 to separate create questions with flag parsing handled with the clients.IO package. This hopes to fix an issue with the --template flag.

Notes

  • 🧪 Toward conclusion of the charm experiment I'm thinking to cover edge cases of the initial survey to huh package switch before extending specific prompts

Requirements

@zimeg zimeg added this to the Next Release milestone Mar 15, 2026
@zimeg zimeg self-assigned this Mar 15, 2026
@zimeg zimeg requested a review from a team as a code owner March 15, 2026 05:21
@zimeg zimeg added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment labels Mar 15, 2026
Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 A few comments of thoughts follow and a recorded demo went toward #400 IIRC!

"context"
"strings"

huh "charm.land/huh/v2"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧰 thought: Separating API and prompts from cmd packages might make testing boundaries more concise? We have mock setups to test particular option and flag arguments are provided as a MatchPromptConfig helper, which might lean on tests for existing prompts.

🤓 ramble: In this example, L1357 can also be set with a slice of options to match in the select:

clientsMock.IO.On(
SelectPrompt,
mock.Anything,
"Choose a team",
mock.Anything,
iostreams.MatchPromptConfig(
iostreams.SelectPromptConfig{
Flag: clientsMock.Config.Flags.Lookup("team"),
Required: true,
},
),
).Return(
iostreams.SelectPromptResponse{
Flag: tc.teamPromptResponseFlag,
Prompt: tc.teamPromptResponsePrompt,
Option: tc.teamPromptResponseOption,
Index: tc.teamPromptResponseIndex,
},
nil,
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👾 ramble: I think boundaries of iostreams might be best instead of prompting imports for huh often!

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.82%. Comparing base (35e1743) to head (42aeefd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #401      +/-   ##
==========================================
- Coverage   67.90%   67.82%   -0.08%     
==========================================
  Files         218      217       -1     
  Lines       18050    17997      -53     
==========================================
- Hits        12256    12206      -50     
+ Misses       4640     4637       -3     
  Partials     1154     1154              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant