Skip to content

Comments

feat(experiment): use charm prompt with login#349

Merged
zimeg merged 1 commit intomainfrom
charm-login
Feb 23, 2026
Merged

feat(experiment): use charm prompt with login#349
zimeg merged 1 commit intomainfrom
charm-login

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Feb 23, 2026

Summary

This PR uses charm prompts with the login command! 🍀

Preview

Before changes

before.mov

After changes

after.mov

Reviewers

Build the changes of this branch and confirm the following:

$ slack login           # No experiment has an unchanged experience
$ slack login -e charm  # Attempt login with charm prompts
$ slack login -e charm  # Attempt interrupting the prompts

Requirements

@zimeg zimeg added this to the Next Release milestone Feb 23, 2026
@zimeg zimeg requested a review from srtaalej February 23, 2026 20:44
@zimeg zimeg self-assigned this Feb 23, 2026
@zimeg zimeg requested a review from a team as a code owner February 23, 2026 20:44
@zimeg zimeg added enhancement M-T: A feature request for new functionality experiment Experimental feature accessed behind the --experiment flag or toggle semver:patch Use on pull requests to describe the release version increment labels Feb 23, 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 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!

Comment on lines +148 to +150
// 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)
Copy link
Member Author

Choose a reason for hiding this comment

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

🗣️ 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!

Comment on lines -197 to -202
// 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,
})
}
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: I'm hoping to nudge logic related to prompts closer toward cmd overall!

Copy link
Contributor

@srtaalej srtaalej left a comment

Choose a reason for hiding this comment

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

LGTM! so excited to get this out 💫 🚀

@zimeg
Copy link
Member Author

zimeg commented Feb 23, 2026

@srtaalej Likewise, I'm pumped for these prompts! Let's merge this now so we can start building confidence in these changes 🧰 ✨

@zimeg zimeg merged commit 62770ba into main Feb 23, 2026
7 checks passed
@zimeg zimeg deleted the charm-login branch February 23, 2026 21:42
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 25.80645% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.68%. Comparing base (4fb7b4f) to head (df12d15).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/auth/login.go 0.00% 23 Missing ⚠️
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.
📢 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.

@meowgorithm
Copy link

Hey! I'm from the Charm team. @srtaalej and @zimeg, is there anything we can do to help with this? We'd be happy to open an (ahem) Slack Connect channel for comms.

@zimeg
Copy link
Member Author

zimeg commented Feb 24, 2026

@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:

cm.IO.On("SelectPrompt", mock.Anything, "Select an app:", mock.Anything, mock.Anything).
Return(
iostreams.SelectPromptResponse{
Prompt: true,
Index: 0,
},
nil,
)

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! 🌚

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

Labels

enhancement M-T: A feature request for new functionality 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.

3 participants