Skip to content

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

Merged
rugpanov merged 1 commit into
mainfrom
setup-local/deprecate-constraints-only
Sep 4, 2026
Merged

Deprecate setup-local --constraints-only in favour of --no-dbconnect#6470
rugpanov merged 1 commit into
mainfrom
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.

@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
@rugpanov
rugpanov force-pushed the setup-local/orthogonal-flags branch from 7d3ec5f to f9ffddd Compare September 3, 2026 15:24
Base automatically changed from setup-local/orthogonal-flags to main September 4, 2026 14:28
@rugpanov
rugpanov force-pushed the setup-local/deprecate-constraints-only branch from c049d70 to 0014dfe Compare September 4, 2026 14:50
*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 0014dfe to 6f317ca Compare September 4, 2026 14:54
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6f317ca

Run: 33886507189

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 275 18 6:40
💚​ aws windows 1 277 16 4:37
💚​ azure linux 1 274 18 5:39
💚​ azure windows 1 276 16 3:59
💚​ gcp linux 1 275 18 6:47
💚​ gcp windows 1 277 16 4:19
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:35 aws windows TestAccept
4:16 gcp windows TestAccept
3:57 azure windows TestAccept
3:56 gcp linux TestAccept
3:54 aws linux TestAccept
3:46 azure linux TestAccept

@rugpanov
rugpanov added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 164b1de Sep 4, 2026
33 checks passed
@rugpanov
rugpanov deleted the setup-local/deprecate-constraints-only branch September 4, 2026 15:35
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.

3 participants