feat(ssh): pre-check the Remote SSH extension before starting the tunnel - #2168
Draft
anton-107 wants to merge 1 commit into
Draft
feat(ssh): pre-check the Remote SSH extension before starting the tunnel#2168anton-107 wants to merge 1 commit into
anton-107 wants to merge 1 commit into
Conversation
`databricks ssh connect` needs the host editor's Remote SSH extension to open the remote window, and checks for it by shelling out to `<command> --list-extensions` from inside the terminal. That check is the largest single source of failed IDE-mode tunnels, and its failures are sticky: most users who hit it never get a working tunnel, even across several attempts. Check the running editor's own extension registry instead, before the terminal exists, and offer a button that installs through the editor's marketplace client. Reading the registry cannot fail the way spawning a process can, so this removes the list-failure path rather than working around it. Unlike the host-CLI PATH warning next to it, this awaits the user's choice: installing takes a moment, and the point is to let the attempt they just started succeed rather than fail and depend on a retry. It still never gates the tunnel -- a dismissed or failed install falls through to the CLI's own check, which reports the real error. Adds HostUtils.getHostSshExtension/getSshExtensionStatus, mirroring the CLI's IDE descriptors the way getHostCliCommand already mirrors its --ide handling. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
|
🤖 Integration tests ❌ 1 of 41 test jobs failed for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
databricks ssh connectneeds the host editor's Remote SSH extension to open theremote window, and checks for it by shelling out to
<command> --list-extensionsfrom inside the terminal. Check the running editor's own extension registry
instead, before the terminal exists, and offer a button that installs through the
editor's marketplace client.
HostUtils.getHostSshExtension()resolves the extension id, display name andminimum version per host, mirroring the CLI's IDE descriptors the way
getHostCliCommandalready mirrors its--idehandling.HostUtils.getSshExtensionStatus()returnsok/missing/outdatedfromextensions.getExtension, treating an unparseable version as too old exactly asthe CLI does.
SshCommands.offerToInstallSshExtension()prompts, then runsworkbench.extensions.installExtension.Unlike the host-CLI PATH warning beside it, this awaits the user's choice rather
than firing and forgetting: installing takes a moment, and the point is to let the
attempt the user just started succeed rather than fail and depend on a retry. It
still never gates the tunnel — a dismissed or failed install falls through to the
CLI's own check, which reports the real error.
Why
The CLI-side extension check is the largest single source of failed IDE-mode
tunnels in telemetry, and its failures are sticky: of the users whose first
attempt hit it, only about an eighth ever established a tunnel, despite averaging
2.7 attempts. It is heavily Windows-skewed, and it is also why Cursor users fail
less often than VS Code users — Cursor ships a Remote SSH equivalent, while VS
Code needs a marketplace install.
Reading the editor's registry cannot fail the way spawning a process can, so this
removes the list-failure path rather than working around it. The extension already
passes
--auto-approve, so today these users are never prompted at all: the CLIgoes straight to an auto-install that fails inside a terminal they did not ask
for. This is the same shape as the existing host-CLI PATH pre-check, applied to
the bigger cause.
Companion CLI change, which splits the single telemetry category behind this into
four so the remaining failures are attributable: databricks/cli#6497.
Tests
Not yet compiled or tested — please treat as unverified. The npm registry does
not resolve from the environment this was written in, so
yarn installfails andthere is no
node_modulesto typecheck or run Mocha against. This needs ayarn testrun on a machine with registry access before it should be trusted ormerged. That is the main reason this is a draft.
What was verified without a toolchain:
double-quote,
bracketSpacing: falsesettings.imports).
status.kinddirectly rather than through an aliasedboolean, so nothing depends on inference I could not check.
Tests written but not executed — 11 cases across two files:
hostUtils.test.ts: per-host extension id, missing / at-minimum / above-minimum/ below-minimum / unparseable version, and that the Cursor floor applies in
Cursor.
SshCommands.test.ts: silent when usable, offers Install when missing, offersUpdate naming the installed version, installs nothing when dismissed, and does
not throw when the install itself fails.
One thing worth a reviewer's attention:
hostUtils.tsnow importssemver, whichis not a declared dependency — only
@types/semveris indevDependencies.src/whatsNewPopup.tsalready relies on the same hoisted package in shipped code,so I followed that precedent, but adding it to
dependenciesmay be the rightcall and I could not relock without registry access.
This pull request and its description were written by Isaac.
This PR was created with GitHub MCP.