Skip to content

Deprecate setup-local --constraints-only in favour of --no-dbconnect - #6470

Open
rugpanov wants to merge 1 commit into
setup-local/orthogonal-flagsfrom
setup-local/deprecate-constraints-only
Open

Deprecate setup-local --constraints-only in favour of --no-dbconnect#6470
rugpanov wants to merge 1 commit into
setup-local/orthogonal-flagsfrom
setup-local/deprecate-constraints-only

Conversation

@rugpanov

@rugpanov rugpanov commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

databricks environments setup-local now offers the orthogonal --no-dbconnect
flag, which skips the databricks-connect dependency with behaviour identical to
the older --constraints-only. Two visible spellings for one behaviour is
confusing, but --constraints-only may already live in users' scripts and CI,
so it can't just be removed.

Stacked on #6464 (which introduced --no-dbconnect).

What

Mark --constraints-only deprecated with 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 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/--project flags). Actual removal is
left as a separate, later step.

Backward compatibility

  • Default runs are byte-for-byte unchanged.
  • --constraints-only still works identically; the only new output is a stderr
    line, so --output json consumers (whose contract is stdout) are unaffected —
    schemaVersion stays 1.

Testing

  • Unit (cmd/environments): a new test asserts --constraints-only stays
    defined but is Hidden and carries the use --no-dbconnect instead
    deprecation message.
  • Acceptance (acceptance/localenv): regenerated goldens — --constraints-only
    dropped from the help listing; the constraints-only and
    constraints-only-existing runs now show the stderr deprecation line with
    stdout JSON unchanged.
  • gofmt, go vet ./cmd/environments, go test ./cmd/environments, and
    go build ./... all clean.

This pull request and its description were written by Isaac.

*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
rugpanov force-pushed the setup-local/deprecate-constraints-only branch from 407ed7a to c049d70 Compare September 1, 2026 16:25
@rugpanov
rugpanov marked this pull request as ready for review September 2, 2026 07:40
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/localenv/ - needs approval

Files: acceptance/localenv/constraints-only-existing/output.txt, acceptance/localenv/constraints-only/output.txt, acceptance/localenv/help/output.txt
Suggested: @anton-107
Also eligible: @rclarey, @misha-db

/cmd/environments/ - needs approval

Files: cmd/environments/sync.go, cmd/environments/sync_test.go
Suggested: @anton-107
Also eligible: @rclarey, @misha-db

General files (require maintainer)

Files: .nextchanges/cli/setup-local-deprecate-constraints-only.md
Based on git history:

  • @janniklasrose -- recent work in .nextchanges/cli/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rclarey) can approve all areas.
See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant