Skip to content

feat(cli/ssh): implement wait options and deprecate no-wait #7894

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

Merged
merged 5 commits into from
Jun 8, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 7, 2023

Fixes #7768
Refs #7893

@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-wait-no-wait branch from ffbdf29 to 2afc35c Compare June 7, 2023 12:54
@mafredri mafredri changed the title feat(cli): Add wait and no-wait support to ssh feat(cli): add wait and no-wait support to ssh Jun 7, 2023
@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-wait-no-wait branch from 2afc35c to 08da521 Compare June 7, 2023 13:05
@@ -92,6 +92,7 @@ func (r *RootCmd) portForward() *clibase.Cmd {
Fetch: func(ctx context.Context) (codersdk.WorkspaceAgent, error) {
return client.WorkspaceAgent(ctx, workspaceAgent.ID)
},
Wait: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Review: Before change from NoWait -> Wait, these were bugs, added the explicit false here to signal intent.

@mafredri mafredri force-pushed the mafredri/feat-cli-ssh-add-wait-no-wait branch from 08da521 to 2f223fe Compare June 7, 2023 13:31
@mafredri mafredri marked this pull request as ready for review June 7, 2023 14:35
@mafredri mafredri requested a review from johnstcn June 7, 2023 14:37
cli/ssh.go Outdated
Comment on lines 53 to 54
wait bool
noWait bool
Copy link
Member

Choose a reason for hiding this comment

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

Same as with #7893 (comment) - we could potentially (breaking-ly) refactor this to --wait=(always|never|auto)

@mafredri mafredri changed the title feat(cli): add wait and no-wait support to ssh feat(cli/ssh): add wait yes/no/auto and and deprecate no-wait Jun 7, 2023
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

I think this is a very clean solution.

should we use an actual enum type for these? Not a big deal though

Value: clibase.BoolOf(&noWait),
UseInstead: []clibase.Option{waitOption},
Copy link
Member

Choose a reason for hiding this comment

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

It took me a hot second to see this as I was looking for Deprecated 🙃

@mafredri mafredri changed the title feat(cli/ssh): add wait yes/no/auto and and deprecate no-wait feat(cli/ssh): add wait yes/no/auto and deprecate no-wait Jun 8, 2023
@mafredri mafredri changed the title feat(cli/ssh): add wait yes/no/auto and deprecate no-wait feat(cli/ssh): implement wait options and deprecate no-wait Jun 8, 2023
@mafredri mafredri merged commit 94aa9be into main Jun 8, 2023
@mafredri mafredri deleted the mafredri/feat-cli-ssh-add-wait-no-wait branch June 8, 2023 13:52
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --wait option to coder ssh
3 participants