Offer a one-click "Install uv" action when uv is missing - #2162
Merged
Conversation
*Why* When `environments setup-local` fails with E_UV_MISSING, the failure popup offered a single "Install uv" button that only opened uv's docs page — the label promised an install but delivered documentation. Users had to leave the editor, read the guide, pick the right installer for their OS, and run it by hand. *What* The E_UV_MISSING popup now shows two remediation buttons: - **Install uv** — runs uv's official installer in a VS Code terminal for the current platform (`curl -LsSf https://astral.sh/uv/install.sh | sh` on macOS/Linux; `irm https://astral.sh/uv/install.ps1 | iex` via PowerShell on Windows). A short banner explains the step and points the user back at "Set up Python environment"; the terminal stays open so the installer's own output remains readable. - **Installation guide** — opens the docs page (the previous behavior), for users who prefer to install uv themselves. New `uvInstall.ts` builds the per-shell command line from the shared `shellUtils` helpers (so the curl/irm split and `;`/`&` separator are correct across macOS, Linux and Windows). A new `databricks.environment.installUv` command runs it in a terminal, mirroring the `az login` pattern. `showError` now takes an ordered list of remediation actions instead of one; `getPythonSetupErrorActions` returns two for E_UV_MISSING and one (or none) for every other code. *Verification* - New unit tests: `uvInstall` command per shell dialect; `getPythonSetupErrorActions` two-button/one-button/empty cases; wiring renders both buttons in order and dispatches the command-action. - `yarn build` (typecheck) clean; full unit suite 1029 passing; `test:lint` clean. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
Author
|
🤖 Integration tests triggered for |
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 13:12 — with
GitHub Actions
Error
*Why* Review found a Windows correctness bug: uvInstallTerminalCommand chose the installer OS from the terminal's shell *dialect*. On Windows with a Git Bash / WSL default profile (posix syntax), it ran the POSIX `install.sh`, landing a Linux/WSL uv that the Windows extension host's setup-local cannot see. *What* Select the installer OS from `process.platform`; keep command-line syntax (separator, echo) from the shell dialect — two independent axes. On Windows we reach the Windows installer via `powershell.exe` (`.exe` so WSL interop resolves it) from cmd and posix shells alike, and `irm | iex` directly inside PowerShell. Also trimmed the install-command comment in extension.ts per the code-conventions review. *Verification* - New unit test covers the Windows + POSIX-dialect (Git Bash/WSL) case; existing per-dialect tests updated to pass the host platform. - `yarn build` clean; full unit suite 1030 passing; `test:lint` clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 13:20 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests triggered for |
*Why* Code review flagged two things on the "Install uv" action: running a remote install script deserves an explicit heads-up, and the Windows path relied on powershell.exe being reachable from a WSL/Git Bash default profile (interop can be disabled), which could strand the Windows uv. *What* - Show a modal confirmation before running the installer, naming the source (astral.sh) and stating that its script executes locally. The terminal only opens if the user confirms. - Pin the install terminal to powershell.exe on Windows via a new pure uvInstallTerminalSpec, so the install no longer depends on the default profile's Windows interop; macOS/Linux keep the default POSIX profile. *Verification* - New unit tests for uvInstallTerminalSpec (Windows pins PowerShell + irm|iex; macOS/Linux default profile + curl install.sh). - yarn build clean; full unit suite 1032 passing; test:lint clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 13:31 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests triggered for |
*Why* Review noted that a pwsh default terminal profile on macOS/Linux is a supported configuration, but the install command was hardcoded to POSIX syntax there — so the printf banner lines would not parse in PowerShell. *What* uvInstallTerminalSpec now takes the resolved shell dialect (default currentShellKind) and uses it for the command syntax on macOS/Linux, so a pwsh profile gets PowerShell syntax (Write-Host, not printf) while still curling the POSIX installer (uv is a *nix build there). Windows is unchanged (pinned to powershell.exe). *Verification* - New unit tests: pwsh-on-macOS/Linux at both the command and spec level; existing POSIX cases pass the dialect explicitly. - yarn build clean; full unit suite 1034 passing; test:lint clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 13:41 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests triggered for |
*Why* Review repeatedly noted the "Install uv" command handler's gate logic (confirm, then open the terminal) lived untested in activate(). *What* Move the gate into runUvInstall(deps) in uvInstall.ts, with confirm / openTerminal seams; extension.ts wires them to the modal and window.createTerminal. Unit tests now cover both branches: confirm opens one terminal, dismiss opens none. *Verification* - New runUvInstall unit tests (confirm → opens; dismiss → nothing). - yarn build clean; full unit suite 1036 passing; test:lint clean. 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. |
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 13:46 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests ✅ all 41 test jobs passed for |
rugpanov
marked this pull request as ready for review
August 31, 2026 14:46
misha-db
approved these changes
Sep 1, 2026
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.
Why
When
environments setup-localfails withE_UV_MISSING, the failure popup offered a single Install uv button that only opened uv's docs page — the label promised an install but delivered documentation. Users had to leave the editor, read the guide, pick the right installer for their OS, and run it by hand.What
The
E_UV_MISSINGpopup now shows two remediation buttons:Install uv — runs uv's official installer in a VS Code terminal for the current platform:
curl -LsSf https://astral.sh/uv/install.sh | shirm https://astral.sh/uv/install.ps1 | iex(via PowerShell; cmd shells out to it)A short banner explains the step and points the user back at Set up Python environment; the terminal stays open so the installer's own step-by-step output remains readable.
Installation guide — opens the docs page (the previous behavior), for users who prefer to install uv themselves.
Implementation
uvInstall.tsbuilds the per-shell command line from the sharedshellUtilshelpers, so thecurl/irmsplit and the;/&separator are correct across macOS, Linux and Windows.databricks.environment.installUvcommand runs it in a terminal, mirroring the existingaz loginterminal pattern (AzureCliCheck).showErrornow takes an ordered list of remediation actions instead of one;getPythonSetupErrorActionsreturns two forE_UV_MISSINGand one (or none) for every other code. The docs link is single-sourced from the existing per-code action.Verification
uvInstallcommand per shell dialect;getPythonSetupErrorActionstwo-button / one-button / empty cases; wiring renders both buttons in order and dispatches the command-action.yarn build(typecheck) clean; full unit suite 1029 passing;test:lintclean.This pull request and its description were written by Isaac.