Skip to content

fix: error in ci when interactive inputs are required - #468

Merged
zimeg merged 3 commits into
mainfrom
zimeg-fix-ci-prompt-hangs
Apr 7, 2026
Merged

fix: error in ci when interactive inputs are required#468
zimeg merged 3 commits into
mainfrom
zimeg-fix-ci-prompt-hangs

Conversation

@zimeg

@zimegzimeg commented Apr 3, 2026

Copy link
Copy Markdown
Member

Changelog

Errors will appear sooner in CI and scripting setups if interactive input or a confirmation is requested. This guards against waiting until a timeout.

Summary

This PR fixes an error in CI when interactive inputs are required.

Preview

Login command

login

Update command

update

Reviewers

$ slack create | cat # No change
$ slack login | cat # Now errors
$ slack update | cat # Now errors

Notes

  • Some prompts don't have flag substitutes at this time but either might not have a required input or might need a flag option. This is saved for follow up PR but aligns more with the style guides:

### Prompts are Flags with Forms
When information is needed we can prompt for text, confirmation, or a selection.
These decisions can be made in an interactive terminal (TTY) or not, such as in a scripting environment.
A flag option should exist for each prompt with a form fallback. Either default values should be used if forms are attempted in a non-TTY setup or an error and remmediation to use a flag should be returned.

Requirements

@zimegzimeg added this to the Next Release milestone Apr 3, 2026
@zimegzimeg self-assigned this Apr 3, 2026
@zimeg
zimeg requested a review from a team as a code ownerApril 3, 2026 05:39
@zimegzimeg added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented changelog Use on updates to be included in the release notes semver:patch Use on pull requests to describe the release version increment labels Apr 3, 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.

🦠 More comments to the kind reviewers!

Comment on lines +216 to +218
if !io.IsTTY() {
return nil, errInteractivityFlags(MultiSelectPromptConfig{})
}

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.

🔬 note: Here is the implementation of this function, with a default for no flags:

// errInteractivityFlags formats an error for when flag substitutes are needed
funcerrInteractivityFlags(cfgPromptConfig) error {
flags:=cfg.GetFlags()
varremediationstring
varhelpMessage="Learn more about this command with `--help`"
iflen(flags) ==1 {
remediation=fmt.Sprintf("Try running the command with the `--%s` flag included", flags[0].Name)
helpMessage="Learn more about this flag with `--help`"
} elseiflen(flags) >1 {
varnames []string
for_, flag:=rangeflags {
names=append(names, flag.Name)
}
flags:=strings.Join(names, "`\n `--")
remediation=fmt.Sprintf("Consider using the following flags when running this command:\n `--%s`", flags)
helpMessage="Learn more about these flags with `--help`"
}
returnslackerror.New(slackerror.ErrPrompt).
WithDetails(slackerror.ErrorDetails{
slackerror.ErrorDetail{Message: "The input device is not a TTY or does not support interactivity"},
}).
WithRemediation("%s\n%s", remediation, helpMessage)
}

@codecov

codecovBot commented Apr 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.08%. Comparing base (c56ad55) to head (752d4cc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #468 +/- ##
==========================================
+ Coverage 71.07% 71.08% +0.01% 
==========================================
Files 220 220 Lines 18504 18512 +8 ==========================================
+ Hits 13151 13160 +9 + Misses 4178 4177 -1 
Partials 1175 1175 

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

LGTM! thanks for catching and fixing this 🎣 ⭐

@zimeg

zimeg commented Apr 7, 2026

Copy link
Copy Markdown
MemberAuthor

@srtaalej Let's continue our quest to better experience of error! 🪬

@zimeg
zimeg enabled auto-merge (squash) April 7, 2026 06:49
@zimeg
zimeg merged commit a6658e3 into mainApr 7, 2026
8 checks passed
@zimeg
zimeg deleted the zimeg-fix-ci-prompt-hangs branch April 7, 2026 06:55
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 documentedchangelogUse on updates to be included in the release notessemver: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