Skip to content

[VPEX][8] Rename local-env to environments setup-local and move to correct package - #5959

Merged
rugpanov merged 2 commits into
mainfrom
dbconnect/09-rename-setup-local
Jul 20, 2026
Merged

[VPEX][8] Rename local-env to environments setup-local and move to correct package#5959
rugpanov merged 2 commits into
mainfrom
dbconnect/09-rename-setup-local

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

What

Renames the local-environment command from databricks local-env python sync to
databricks environments setup-local and moves it into the existing
environments command group, per the updated [P0] CLI Changes spec.

The environments group intentionally spans both server-side environment-resource
APIs and local provisioning, so a local-install verb belongs there rather than in a
standalone top-level group.

Why here (package placement)

cmd/workspace/environments/environments.go is generated (DO NOT EDIT), so the
command is attached the same way cmd/apps extends the generated apps group:

  • cmd/environments/ (hand-written, moved from cmd/localenv/) exposes a
    Commands() function returning the setup-local verb.
  • cmd/workspace/environments/overrides.go (new, non-generated) has an init()
    that appends to the generated group's cmdOverrides hook, attaching the command.
  • The standalone cli.AddCommand(localenv.New()) is dropped from cmd/cmd.go.

Changes

  • Command tree:local-env python syncenvironments setup-local. The python
    subgroup is removed — P0 is Python-only with no language selector (a language axis
    like setup-local python would be additive later; nothing is reserved now).
  • Constants:CommandGroup/CommandVerb/CommandName updated in
    libs/localenv/result.go; JSON command field is now "environments setup-local".
  • Managed markers: the pyproject.toml managed-block markers now derive from
    CommandName (they previously hard-coded the old name and are written into user
    files), so the command name lives in exactly one place.
  • Still hidden: the command remains Hidden until the environment constraints
    repository is public — unchanged behavior from before the rename.
  • Regenerated acceptance goldens + help output.

Out of scope (deliberate)

  • Flag renames (--cluster--cluster-id, --serverless--serverless-version,
    --job--job-id, --check--dry-run, --constraint-source
    --constraint-source-url) — the spec renames these too, but they are a separate
    follow-up to keep this PR to the command rename + package move.
  • The libs/localenv package name and acceptance/localenv/ directory name are left
    as-is (internal, not user-visible; renaming is cosmetic churn).

Interaction with the stack

#5835 ([VPEX][8/8], held in draft until the constraints repo is public) unhides and
documents this command under its old name. Whichever lands second must reconcile:
the changelog fragment and the Hidden flag should reflect environments setup-local.

Testing

  • go build ./..., lint (0 issues), deadcode clean
  • libs/localenv + cmd/environments unit tests pass
  • acceptance/localenv + acceptance/help regenerated and green
  • Verified databricks environments setup-local is runnable, appears under the
    environments group when unhidden, and stays out of help while Hidden

This pull request and its description were written by Isaac.

The command is renamed from `local-env python sync` to
`environments setup-local` and relocated under the existing (generated)
`environments` command group, per the updated spec: that group spans both
server-side environment-resource APIs and local provisioning, so a
local-install verb belongs there.
- Move cmd/localenv → cmd/environments, exposing Commands() (mirrors how
cmd/apps extends the generated apps group).
- Attach it to the generated group via a new, non-generated
cmd/workspace/environments/overrides.go that appends to cmdOverrides;
drop the standalone cli.AddCommand(localenv.New()) from cmd/cmd.go.
- P0 is Python-only with no language selector, so the `python` subgroup is
removed and the verb is bare `setup-local` (a language axis would be
additive). Command stays Hidden until the constraints repo is public.
- Update the command-name constants (CommandGroup/CommandVerb/CommandName)
and derive the pyproject managed-block markers from CommandName so the
name lives in one place.
- Flag names are unchanged in this PR (--cluster/--serverless/--job/--check/
--constraint-source); the spec's flag renames are a separate follow-up.
- Regenerate acceptance goldens and help output.
Co-authored-by: Isaac
Audit follow-up for the local-env → environments setup-local rename:
- pipeline.go: the --debug log line was prefixed with the literal old
name 'local-env:'; derive the prefix from CommandName so it tracks the
command name (now 'environments setup-local:').
- sync.go: fix two stale doc comments (the runPipeline doc and the
Hidden-flag rationale referencing the removed 'local-env group').
- Rename newSyncCommand → newSetupLocalCommand so the constructor matches
the verb.
- overrides.go: reword comment to 'local-provisioning commands'.
No user-facing behavior change; goldens unaffected (the debug prefix is
not captured by acceptance output).
Co-authored-by: Isaac
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 1a5d74e

Run: 29580294425

Env🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4422711204:51
💚​aws windows4422911188:57
💚​aws-ucws linux4431610366:07
💚​aws-ucws windows4431810347:44
💚​azure linux4422711194:45
💚​azure windows4422911179:06
💚​azure-ucws linux4431810336:47
💚​azure-ucws windows4432010318:02
🔄​gcp linux22422611216:20
💚​gcp windows4422811199:03
8 interesting tests: 4 SKIP, 2 RECOVERED, 2 flaky
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
💚​TestAccept💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🙈​TestAccept/bundle/invariant/no_drift🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/ssh/connection🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🔄​TestFetchRepositoryInfoAPI_FromRepo/root💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R🔄​f💚​R
🔄​TestFetchRepositoryInfoAPI_FromRepo/subdir💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R🔄​f💚​R
Top 10 slowest tests (at least 2 minutes):
durationenvtestname
8:40azure windowsTestAccept
8:38gcp windowsTestAccept
8:30aws windowsTestAccept
6:24azure-ucws windowsTestAccept
6:19aws-ucws windowsTestAccept
2:57azure linuxTestAccept
2:57gcp linuxTestAccept
2:57aws linuxTestAccept
2:53azure-ucws linuxTestAccept
2:51aws-ucws linuxTestAccept

@rugpanov
rugpanov requested a review from anton-107July 17, 2026 12:27
@rugpanov

Copy link
Copy Markdown
ContributorAuthor

Got approval from Harry Doan.

@rugpanov
rugpanov added this pull request to the merge queueJul 20, 2026
Merged via the queue into main with commit dd867acJul 20, 2026
25 checks passed
@rugpanov
rugpanov deleted the dbconnect/09-rename-setup-local branch July 20, 2026 08:18
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: dd867ac

Run: 29727489420

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux6134520105046:15
❌​aws windows61234475106359:33
❌​aws-ucws linux1015297986092:37
❌​aws-ucws windows12152919878135:53
🔄​azure linux334518105143:30
💚​azure windows44477106454:17
💚​azure-ucws linux6288489573:18
💚​azure-ucws windows62826913111:04
🔄​gcp linux334509105642:37
💚​gcp windows44468106955:51
29 interesting tests: 18 FAIL, 5 RECOVERED, 3 flaky, 2 SKIP, 1 KNOWN
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🟨​K🟨​K🔄​f💚​R💚​R💚​R🔄​f💚​R
💚​TestAccept/bundle/invariant/no_drift🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
❌​TestAccept/bundle/resources/dashboards/change-name✅​p🔄​f✅​p❌​F🔄​f✅​p✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=direct✅​p🔄​f✅​p❌​F✅​p✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions❌​F❌​F✅​p✅​p🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions❌​F❌​F✅​p✅​p🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform❌​F❌​F✅​p✅​p
❌​TestAccept/bundle/resources/postgres_branches/update_protected🙈​s🙈​s❌​F❌​F🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/postgres_branches/update_protected/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F
❌​TestAccept/bundle/resources/postgres_databases/update🙈​s🙈​s❌​F❌​F🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/postgres_databases/update/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F
❌​TestAccept/bundle/resources/postgres_endpoints/update_autoscaling🙈​s🙈​s❌​F❌​F🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/postgres_endpoints/update_autoscaling/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F
❌​TestAccept/bundle/resources/postgres_projects/update_display_name🙈​s🙈​s❌​F❌​F🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/postgres_projects/update_display_name/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F
❌​TestAccept/bundle/resources/postgres_roles/update🙈​s🙈​s❌​F❌​F🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/postgres_roles/update/DATABRICKS_BUNDLE_ENGINE=direct❌​F❌​F
💚​TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
🙈​TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🔄​TestAccept/bundle/templates/default-python/integration_classic✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
🔄​TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct/UV_PYTHON=3.9✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p
🙈​TestAccept/ssh/connection🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestFetchRepositoryInfoAPI_FromRepo💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFetchRepositoryInfoAPI_FromRepo/root💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestFetchRepositoryInfoAPI_FromRepo/subdir💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 50 slowest tests (at least 2 minutes):
durationenvtestname
12:03gcp windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:37gcp linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
10:56azure linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:47aws-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
9:37azure linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:34gcp windowsTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
9:12azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
8:57azure windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
8:48azure linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
8:39aws-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:36azure-ucws windowsTestAccept
8:35azure windowsTestAccept
8:30aws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:18gcp windowsTestAccept
8:17gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:12aws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:02aws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:47azure-ucws windowsTestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=
7:20azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:19aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:19aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
7:17azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
7:15azure windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:13azure-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:10aws linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
7:08aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:04azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:55aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:50aws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:44gcp linuxTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:44azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:42azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:38aws-ucws windowsTestAccept/bundle/resources/clusters/resize-terminated-fallback/DATABRICKS_BUNDLE_ENGINE=direct
6:32gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:09azure windowsTestAccept/bundle/resources/clusters/resize-terminated-fallback/DATABRICKS_BUNDLE_ENGINE=direct
5:58aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
5:48gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:41azure linuxTestAccept/bundle/resources/clusters/resize-terminated-fallback/DATABRICKS_BUNDLE_ENGINE=direct
5:27aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:26azure-ucws linuxTestAccept/bundle/resources/clusters/deploy/data_security_mode/DATABRICKS_BUNDLE_ENGINE=direct
5:21azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
5:14aws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
5:11aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:08azure windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
5:07aws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:55gcp linuxTestAccept/bundle/resources/apps/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:49aws-ucws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
4:47gcp linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:45azure-ucws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:44gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct

