Skip to content

Bundle Resource Explorer in Databricks Remote SSH mode - #2208

Open
misha-db wants to merge 11 commits into
mainfrom
expose-bundle-explorer
Open

misha-db wants to merge 11 commits into
mainfrom
expose-bundle-explorer

Conversation

@misha-db

Copy link
Copy Markdown
Contributor

Changes

Until now, Databricks Remote SSH ("remote") mode surfaced only the Unity Catalog and Docs views. It connected purely from the ambient environment via ConnectionManager.connectFromEnvironment(), which deliberately never touches the ConfigModel, so there was no bundle target and none of the bundle views could render. This PR brings the Bundle Resource Explorer, Bundle Variables, and a slimmed-down Configuration view to remote mode, along with project-folder and bundle-target pickers — all without introducing a login flow.

New: RemoteBundleInitializer (src/bundle/RemoteBundleInitializer.ts)
Bridges the environment-resolved auth onto the ConfigModel so BundleRemoteStateModel can shell out to bundle summary. It enforces the invariant that, in remote mode, the ConfigModel's auth provider always mirrors the environment:

  • Re-applies auth after setTarget clears it, by listening to onDidChangeAuthProvider (which fires from inside setAuthProvider while the config mutex is held, so the re-apply queues after the clear rather than racing it).
  • Re-resolves the target on a project-folder change — normal mode gets this from ConnectionManager.init(), which remote mode never runs.
  • Re-applies auth on reconnect (onDidChangeState === "CONNECTED").
  • Dedupes by auth-provider reference equality to avoid redundant bundle summary calls and self-looping. Two mutexes (applyAuthMutex, folderChangeMutex) serialise overlapping triggers with an acyclic lock order.

New: RemoteConfigurationDataProvider (src/ui/configuration-view/RemoteConfigurationDataProvider.ts)
A minimal Configuration view showing the active project folder (clickable to switch) and, once resolved, the bundle target with its Host/Mode children — enough to answer "which project is selected" and "which workspace will a deploy target." It drops the normal provider's BundleProjectManager gate and the login/cluster/sync/environment components that don't exist in remote mode, and suppresses BundleTargetComponent until a folder is active.

Refactor: extension.ts
Extracted the Bundle Resource Explorer and Bundle Variables registration into shared registerBundleResourceExplorer / registerBundleVariablesView helpers, called from both the normal and remote activation flows (the only difference is that remote mode passes no ConfigurationDataProvider to the decoration provider). The remote flow now wires up the initializer, the remote Configuration view, both bundle views, and lightweight selectActiveProjectFolder / selectTarget command registrations.

Refactor: shared bundle-target picker
ConnectionCommands.selectTarget and the new remote databricks.connection.bundle.selectTarget registration now share promptToSelectBundleTarget (src/bundle/activeBundleUtils.ts) — the two flows have only the ConfigModel in common.

DecorationProvider now takes an optional ConfigurationDataProvider (absent in remote mode).

package.json

  • Dropped the !databricks.context.remoteMode guard from the bundle commands' enablement clauses so they're usable in remote mode.
  • configurationView now shows when databricks.context.activated; dabsResourceExplorerView shows when a target is set or in remote mode; dabsVariableView when a target is set.
  • Added viewsWelcome entries prompting "Select a project" when no target is resolved in remote mode, and a selectActiveProjectFolder navigation item on the resource explorer in remote mode.

Tests

  • RemoteBundleInitializer.test.ts — covers applying env auth once a target resolves, no-op when no target, re-apply on onDidChangeAuthProvider, re-apply on reconnect (and ignoring non-connected states), reference-equality dedup, folder-change re-resolution, no-op when the new folder has no target, serialisation of overlapping folder changes, and swallowing connectFromEnvironment failures.
  • RemoteConfigurationDataProvider.test.ts — Local Folder + Target rows once resolved, target picker offered only when a folder is active, picker suppressed with no folder, and copy-kind stamping via getTreeItem.
  • ConfigModel.test.ts (new) — locks the target/auth ordering invariant the initializer depends on: setTarget clears the auth provider on every path, so auth must always be re-applied after the target, never before.

Selecting a different project folder in the Bundle Resource Explorer did
nothing in remote mode — the target was never re-resolved because remote
mode never runs ConnectionManager.init() (the listener that calls
setTarget/init on a folder change) and has no BundleProjectManager.

