Deprecate setup-local --constraints-only in favour of --no-dbconnect - #6470
Open
rugpanov wants to merge 1 commit into
Open
Deprecate setup-local --constraints-only in favour of --no-dbconnect#6470rugpanov wants to merge 1 commit into
rugpanov wants to merge 1 commit into
Conversation
*Why*
`databricks environments setup-local` now has the orthogonal `--no-dbconnect`
flag, which skips the databricks-connect dependency with identical behaviour to
the older `--constraints-only`. Keeping two visible spellings for one behaviour
is confusing, but `--constraints-only` may already live in users' scripts and CI,
so it cannot simply be removed.
*What*
Mark `--constraints-only` deprecated via cobra's `MarkDeprecated`, which hides it
from `--help` and prints a one-line stderr notice ("Flag --constraints-only has
been deprecated, use --no-dbconnect instead") once per run when it is used. The
flag stays defined and its behaviour is unchanged, so existing callers keep
working; actual removal is a separate, later step. Adds a changelog fragment.
*Verification*
- New unit test asserts the flag stays defined but hidden with the deprecation
notice.
- Regenerated acceptance goldens: `--constraints-only` dropped from the `help`
listing; the `constraints-only` and `constraints-only-existing` runs now show
the stderr deprecation line (stdout JSON unchanged, schemaVersion still 1).
- `gofmt`, `go vet ./cmd/environments`, `go test ./cmd/environments`, and
`go build ./...` all clean.
Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
force-pushed
the
setup-local/deprecate-constraints-only
branch
from
September 1, 2026 16:25
407ed7a to
c049d70
Compare
rugpanov
marked this pull request as ready for review
September 2, 2026 07:40
Contributor
Approval status: pending
|
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-localnow offers the orthogonal--no-dbconnectflag, which skips the databricks-connect dependency with behaviour identical to
the older
--constraints-only. Two visible spellings for one behaviour isconfusing, but
--constraints-onlymay already live in users' scripts and CI,so it can't just be removed.
Stacked on #6464 (which introduced
--no-dbconnect).What
Mark
--constraints-onlydeprecated with cobra'sMarkDeprecated, which:--help, andFlag --constraints-only has been deprecated, use --no-dbconnect instead— once per run when the flag is used.The flag stays defined and its behaviour is unchanged, so existing callers keep
working. This matches the repo's existing deprecation pattern (
--compute-id→--cluster-id, and the aitools--global/--projectflags). Actual removal isleft as a separate, later step.
Backward compatibility
--constraints-onlystill works identically; the only new output is a stderrline, so
--output jsonconsumers (whose contract is stdout) are unaffected —schemaVersionstays1.Testing
cmd/environments): a new test asserts--constraints-onlystaysdefined but is
Hiddenand carries theuse --no-dbconnect insteaddeprecation message.
acceptance/localenv): regenerated goldens —--constraints-onlydropped from the
helplisting; theconstraints-onlyandconstraints-only-existingruns now show the stderr deprecation line withstdout JSON unchanged.
gofmt,go vet ./cmd/environments,go test ./cmd/environments, andgo build ./...all clean.This pull request and its description were written by Isaac.