Add orthogonal setup-local flags (--no-constraints, --no-dbconnect, --no-provision) and a skipped phase status - #6464
Open
rugpanov wants to merge 1 commit into
Open
Add orthogonal setup-local flags (--no-constraints, --no-dbconnect, --no-provision) and a skipped phase status#6464rugpanov wants to merge 1 commit into
setup-local flags (--no-constraints, --no-dbconnect, --no-provision) and a skipped phase status#6464rugpanov wants to merge 1 commit into
Conversation
*Why* `databricks environments setup-local` had a single `--constraints-only` mode that bundled "skip databricks-connect" together with the rest of the setup. A caller (the VS Code extension, agents) that wants to write project files but defer provisioning, or manage its own dependency pins, had no way to express that. The setup steps are independent, so the flags that control them should be too. *What* Adds three orthogonal, composable negative flags: - `--no-constraints` skips writing the remote Python-version and dependency pins (requires-python and the [tool.uv] constraint block); any existing values are left untouched, and provisioning still installs the resolved Python (the flag governs only what is written). - `--no-dbconnect` skips the databricks-connect dependency. Equivalent to the existing `--constraints-only`, which stays as-is for now. - `--no-provision` writes the project files through the merge phase, then stops: no Python download, uv sync, or validation. Because it never invokes uv, its preflight no longer requires or installs uv either — a files-only run works on a machine without uv. Introduces a new `skipped` phase status (distinct from `pending`, which means an earlier phase failed): the provision and validate phases report `skipped` under `--no-provision`, `venvPath` is omitted, and the dry-run plan drops `wouldInstallPython`. The text summary gains a dedicated "provisioning skipped" variant so it no longer prints an empty venv path or a broken activation hint. The `--no-constraints` "unmanaged" signal is a nil ConstraintDeps / empty requires-python; parseConstraints now normalizes a missing [tool.uv].constraint-dependencies to a non-nil empty slice so that nil uniquely means the flag, not merely an artifact that omits the section. Default runs (no new flags) are byte-for-byte unchanged; the JSON schemaVersion stays at 1 since the new status only appears when a new flag is passed. *Verification* - Unit tests (libs/localenv): no-provision writes files then skips provision/validate without invoking uv, dry-run plus no-provision marks them skipped and drops wouldInstallPython, no-constraints leaves existing pins untouched and omits them greenfield, parseConstraints normalizes missing constraint-dependencies, and the merge/render skip guards. - Acceptance goldens: no-provision (real run), no-constraints, no-dbconnect, no-provision-dry-run, no-provision-text, plus the refreshed help output. - gofmt, go vet, and full go build ./... clean. Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
force-pushed
the
setup-local/orthogonal-flags
branch
from
September 1, 2026 15:20
70c6da8 to
d1aad7e
Compare
rugpanov
marked this pull request as ready for review
September 1, 2026 15:45
Contributor
Approval status: pending
|
This was referenced 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
databricks environments setup-localhad a single--constraints-onlymode thatbundled "skip databricks-connect" together with the rest of the setup. A caller
that wants to write the project files but defer provisioning, or manage its own
dependency pins, had no way to express that. The setup steps are independent, so
the flags that control them should be too.
What
Three orthogonal, composable negative flags:
--no-constraints— skip writing the remote Python-version and dependencypins (
requires-pythonand the[tool.uv]constraint block). Existing valuesare left untouched, and (when provisioning) the resolved Python is still
installed — the flag only governs what is written.
--no-dbconnect— skip the databricks-connect dependency. Equivalent tothe existing
--constraints-only, which is left in place for now (either flagtriggers the same behaviour).
--no-provision— write the project files through the merge phase, thenstop: no Python download,
uv sync, or validation. Because it never invokesuv, its preflight no longer requires or installs uv either, so a files-only run
works on a machine without uv.
A new
skippedphase status (distinct frompending, which means an earlierphase failed) is reported for the provision and validate phases under
--no-provision;venvPathis omitted and the--dry-runplan dropswouldInstallPython. The text summary gains a dedicated "provisioning skipped"variant so it no longer prints an empty venv path or a broken activation hint.
The
--no-constraints"unmanaged" signal is anilConstraintDeps/ emptyrequires-python.parseConstraintsnow normalizes a missing[tool.uv].constraint-dependenciesto a non-nil empty slice, soniluniquelymeans the flag rather than an artifact that simply omits the section.
Note on
--no-constraints+ provisioning--no-constraintsgoverns only what is written. A provisioning run still installsand validates the resolved Python, so if a user's kept
requires-pythonisdisjoint from the target, uv surfaces it as a normal
E_PROVISIONrather than thecommand guessing an alternative. The
--no-constraints --no-provisionpairingskips provisioning entirely and avoids that tension.
Backward compatibility
Default runs (no new flags) produce byte-for-byte identical output and behaviour
— every existing acceptance golden is unchanged except the refreshed
--helplisting. The
--output jsonschemaVersionstays at1: the newskippedstatus only ever appears when one of the new flags is passed.
Testing
libs/localenv):--no-provisionwrites files then skipsprovision/validate without invoking uv;
--dry-run --no-provisionmarks themskipped and drops
wouldInstallPython;--no-constraintsleaves existingpins untouched and omits them greenfield;
parseConstraintsnormalizes amissing constraint-dependencies; merge/render skip guards.
acceptance/localenv): newno-provision(real run),no-constraints,no-dbconnect,no-provision-dry-run, andno-provision-textgoldens, plus the refreshedhelpoutput.gofmt,go vet, and fullgo build ./...clean.This pull request and its description were written by Isaac.