pietern pushed a commit that referenced this pull request Jul 20, 2026
Stacked on #5960 (flag renames), which is stacked on #5959 (command
rename).
## What
Adds `--cluster-name` as a compute target for `environments
setup-local`, per the `[P0] CLI Changes` spec. It resolves the cluster
**name** to an **ID** via the Clusters API, then resolves identically to
`--cluster-id` (`source=cluster`, env key from the resolved cluster's
`spark_version`).
## Changes
- `ComputeClient` gains `GetClusterByName`; `sdkCompute` implements it
via the SDK's `Clusters.GetByClusterName`, which errors on an
**unknown** or **ambiguous** name (two clusters sharing it) — both
surfaced as an actionable `E_RESOLVE`.
- `--cluster-name` joins the mutually-exclusive target group
(`--cluster-id`/`--cluster-name`/`--serverless-version`/`--job-id`) and
the bundle-fallback guard.
- New `ResolveTarget` precedence branch after `--cluster-id`.
## Testing
- Unit tests: success (name→ID→env key), ambiguity → `E_RESOLVE`, and
`--cluster-id`/`--cluster-name` mutual exclusivity.
- Acceptance: `cluster-name-check` (happy path, stubbed `clusters/list`)
and `cluster-name-ambiguous` (`E_RESOLVE`); help golden updated.
- `go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green.
This pull request and its description were written by Isaac.
yansonggao-db pushed a commit to yansonggao-db/cli that referenced this pull request Jul 21, 2026
…icks#5965)
Stacked on databricks#5964databricks#5963databricks#5962databricks#5961databricks#5960databricks#5959.
## What
`--serverless-version` is now documented to take a **bare number** (e.g.
`5`) rather than `v5`.
- Input `5` is the documented form; `v5`/`V5` are still accepted
(tolerant).
- Both map to the same env key `serverless/serverless-vN`, so the
**environments-repo layout is unchanged** (still
`serverless/serverless-v5/…`).
## Changes
- Flag help: `e.g. v4` → `e.g. 5`; the `E_ENV_UNSUPPORTED` hint suggests
`--serverless-version 5`.
- `defaultServerlessVersion` stored in bare form (`"5"`); still resolves
to `serverless-v5` via `NormalizeServerless`.
- Acceptance scripts pass the bare form; env-key goldens unchanged
(`serverless-vN`).
- Unit tests cover bare + v-prefixed input and the default constant.
## Testing
`go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green.
This pull request and its description were written by Isaac.
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
… …) (databricks#5960)
Stacked on databricks#5959 (the command rename).
## What
Renames the `environments setup-local` flags to match the `[P0] CLI
Changes` spec:
| Old | New |
|-----|-----|
| `--cluster` | `--cluster-id` |
| `--serverless` | `--serverless-version` |
| `--job` | `--job-id` |
| `--check` | `--dry-run` |
| `--constraint-source` | `--constraint-source-url` (still hidden) |
## Changes
- Flag definitions, `GetString`/`GetBool` reads, and the
mutually-exclusive group in `cmd/environments/sync.go`.
- User-facing flag names in `ValidateTargetFlags`, `noTargetMessage`,
the `E_ENV_UNSUPPORTED` hint (`constraints.go`), and the job-ambiguity
errors (`compute.go`).
- Internal `--check` doc comments updated to `--dry-run` for accuracy.
- Acceptance scripts + goldens regenerated.
No behavior change beyond the flag spellings; the command stays
`Hidden`.
## Testing
`go build ./...`, lint (0 issues), deadcode clean, `libs/localenv` +
`cmd/environments` unit tests, `acceptance/localenv` + `acceptance/help`
regenerated and green.
This pull request and its description were written by Isaac.
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
Stacked on databricks#5960 (flag renames), which is stacked on databricks#5959 (command
rename).
## What
Adds `--cluster-name` as a compute target for `environments
setup-local`, per the `[P0] CLI Changes` spec. It resolves the cluster
**name** to an **ID** via the Clusters API, then resolves identically to
`--cluster-id` (`source=cluster`, env key from the resolved cluster's
`spark_version`).
## Changes
- `ComputeClient` gains `GetClusterByName`; `sdkCompute` implements it
via the SDK's `Clusters.GetByClusterName`, which errors on an
**unknown** or **ambiguous** name (two clusters sharing it) — both
surfaced as an actionable `E_RESOLVE`.
- `--cluster-name` joins the mutually-exclusive target group
(`--cluster-id`/`--cluster-name`/`--serverless-version`/`--job-id`) and
the bundle-fallback guard.
- New `ResolveTarget` precedence branch after `--cluster-id`.
## Testing
- Unit tests: success (name→ID→env key), ambiguity → `E_RESOLVE`, and
`--cluster-id`/`--cluster-name` mutual exclusivity.
- Acceptance: `cluster-name-check` (happy path, stubbed `clusters/list`)
and `cluster-name-ambiguous` (`E_RESOLVE`); help golden updated.
- `go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green.
This pull request and its description were written by Isaac.
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
Stacked on databricks#5961 (`--cluster-name`) → databricks#5960databricks#5959.
## What
Per the `[P0] CLI Changes` spec, the serverless stand-in used when the
source does not pin a version is now **`serverless-v5`** (was `v4`).
Applies only to the fallback cases:
- a serverless `--job-id` whose environment records no version, and
- a bundle that records `serverless` without a version.
Explicitly passing `--serverless-version <vN>` is unaffected.
## Changes
- Introduce `defaultServerlessVersion = "v5"` in `envkey.go`, used at
both fallback sites in `target.go` so the default lives in one place.
- Update the two unit tests that assert the default.
No acceptance goldens change: all serverless acceptance tests pass
`--serverless-version v4` explicitly, so none exercise the default path.
## Note
VS Code resolves the real serverless version itself and passes
`--serverless-version` explicitly (spec §63), so this fallback is only
hit when the version is genuinely unknown — but v5 is now the correct
stand-in per spec.
This pull request and its description were written by Isaac.
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
Stacked on databricks#5962 (serverless-v5) → databricks#5961databricks#5960databricks#5959.
## What
Per the `[P0] CLI Changes` spec, a bad-flags usage error is now surfaced
as **`E_USAGE`** at the **preflight** phase, through the phase/JSON
contract — instead of a bare Cobra mutual-exclusion error printed before
`RunE` (which produces no command JSON object).
## Why
The VS Code extension branches on the JSON `error.code`. Previously,
passing two target flags triggered Cobra's `MarkFlagsMutuallyExclusive`
*before* `RunE`, so `--output json` emitted nothing structured. Now the
conflict is caught inside the pipeline and reported like any other phase
failure.
## Changes
- Add the `E_USAGE` error code.
- Validate target flags at the top of the pipeline's preflight →
`E_USAGE`, `diskMutated=false`.
- Drop `cmd.MarkFlagsMutuallyExclusive` and the redundant early-return
in `runPipeline` so the conflict flows into the pipeline.
- `flag-conflict` golden updated (now shows the phase table + preflight
error); new `flag-conflict-json` asserts `error{code:"E_USAGE",
failurePhase:"preflight"}`; pipeline unit test for the path.
## Testing
`go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green.
This pull request and its description were written by Isaac.
tanishgupta-db pushed a commit to tanishgupta-db/cli that referenced this pull request Jul 21, 2026
…ricks#5964)
Stacked on databricks#5963 (E_USAGE) → databricks#5962databricks#5961databricks#5960databricks#5959.
## What
Reconciles the error codes with the `[P0] CLI Changes` spec table (spec
item databricks#10). **No behavior change** — the code already emits the correct
set. The spec's table was stale:
- omitted `E_NOT_WRITABLE` (preflight) and `E_PYTHON_INSTALL`
(provision), and
- wrongly listed `E_UV_MISSING` as "reserved / not emitted" when the CLI
does emit it at preflight.
## Changes
- Annotate each `ErrorCode` constant with the phase that emits it, and
document the two spec codes the CLI deliberately never emits:
`E_PYTHON_POLICY` (no signal source yet) and `E_AUTH` (handled earlier
by `MustWorkspaceClient`). This makes the constant block the
authoritative reference the spec mirrors.
- Fix a `TargetInfo` doc comment that still said "four precedence
sources" — with `--cluster-name` there are now five flag sources (the
JSON `source` value is still one of cluster/serverless/job/bundle).
## Note
The spec doc's error-code table itself (in the VPEX ERD, a Google Doc)
has been updated separately to match — that's outside this repo.
## Testing
`go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green (comment-only code change).
This pull request and its description were written by Isaac.
Sign up for freeto 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

@rugpanov@eng-dev-ecosystem-bot@anton-107