feat(python-setup): narrate live progress during environment setup - #2139
Merged
Conversation
*Why* The uv "Setting up Python environment" run shows a mute, indeterminate spinner for a minute or more. Under `--output json` the CLI streams no progress — it buffers everything and prints one result object at the end — so the notification sat silent with no sign it was alive or how long it had been going. *What* Add `utils/setupProgress.ts`: a pure module that turns elapsed time into an honest progress line. It narrates the real, ordered work `setup-local` performs — the fast leading phases (mirroring the CLI's own spinner labels), then the dominant provision phase's real uv sub-steps, rotating — with an `m:ss` elapsed counter. It never shows a percentage and never claims a phase finished, since without a live signal that can't be observed. Wire the previously-ignored progress reporter in `pythonSetupDeps.ts` to tick this once a second and stop when the work settles. The orchestrator and CLI client are untouched (no new args). When the CLI grows a structured progress stream, the observed phase feeds this same rendering; the counter and rotation remain the fallback. *Verification* - New co-located unit tests for the pure module (11 cases): elapsed formatting incl. minute roll-over and negative clamp, leading-phase walk, provision rotation and looping, composed message. All pass via ts-mocha. - `tsc -b` clean; eslint clean; prettier clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 21, 2026 08:17 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests ✅ all 41 test jobs passed for |
*Why* Review of the progress-narration change surfaced two real issues: the interval was started before `.finally` was attached, so a *synchronous* throw from the task (e.g. argv building in the CLI client runs outside its promise) would leak the ticker forever; and the exported time helpers returned `NaN:NaN` for non-finite input. *What* - Extract the ticker into `withElapsedProgress` (setupProgress.ts): it defers the work through `Promise.resolve().then(...)` so a sync throw still routes through `finally` and clears the interval. Timer/clock is an injected seam so the behavior is unit-testable without the extension host. - Clamp non-finite (and negative) input to 0 in the elapsed/phase helpers. - Simplify the `withProgress` wiring in pythonSetupDeps.ts to call it. *Verification* - 7 new cases (18 total): non-finite clamp; and withElapsedProgress opening report, per-tick re-report, and interval cleanup on resolve / reject / synchronous throw. All pass via ts-mocha. - `tsc -b` clean; eslint clean; prettier clean. Co-authored-by: Isaac <no-reply@databricks.com>
*Why* Iterating on how the narration reads in the editor: the leading phases went by too fast to read, the provision stretch had too few messages for the minute-plus it runs, and the phrasing was inconsistently capitalized. *What* - Show each leading phase for 3.5s (was 1.5s) so it's readable. - Expand the provision rotation from 3 to 6 real uv sub-steps (install Python, create venv, resolve, download, build/install, sync). - Lowercase the leading letter of every phrase (proper nouns — Databricks, Python — stay capitalized). *Verification* - Unit tests updated for the new boundaries/phrases; 18 pass via ts-mocha. - eslint clean; prettier clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 21, 2026 08:48 — with
GitHub Actions
Error
rugpanov
marked this pull request as ready for review
August 21, 2026 08:50
Contributor
Author
|
🤖 Integration tests ✅ all 41 test jobs passed for |
*Why* Delta re-review noted the cleanup assertions could pass vacuously: a test that only checks `allCleared()` also passes when no interval was ever started, and the synchronous-throw test discarded the error without confirming it propagated. *What* - Assert `started() === 1` in the resolve and reject cases so cleanup is proven against an interval that actually ran. - Capture the synchronous throw and assert its message is preserved. *Verification* - 18 tests pass via ts-mocha; eslint and prettier clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 21, 2026 11:57 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests ❌ 5 of 41 test jobs failed for |
misha-db
approved these changes
Aug 21, 2026
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. |
rugpanov
had a problem deploying
to
test-trigger-is
August 21, 2026 13:16 — with
GitHub Actions
Error
Merged
rugpanov
added a commit
that referenced
this pull request
Aug 21, 2026
## packages/databricks-vscode ## (2026-08-21) * Narrate live progress during Python environment setup (#2139) ([f606d0a](f606d0a)) * Pre-check the host CLI before starting the SSH tunnel (#2127) ([5af58f2](5af58f2)) * Show an info toast on a successful Python environment setup that had warnings (#2138) ([2acdc44](2acdc44)) * Avoid duplicate profile section creation in `.databrickscfg` during OAuth setup (#2133) ([6e1c472](6e1c472)) ## packages/databricks-vscode-types ## (2026-08-21) --------- Co-authored-by: releasebot <noreply@github.com> Co-authored-by: Grigory Panov <grigory.panov@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
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.
Problem
The uv Setting up Python environment run shows a mute, indeterminate spinner for a minute or more. Under
--output jsonthe CLI streams no progress — it buffers everything and prints a single result object at the end — so the notification sat silent, with no sign it was alive or how long it had been running.Change
Add
python-setup/utils/setupProgress.ts, a pure module that turns the one hard fact we have during the run — elapsed time — into an honest, informative progress line:checking prerequisites…,resolving your Databricks compute…,fetching matching versions and constraints…,updating pyproject.toml….installing the matching Python version…,creating the virtual environment…,resolving the dependency graph…,downloading databricks-connect and dependencies…,building and installing packages with uv…,syncing your project's dependencies….m:sselapsed counter, updated once a second.It never shows a percentage and never claims a phase finished — without a live signal from the CLI that can't be observed, so the copy stays truthful (real work, real order, estimated timing).
The ticker lives in
withElapsedProgress(timer/clock injected so it's unit-testable, and the work deferred so a synchronous throw still clears the interval). ThewithProgresswiring inpythonSetupDeps.tscalls it. The orchestrator and CLI client are untouched — no new CLI args, no--output jsonchange.Interim, but not throwaway
This is the extension-only interim. The proper fix is a structured progress stream from the CLI; when that lands, the observed phase feeds this same rendering and the leading-phase time estimate drops away — the elapsed counter and provision rotation stay as the fallback for older bundled CLIs.
Testing
withElapsedProgressreporting + interval cleanup on resolve / reject / synchronous throw.tsc -bclean, eslint clean, prettier clean.This pull request and its description were written by Isaac.