8000 fix: VS Code extension login, run status, and workspace file system against minilake by dmux · Pull Request #14 · dmux/minilake · GitHub
[go: up one dir, main page]

Skip to content

fix: VS Code extension login, run status, and workspace file system against minilake - #14

Merged
dmux merged 6 commits into
mainfrom
fix/vscode-extension-bundle-timeouts
Sep 5, 2026
Merged

dmux merged 6 commits into
mainfrom
fix/vscode-extension-bundle-timeouts

Conversation

@dmux
@dmux dmux commented Sep 5, 2026
Copy link
Copy Markdown
Owner

Summary

Fixes four Workspace/Jobs API gaps in minilake, all discovered while getting
the Databricks VS Code extension and databricks bundle working end-to-end
against a local minilake instance (see the databricks-cli-example-minilake
sample project). Ships as 1.7.5.

  • workspace/export ignored direct_download, always returning the
    base64-JSON envelope instead of raw bytes. The Databricks CLI relies on
    direct_download=true to read bundle state files (state/resources.json),
    so every bundle deploy/run after the first failed with lineage mismatch in state files, even though the previous deploy had succeeded.
  • runs/get/runs/list never populated run_page_url. The CLI prints
    this as Run URL: %s right after triggering a run, and both bundle run's log tailer and the VS Code extension's Bundle Resource Explorer
    regex-match a run id out of that URL to start polling for status. With no
    URL, the extension's run-status monitor sat at "unknown" until its 60s
    watchdog gave up with "Timeout while fetching run status" — for runs that
    had already finished successfully.
  • /Users/<user> never existed, and directories had no object_id.
    minilake only ever created /Workspace/Users/<user>/... as a side effect
    of a bundle deploy. The extension's Workspace File System browser starts
    at /Users/<user> and requires object_id on every object it fetches, so
    it failed outright with "Can't fetch details for /Users/".
  • workspace/import rejected format=AUTO with a 501, but the
    extension's "New Notebook"/"New File" actions always send AUTO, never
    SOURCE — so creating any new item in the Workspace File System browser
    failed with "Import format 'AUTO' is not implemented".

Also bumps the version to 1.7.5 (pyproject.toml, uv.lock, FEATURES.md,
the GitHub Pages version badge in site/index.html) and adds a CHANGELOG
entry, following the project's existing release-commit pattern.

Test plan

  • pytest tests/ — same 27 pre-existing, environment-dependent failures
    as on main (Docker volume mount path issues, unrelated to this PR),
    232 passed (231 on main + 1 new regression test for the AUTO import
    format fix)
  • Rebuilt the Docker image from this branch and manually verified, end
    to end, against the databricks-cli-example-minilake sample bundle:
    databricks bundle deploy, bundle run (Run URL populated, no
    lineage mismatch), workspace get-status /Users/minilake-user
    (directory exists with an object_id), and creating a new item with
    format=AUTO via a direct API call matching what the extension sends

< 8000 /div>
dmux added 6 commits September 5, 2026 01:04
GET /api/2.0/workspace/export always returned the base64-JSON envelope
({content, file_type}), ignoring the direct_download query param. The
real API streams raw bytes when direct_download=true, and that's how the
Databricks CLI reads bundle state files (state/resources.json) during
`bundle deploy`/`bundle run` — the JSON-wrapped response doesn't parse as
the expected state file, so the CLI silently falls back to "no remote
state" (serial=0, lineage=""). Every deploy/run after the first then fails
with "lineage mismatch in state files", even though the previous deploy
succeeded and the state file is right there in the workspace.

file_type is still hardcoded to "py" on the non-direct_download path,
unchanged from before — no caller in this codebase depends on it being
accurate yet.

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
RunInfo never set run_page_url, so it was always absent from the API
response. The Databricks CLI prints this field as `Run URL: %s` right
after triggering a run, and both `bundle run`'s log tailer and the VS
Code extension's Bundle Resource Explorer regex-match a run id out of
that printed URL (`/runs?/(\d+)/`) to start polling runs/get for status.
With no URL, the CLI prints "Run URL: " with nothing after it, the regex
never matches, and the extension's run status monitor sits at "unknown"
until its 60s watchdog trips — showing "Timeout while fetching run
status" even though the run already finished successfully.

Built via a new _run_page_url() helper using request.base_url, the same
pattern sql_statements.py already uses for external_link URLs.

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
Two related gaps in the Workspace API that broke the VS Code extension's
"Workspace File System" browser with "Can't fetch details for
/Users/minilake-user":

1. `/Users/<user>` never existed. A real workspace provisions this the
   moment the user exists; minilake only ever created
   `/Workspace/Users/<user>/...`, as a side effect of a bundle deploy
   importing files there. Fixed with a new `ensure_user_home()`, called
   once from the app startup lifespan (idempotent, so it's harmless
   against the persisted `minilake_data` volume too).

2. Even once a directory exists, `get-status`/`list` returned it without
   an `object_id`. The extension's WorkspaceFsEntity treats object_id,
   object_type and path as required on every fs object and throws when
   one is missing, so a directory response was silently treated as
   "can't fetch details" — masked when using the Go CLI directly, since
   Go unmarshals a missing int field to 0 instead of leaving it unset.
   Fixed with a new `_directory_object_id()` that lazily assigns and
   caches an id per directory path, the same lazy-assignment pattern
   already used for files.

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
/workspace/import rejected anything but format=SOURCE with a 501, but the
VS Code extension's "New Notebook"/"New File" actions in the Workspace
File System browser always send format="AUTO" unconditionally — never
SOURCE. That made creating any new item there fail outright with
"Import format 'AUTO' is not implemented (only SOURCE is supported)".

The real API's AUTO infers a format from the path/content; minilake only
ever stores plain Python source regardless of what's requested, so
treating AUTO the same as SOURCE is accurate, not just a workaround.

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
Fixes only, targeting the Databricks VS Code extension and bundle CLI
against a minilake workspace: workspace/export now honors
direct_download, runs/get and runs/list populate run_page_url,
/Users/<user> is created on startup with directories carrying an
object_id, and workspace/import accepts AUTO as an alias for SOURCE.
No API changes beyond those fixes. Full suite: same 27 pre-existing
environment-dependent failures as on main (Docker mount path issues
unrelated to this release), 232 passed (231 on main + 1 new AUTO-format
regression test).

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
Two issues the lint CI job caught: the run_page_url docstring uses \d in
a regular string (needs the r"""..."""" raw-string prefix), and the new
identity import in workspace.py wasn't isort-ordered (minilake.services
sorts after minilake.models). ruff --fix / ruff format applied both;
no behavior change.

Claude-Session: https://claude.ai/code/session_01JMs8RavvkXJPrqA2jALKnp
@dmux dmux self-assigned this Sep 5, 2026
@dmux dmux added the bug Something isn't working label Sep 5, 2026
@dmux
dmux merged commit 6f57203 into main Sep 5, 2026
3 checks passed
@dmux
dmux deleted the fix/vscode-extension-bundle-timeouts branch September 30, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0