Skip to content

refactor(experiment): move charm huh implementations to iostreams forms package#415

Merged
zimeg merged 5 commits intomainfrom
zimeg-refactor-experiment-iostreams-forms
Mar 19, 2026
Merged

refactor(experiment): move charm huh implementations to iostreams forms package#415
zimeg merged 5 commits intomainfrom
zimeg-refactor-experiment-iostreams-forms

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Mar 19, 2026

Changelog

N/A - But efforts more toward more stable experiments! 🍀 ✨

Summary

This PR moves the huh implementations to an iostreams/forms package with hopes of having prompts as the input method for a flag or interactive form 📚

Reviewers

No change to functionalities! But I remain curious to thoughts on changes of the package 🎁

Requirements

@zimeg zimeg added this to the Next Release milestone Mar 19, 2026
@zimeg zimeg self-assigned this Mar 19, 2026
@zimeg zimeg requested a review from a team as a code owner March 19, 2026 00:44
@zimeg zimeg added code health M-T: Test improvements and anything that improves code health experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment labels Mar 19, 2026
Copy link
Copy Markdown
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.

🍀 Leaving a few thoughts for the amazing readers and will set this to merge on approval with some confidence!

package iostreams

// Prompt type definitions shared between survey and charm implementations.
// Prompts handle flag values and interactive forms for gathering user input.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔭 note: This has the callout of prompts I'd like to make! I'm hoping we can improve how flags are parsed in prompts with the thinking that prompts have option for a flag value or form interactive input.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sounds like a healthy improvement opportunity for how we handle forms and flags. The first iteration has treated us well, but I agree that there is room for improvement!

@zimeg zimeg enabled auto-merge (squash) March 19, 2026 01:13
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.54%. Comparing base (e1bebf8) to head (426fe46).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/iostreams/forms.go 0.00% 5 Missing ⚠️
internal/iostreams/prompts.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   68.51%   68.54%   +0.02%     
==========================================
  Files         218      218              
  Lines       18162    18162              
==========================================
+ Hits        12444    12449       +5     
+ Misses       4554     4551       -3     
+ Partials     1164     1162       -2     

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

Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Thanks for this improvement and thinking about the next evolution for our prompts - forms & flags! 📨 🎏

package iostreams

// Prompt type definitions shared between survey and charm implementations.
// Prompts handle flag values and interactive forms for gathering user input.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sounds like a healthy improvement opportunity for how we handle forms and flags. The first iteration has treated us well, but I agree that there is room for improvement!


if io.config.WithExperimentOn(experiment.Huh) {
return charmPasswordPrompt(io, ctx, message, cfg)
return passwordForm(io, ctx, message, cfg)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: These read very well!

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Mar 19, 2026

@mwbrooks Of course! These are nice iterations to have for ongoing changes I hope... Thanks again for such kind thoughts and fast review 🚢 💨

@zimeg zimeg merged commit 90cf6bc into main Mar 19, 2026
7 checks passed
@zimeg zimeg deleted the zimeg-refactor-experiment-iostreams-forms branch March 19, 2026 05:32
zimeg added a commit that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health 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.

2 participants