Skip to content

Conversation

@MarioCadenas
Copy link
Collaborator

@MarioCadenas MarioCadenas commented Jan 30, 2026

Problem

When running with databricks dev-remote, newly created query files in config/queries/ were not accessible. The server was reading the directory from the remote Databricks filesystem, which didn't include files that hadn't been synced yet.

Solution

Added directory listing capability to the WebSocket tunnel between the remote server and local CLI:

  • New readdir() method in DevFileReader that requests directory listings via WebSocket (dir:list message)
  • Refactored AppManager to use a unified FileSystemAdapter pattern for both dev and production modes
  • Added WebSocket message handler for dir:list:response with proper TypeScript types and validation

Key Changes

  • Dev mode: Reads directory listings and files from local filesystem via WebSocket
  • Production mode: Uses standard Node.js fs module (unchanged)
  • Security: Added JSON validation to ensure directory listings are valid arrays of strings
  • Type safety: Added discriminated union types for all WebSocket messages with runtime validation

CLI

needs this CLI PR to work databricks/cli#4402

@MarioCadenas MarioCadenas marked this pull request as ready for review January 30, 2026 17:36
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