-
Notifications
You must be signed in to change notification settings - Fork 901
feat: default confirm to no for safety #2919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cli/logout.go
Outdated
@@ -28,7 +28,7 @@ func logout() *cobra.Command { | |||
_, err = cliui.Prompt(cmd, cliui.PromptOptions{ | |||
Text: "Are you sure you want to log out?", | |||
IsConfirm: true, | |||
Default: "yes", | |||
Default: "no", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make yes/no
a constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds like a good idea.
@@ -74,7 +71,7 @@ func createUserStatusCommand(sdkStatus codersdk.UserStatus) *cobra.Command { | |||
_, err = cliui.Prompt(cmd, cliui.PromptOptions{ | |||
Text: fmt.Sprintf("Are you sure you want to %s this user?", verb), | |||
IsConfirm: true, | |||
Default: defaultConfirm, | |||
Default: cliui.ConfirmYes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this changes the default back to "yes" when suspending a user, was that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as per the discussion on the issue, the requirements were updated. We want to default to no
only in case of deleting templates and workspaces -- the non-reversible kind of deletions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it, I just missed seeing your edit on the PR description. LGTM!
This PR sets the default confirmation to
no
for the following cases:Subtasks
Fixes #2878
Screenshot