You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up refinements from the
[#5832](#5832) review (all were
left as non-blocking there and deferred with a "will address in a
follow-up" reply). The `local-env` command remains hidden until #5835,
so there is no user-visible changelog entry.
## Changes
- **uv install consent** (`libs/localenv/uv.go`) — `EnsureAvailable` no
longer runs the remote uv installer (`curl … | sh` / `irm … | iex`)
silently. It now requires consent: a truthy
`DATABRICKS_LOCALENV_AUTO_INSTALL_UV` opt-in for non-interactive runs
(CI/IDE), or an interactive `y/N` prompt via `cmdio.AskYesOrNo`. A
non-interactive run without the opt-in returns an actionable error
instead of downloading and executing an installer. (The `--debug` log of
the exact installer command from #5832 is kept.)
- **serverless job version** (`cmd/localenv/compute.go`) —
`GetJobSparkVersion` now reads
`Environments[0].Spec.EnvironmentVersion`, so a serverless `--job`
resolves to its actual `serverless-vN` instead of always defaulting to
v4. Empty still falls back to v4.
- **double bundle load** (`cmd/localenv/sync.go`) — skip `bundleTarget`
when an explicit `--cluster/--serverless/--job` flag is set.
`ResolveTarget` only consults the bundle as a fallback, so the second
`TryConfigureBundle` load (and its re-printed load-time diagnostics) was
wasted for the explicit-flag case.
- **robust `Validate` parse** (`libs/localenv/uv.go`) — the `uv run`
probe now prints `PYVER:` / `DBCVER:` sentinels and parses by prefix
instead of line position, so a stray stdout line from uv doesn't shift
the parse.
- **cleanup** (`libs/localenv/uv.go`) — fold single-caller
`newUvManager` into `NewUvManager`; collapse the triplicated
`resolveIndexURL` + conditional `WithEnv` into one `runUv` helper (the
conditional stays so an already-set `UV_INDEX_URL` isn't clobbered).
## Tests
Adds unit tests for the install consent gate (`TestConfirmUvInstall`)
and the sentinel parse (`TestLineWithPrefix`). Full `libs/localenv`
suite passes, including under a CI-like environment with
`UV_INDEX_URL`/`PIP_INDEX_URL` set.
This pull request and its description were written by Isaac.
return"", false, "", fmt.Errorf("could not determine compute for job %d from its environments or job clusters (task-level compute is not supported); pass --cluster or --serverless explicitly", id)
80
95
}
96
+
97
+
// environmentVersion returns the serverless environment version recorded on a
98
+
// job environment, or "" when the spec or version is absent.
99
+
//
100
+
// The version can arrive in either of two fields. environment_version is the
101
+
// current one; client is its deprecated predecessor ("Use environment_version
102
+
// instead") and is still what some jobs pin. Reading both means the v4 fallback
103
+
// and the divergence guard observe whichever field actually carries the pin,
104
+
// rather than treating a client-pinned job as unversioned. base_environment is
105
+
// deliberately ignored: it is a path/ID, not a version.
"uv is required but not installed; install it (https://docs.astral.sh/uv/getting-started/installation/) or set %s=1 to let this command install it for you", EnvAutoInstallUv)
0 commit comments