Add orthogonal setup-local flags: --no-constraints and --no-dbconnect - #6464
Open
rugpanov wants to merge 1 commit into
Open
Add orthogonal setup-local flags: --no-constraints and --no-dbconnect#6464rugpanov wants to merge 1 commit into
setup-local flags: --no-constraints and --no-dbconnect#6464rugpanov wants to merge 1 commit into
Conversation
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
This was referenced Sep 1, 2026
rclarey
approved these changes
Sep 3, 2026
rclarey
left a comment
Contributor
There was a problem hiding this comment.
Mostly LGTM, but some of the flag combinations have non-obvious consequences to me
--constraints-only+--no-constraintsis nonsense, but I guess we don't want to remove--constraints-onlyfor backwards compatibility?- is
--no-constraints+--no-dbconnect+--no-provisionmeaningful? It seems this does some checks / fetches the constraints artifact but does nothing with it? Is there a case where someone would want all 3 together?
| } | ||
|
|
||
| // Normalize a missing [tool.uv].constraint-dependencies to a non-nil empty | ||
| // slice. A nil ConstraintDeps is reserved as the --no-constraints "leave the |
Contributor
There was a problem hiding this comment.
Why not thread the --no-constraints flag through so we don't need a special signal value? (same is true for other signal values used elsewhere)
*Why* `databricks environments setup-local` had a single `--constraints-only` mode that bundled "skip databricks-connect" with the rest of the setup. Callers need to control the setup axes independently — skip the remote pins, or skip the databricks-connect dependency — so the flags that control them should be orthogonal. *What* Adds two 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. The `--no-constraints` "unmanaged" signal is a nil ConstraintDeps / empty requires-python; parseConstraints 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. *Verification* - Unit tests (libs/localenv): --no-constraints leaves existing pins untouched and omits them greenfield, and parseConstraints normalizes missing constraint-dependencies. - Acceptance goldens: no-constraints and no-dbconnect, 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 3, 2026 15:24
7d3ec5f to
f9ffddd
Compare
setup-local flags (--no-constraints, --no-dbconnect, --no-provision) and a skipped phase statussetup-local flags: --no-constraints and --no-dbconnect
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. Callers
need to control the setup axes independently — skip the remote pins, or skip the
databricks-connect dependency — so the flags that control them should be
orthogonal.
What
Two 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).
The
--no-constraints"unmanaged" signal is anilConstraintDeps/ emptyrequires-python.parseConstraintsnormalizes 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.
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.
Testing
libs/localenv):--no-constraintsleaves existing pins untouchedand omits them greenfield;
parseConstraintsnormalizes a missingconstraint-dependencies.
acceptance/localenv):no-constraintsandno-dbconnectgoldens, plus the refreshed
helpoutput.gofmt,go vet, and fullgo build ./...clean; rebased on latestmain.This pull request and its description were written by Isaac.