Skip to content

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

Merged
zimeg merged 2 commits into
mainfrom
zimeg-revert-multistep-create
Mar 17, 2026
Merged

revert(experiment): separate create questions with flag parsings#401
zimeg merged 2 commits into
mainfrom
zimeg-revert-multistep-create

Conversation

@zimeg

Copy link
Copy Markdown
Member

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

@zimegzimeg added this to the Next Release milestone Mar 15, 2026
@zimegzimeg self-assigned this Mar 15, 2026
@zimeg
zimeg requested a review from a team as a code ownerMarch 15, 2026 05:21
@zimegzimeg 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

@zimegzimeg left a comment

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

codecovBot commented Mar 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@02aae5f). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #401 +/- ##
=======================================
Coverage ? 67.86% =======================================
Files ? 217 Lines ? 18015 Branches ? 0 =======================================
Hits ? 12225 Misses ? 4634 Partials ? 1156 

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

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

thanks for catching this bug! i agree that we should prioritize fixing logic first and then introduce our ux changes. LGTM ⭐

@zimeg

Copy link
Copy Markdown
MemberAuthor

@srtaalej Praises to the experiment I say! 🍀 ✨

Thanks for the kind review with this. These are curious iterations to find and I agree! 🚢

@zimeg
zimeg enabled auto-merge (squash) March 17, 2026 04:10
@zimeg
zimeg merged commit f23e6d3 into mainMar 17, 2026
8 checks passed
@zimeg
zimeg deleted the zimeg-revert-multistep-create branch March 17, 2026 04:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedexperimentExperimental feature accessed behind the --experiment flag or togglesemver:patchUse on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@zimeg@srtaalej