Skip to content

feat: add --ssh-host-prefix flag for "coder ssh" #16088

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 1 commit into from
Jan 14, 2025

Conversation

aaronlehmann
Copy link
Contributor

@aaronlehmann aaronlehmann commented Jan 9, 2025

This adds a flag matching --ssh-host-prefix from coder config-ssh to coder ssh. By trimming a custom prefix from the argument, we can set up wildcard-based Host entries in SSH config for the IDE plugins (and eventually coder config-ssh).

We also replace -- in the argument with /, so ownership can be specified in wildcard-based SSH hosts like <owner>--<workspace>.

Replaces #16087.

Part of #14986.

Related to #16078 and #16080.

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Jan 9, 2025
@aaronlehmann aaronlehmann changed the title feat: --ssh-host-prefix flag for "coder ssh" feat: add --ssh-host-prefix flag for "coder ssh" Jan 9, 2025
@aaronlehmann
Copy link
Contributor Author

The test failure looks unrelated. Flaky test?

@bcpeinhardt
Copy link
Contributor

Looks like it, although I'm having trouble getting it to Flake to confirm :/
My suspicion is the flake is latency between these two pieces of text being written to stdout:
https://github.com/coder/coder/pull/16088/files#diff-2caee0e73c6bfeed4632d116a45feccdbdb7a4dfd21a7b7aad510cf087873c9eR223

@bcpeinhardt
Copy link
Contributor

Re-running the tests passed, it's a flake ❄️ I'll come back to this in the morning and try to fix it 😎

@bcpeinhardt
Copy link
Contributor

Ah hey the flake was caught and fixed yesterday, just in the process of being merged: coder/internal#269

aaronlehmann added a commit to aaronlehmann/jetbrains-coder that referenced this pull request Jan 10, 2025
This simplifies the written SSH config and avoids the need to make an
API request for every workspace the filter returns. This can remove
minutes from the "Configuring Coder CLI..." step when the user has
access to many workspaces (for example, an admin who wants the option of
connecting to anyone's workspace on a large deployment).

Depends on coder/coder#16088
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Thanks!

This adds a flag matching `--ssh-host-prefix` from `coder config-ssh` to
`coder ssh`. By trimming a custom prefix from the argument, we can set
up wildcard-based `Host` entries in SSH config for the IDE plugins (and
eventually `coder config-ssh`).

We also replace `--` in the argument with `/`, so ownership can be
specified in wildcard-based SSH hosts like `<owner>--<workspace>`.
@bcpeinhardt bcpeinhardt merged commit 1aa9e32 into coder:main Jan 14, 2025
32 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants