Skip to content

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

Merged
bcpeinhardt merged 1 commit into
coder:mainfrom
aaronlehmann:ssh-host-prefix-flag
Jan 14, 2025
Merged

bcpeinhardt merged 1 commit into
coder:mainfrom
aaronlehmann:ssh-host-prefix-flag

Conversation

@aaronlehmann

@aaronlehmann aaronlehmann commented Jan 9, 2025 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

The test failure looks unrelated. Flaky test?

@bcpeinhardt

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

aaronlehmann pushed 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

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment thread cli/ssh.go Resolved
Comment thread cli/ssh.go Resolved
Comment thread cli/ssh.go Resolved
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
@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