Conversation
zimeg
left a comment
There was a problem hiding this comment.
📝 A few notes for the reviewers! I'm interested in following up with improved testing strategies, but for now let's keep experimental changes gated to find edges in implementation I think!
| // Override huh's default user abort error with a Slack CLI error so that | ||
| // cancelled prompts are handled consistently as process interruptions. | ||
| huh.ErrUserAborted = slackerror.New(slackerror.ErrProcessInterrupted) |
There was a problem hiding this comment.
🗣️ note: We might want to reconsider how we handle interrupted prompts, but for now I find this suitable at capturing these errors to match current behaviors!
| // promptForChallengeCode asks user to submit the valid challenge code received from the Slack authorization | ||
| func promptForChallengeCode(ctx context.Context, IO iostreams.IOStreamer) (string, error) { | ||
| return IO.InputPrompt(ctx, "Enter challenge code", iostreams.InputPromptConfig{ | ||
| Required: true, | ||
| }) | ||
| } |
There was a problem hiding this comment.
🪓 thought: I'm hoping to nudge logic related to prompts closer toward cmd overall!
srtaalej
left a comment
There was a problem hiding this comment.
LGTM! so excited to get this out 💫 🚀
|
@srtaalej Likewise, I'm pumped for these prompts! Let's merge this now so we can start building confidence in these changes 🧰 ✨ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #349 +/- ##
==========================================
- Coverage 64.68% 64.68% -0.01%
==========================================
Files 212 212
Lines 17805 17820 +15
==========================================
+ Hits 11518 11527 +9
- Misses 5209 5219 +10
+ Partials 1078 1074 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@meowgorithm Hello! 🍀😸 Thank you so much for asking! The examples y'all share are great inspiration but we might need a few pointers more- Our current approach to prompting matches flag options before asking for interactive inputs most of the time. It's been alright in testing if the CLI works for scripting purposes, but unit testing has led us to stubbing mocks across an interface as: slack-cli/cmd/project/create_test.go Lines 49 to 56 in 62770ba A quick approach of #350 tries to continue this pattern, but I'm most curious to best practices otherwise! Would inlining forms be better for testing and customizations overall? I realize too that a channel might be best for these ramblings... Will look for a link soon! 🌚 |
Summary
This PR uses
charmprompts with thelogincommand! 🍀Preview
Before changes
before.mov
After changes
after.mov
Reviewers
Build the changes of this branch and confirm the following:
Requirements