Have RemoteBundleInitializer listen for folder changes and drive the
setTarget(undefined) -> init() -> applyEnvAuth() sequence itself, mirroring
normal mode, serialised by a dedicated folderChangeMutex. Add tests for the
folder-change path.
Extract the target quickpick from ConnectionCommands.selectTarget into a shared
promptToSelectBundleTarget helper and register the selectTarget command in the
remote block. Gate the remote Configuration view's Target row on folder presence
(not target presence) so a folder with no resolved target shows a clickable
"Select a bundle target" prompt, and un-gate the command/menus from !remoteMode.
@misha-db
misha-db deployed to test-trigger-is September 23, 2026 16:13 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 23, 2026 16:14 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 23, 2026 16:14 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor

🤖 Integration tests ❌ failed for bb3025c3.
View run

… mode

Exposing the configuration view in remote mode changed its when-clause
from `!databricks.context.remoteMode` to `databricks.context.activated`.
In normal mode `activated` is false until the full pre-login init
completes, so the view stayed hidden during startup and the welcome-screen
e2e test timed out looking for the CONFIGURATION section.

Gate on `!databricks.context.remoteMode || databricks.context.activated`
so normal mode shows the view immediately (as before) while remote mode
still surfaces it once activation sets the flag.
@misha-db
misha-db deployed to test-trigger-is September 24, 2026 10:14 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 24, 2026 10:15 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 24, 2026 10:16 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor

🤖 Integration tests ❌ failed for 50f77179.
View run

@misha-db
misha-db deployed to test-trigger-is September 24, 2026 11:12 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 24, 2026 11:13 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 24, 2026 11:14 — with GitHub Actions Active
@rugpanov

rugpanov commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 756b260d.
View run

@misha-db
misha-db deployed to test-trigger-is September 28, 2026 10:57 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 28, 2026 10:59 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 28, 2026 10:59 — with GitHub Actions Active
@rugpanov

rugpanov commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 136ee0d1.
View run

In Databricks Remote SSH mode the extension authenticates solely against
the ambient environment (the workspace the session was opened in), but
the selected bundle target's workspace.host can point elsewhere. When
they differ, the environment credentials are silently applied to the
target's config, so the Bundle Resource Explorer and any deploy use the
environment host rather than the target's — with no signal to the user.

Add RemoteTargetHostManager, which compares the environment host against
the selected target's host on target/connection/folder changes and, on a
mismatch, shows a warning toast ("Switch target" / "Don't warn for this
target") and exposes the state so the Configuration view badges the
Target node. The toast shows at most once
environment->target host pair; "Don't warn for this target" persists a
per-pair, workspace-scoped opt-out so an intentional cross-workspace
deploy stops nagging while a genuinely new mismatch still warns.

- New databricks.bundle.remote.hideHostMismatchWarning state key.
- New bundleRemoteHostMismatchWarning tel
  action taken (switch-target / hidden / dismissed); no hostnames.
In Databricks Remote SSH mode the Configuration view showed a
"Select a bundle target" prompt even when the active folder wasn't a
bundle project (no databricks.yml, or a bundle defining no targets).
RemoteConfigurationDataProvider only suppressed the target row when no
folder was active, but activeProjectUri defaults to the first workspace
folder, so the prompt appeared for any folder. Normal mode avoids this
via bundleProjectManager.isBundleProject(), which the remote provider
lacks.

Gate the target row on configModel.targets being non-empty — an
auth-independent, file-based signal that resolves to {} when there's no
bundle or no targets, while still showing the prompt for a real bundle
whose target isn't auto-resolved yet. Also subscribe to
configModel.onDidChange so the row re-evaluates when a bundle file is
added or removed at runtime without changing the resolved target.
@misha-db
misha-db deployed to test-trigger-is September 29, 2026 16:45 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 29, 2026 16:45 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is September 29, 2026 16:51 — with GitHub Actions Active
@rugpanov

rugpanov commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 4eefc345.
View run

@rugpanov

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 4eefc345.
View run

@misha-db
misha-db deployed to test-trigger-is October 2, 2026 08:58 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2208
  • Commit SHA: 788b955f01897ea8c50d8f97d4c0707f12ae4253

Checks will be approved automatically on success.

@misha-db
misha-db deployed to test-trigger-is October 2, 2026 08:59 — with GitHub Actions Active
@misha-db
misha-db deployed to test-trigger-is October 2, 2026 08:59 — with GitHub Actions Active
@rugpanov

rugpanov commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ❌ failed for 788b955f.
View run

This branch was successfully deployed

1 active deployment
test-trigger-is — 788b955f Deployed Oct 2, 2026 by misha-db via Trigger Tests #2267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants