Skip to content

[VPEX][10] Add --cluster-name target flag - #5961

Merged
rugpanov merged 2 commits into
mainfrom
dbconnect/11-cluster-name
Jul 20, 2026
Merged

[VPEX][10] Add --cluster-name target flag#5961
rugpanov merged 2 commits into
mainfrom
dbconnect/11-cluster-name

Conversation

@rugpanov

@rugpanovrugpanov commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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 Clusters.ListAll with a FilterBy.ClusterStates filter (PENDING/RUNNING/RESTARTING/RESIZING) and matches on name. This intentionally avoids the SDK's Clusters.GetByClusterName, which lists clusters in every state and errors on any name collision: a terminated cluster sharing a name with a live one would otherwise block resolution for a name the user reasonably considers unique. An unknown name (no active match) or an ambiguous name (more than one active cluster shares it) is 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), plus cluster-name-ambiguous and cluster-name-unknown (both 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.

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 8e83519

Run: 29732251121

Env💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4422711254:40
💚​aws windows4422911239:10
💚​aws-ucws linux4431410425:59
💚​aws-ucws windows4431610407:52
💚​azure linux4422711244:22
💚​azure windows4422911226:44
💚​azure-ucws linux4431610396:33
💚​azure-ucws windows4431810378:13
💚​gcp linux4422611263:58
💚​gcp windows4422811246:42
8 interesting tests: 4 RECOVERED, 4 SKIP
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💚​R💚​R
💚​TestFetchRepositoryInfoAPI_FromRepo/subdir💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 10 slowest tests (at least 2 minutes):
durationenvtestname
8:31aws windowsTestAccept
6:34azure-ucws windowsTestAccept
6:19azure windowsTestAccept
6:18gcp windowsTestAccept
6:17aws-ucws windowsTestAccept
3:00aws linuxTestAccept
2:53gcp linuxTestAccept
2:52azure linuxTestAccept
2:48aws-ucws linuxTestAccept
2:47azure-ucws linuxTestAccept

rugpanov added a commit that referenced this pull request Jul 17, 2026
…--cluster-name in no-target guidance
Review of #5961 (isaac major + codex P3):
- GetClusterByName no longer uses the SDK's GetByClusterName, which lists
clusters in every state and errors on any name collision — a terminated
cluster sharing a name with a live one would spuriously block resolution.
List only non-terminated clusters (ListClustersFilterBy) and match by
name; a name still ambiguous among active clusters, or matching none, is
a genuine E_RESOLVE.
- noTargetMessage now includes --cluster-name so the no-target guidance
lists every valid target flag.
- Acceptance: cluster-name-ambiguous now models two RUNNING clusters
(genuine ambiguity) with the clearer error; no-target and json-error
goldens updated.
Co-authored-by: Isaac

@anton-107anton-107 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as part of the full stack (#5960#5965). The --cluster-name path resolves correctly (name→ID→env key, source=cluster), and it joins both the Cobra exclusion group and the library-path ValidateTargetFlags/bundle-fallback guards. Approving.

Findings to consider (none blocking):

  • [low] Error leaks an internal Go type name to end users. The ambiguous/unknown-name errors surface the raw SDK message verbatim, e.g. there are 2 instances of ClusterDetails named 'dup' (see golden acceptance/localenv/cluster-name-ambiguous/output.txt:2). ClusterDetails is an SDK struct name; a user-facing CLI shouldn't expose it. Consider rewrapping, e.g. "2 clusters are named 'dup'; pass --cluster-id to disambiguate".

  • [low] GetByClusterName loads all clusters and misses long-terminated ones. The SDK's Clusters.GetByClusterName calls ListAll (paginates every cluster into memory), and the backing List API omits clusters terminated >30 days — so a valid-but-long-terminated cluster name yields "does not exist". This is inherent to name resolution (there's no get-by-name endpoint; names aren't unique), so impact is low, but a one-line comment on GetClusterByName noting the >30-day caveat would help the next reader.

  • [low] Test coverage: only the ambiguous path is exercised.TestResolveClusterNameFlagError and the acceptance dir cover the ambiguous error; the unknown-name branch (ClusterDetails named 'X' does not exist) has no unit or acceptance case, though the description says both failure modes are covered. Worth one more case since the two share a single wrapping branch.

  • [nit] Stale precedence comment.ResolveTarget's doc comment (libs/localenv/target.go:64) still lists precedence as --cluster-id → --serverless-version → --job-id → bundle, omitting the --cluster-name branch this PR inserts between cluster-id and serverless. Harmless to correctness (flags are mutually exclusive) but misleads a reader. (#5964 updated the sibling TargetInfo doc for "five flag sources" but left this one.)

Reviewed with AI assistance (build + unit tests + adversarial verification against the checked-out top of stack).

@rugpanov
rugpanovforce-pushed the dbconnect/10-flag-renames branch 2 times, most recently from a84ab00 to 97a0ec4CompareJuly 20, 2026 08:56
rugpanov added a commit that referenced this pull request Jul 20, 2026
…--cluster-name in no-target guidance
Review of #5961 (isaac major + codex P3):
- GetClusterByName no longer uses the SDK's GetByClusterName, which lists
clusters in every state and errors on any name collision — a terminated
cluster sharing a name with a live one would spuriously block resolution.
List only non-terminated clusters (ListClustersFilterBy) and match by
name; a name still ambiguous among active clusters, or matching none, is
a genuine E_RESOLVE.
- noTargetMessage now includes --cluster-name so the no-target guidance
lists every valid target flag.
- Acceptance: cluster-name-ambiguous now models two RUNNING clusters
(genuine ambiguity) with the clearer error; no-target and json-error
goldens updated.
Follow-up review (anton-107, #5961):
- Note on GetClusterByName that clusters/list omits clusters terminated
>30 days ago, so such a name resolves as "no active cluster named".
- Fix the ResolveTarget precedence doc comment to include the
--cluster-name branch this PR inserts.
- Add cluster-name-unknown acceptance case covering the unknown-name
branch (0 matches), the counterpart to cluster-name-ambiguous.
Co-authored-by: Isaac
@rugpanov
rugpanovforce-pushed the dbconnect/11-cluster-name branch from 08c5535 to e5e16abCompareJuly 20, 2026 09:17
@rugpanov

Copy link
Copy Markdown
ContributorAuthor

Thanks for the detailed pass. Addressed the follow-up findings:

  • [low] ClusterDetails leak — already resolved: the ambiguous/unknown errors now read there are N active clusters named "X"; use --cluster-id to disambiguate / no active cluster named "X". No SDK type name reaches the user (the remaining ClusterDetails occurrence is arbitrary stub input in a unit test).
  • [low] >30-day terminated caveat — added a note on GetClusterByName that clusters/list omits clusters terminated >30 days ago, so such a name resolves as "no active cluster named".
  • [low] unknown-name coverage — added acceptance/localenv/cluster-name-unknown exercising the 0-match branch end-to-end, the counterpart to cluster-name-ambiguous.
  • [nit] stale precedence commentResolveTarget doc now lists --cluster-id → --cluster-name → --serverless-version → --job-id → bundle.

Also cascade-rebased onto the updated PR 9 branch.

Base automatically changed from dbconnect/10-flag-renames to mainJuly 20, 2026 09:36
Per the [P0] CLI Changes spec, add --cluster-name as a compute target: it
resolves the cluster name to an ID via the Clusters API and then behaves
identically to --cluster-id (source=cluster, env key from the resolved
cluster's spark_version).
- ComputeClient gains GetClusterByName; sdkCompute implements it via the
SDK's Clusters.GetByClusterName, which errors on an unknown or ambiguous
name (two clusters sharing it) — surfaced as an actionable E_RESOLVE.
- --cluster-name joins the mutually-exclusive target group and the
bundle-fallback guard.
- Unit tests for success, ambiguity, and cluster-id/-name exclusivity;
acceptance tests cluster-name-check (happy path) and
cluster-name-ambiguous (E_RESOLVE), plus the help golden.
Co-authored-by: Isaac
…--cluster-name in no-target guidance
Review of #5961 (isaac major + codex P3):
- GetClusterByName no longer uses the SDK's GetByClusterName, which lists
clusters in every state and errors on any name collision — a terminated
cluster sharing a name with a live one would spuriously block resolution.
List only non-terminated clusters (ListClustersFilterBy) and match by
name; a name still ambiguous among active clusters, or matching none, is
a genuine E_RESOLVE.
- noTargetMessage now includes --cluster-name so the no-target guidance
lists every valid target flag.
- Acceptance: cluster-name-ambiguous now models two RUNNING clusters
(genuine ambiguity) with the clearer error; no-target and json-error
goldens updated.
Follow-up review (anton-107, #5961):
- Note on GetClusterByName that clusters/list omits clusters terminated
>30 days ago, so such a name resolves as "no active cluster named".
- Fix the ResolveTarget precedence doc comment to include the
--cluster-name branch this PR inserts.
- Add cluster-name-unknown acceptance case covering the unknown-name
branch (0 matches), the counterpart to cluster-name-ambiguous.
Co-authored-by: Isaac
@rugpanov
rugpanovforce-pushed the dbconnect/11-cluster-name branch from e5e16ab to 8e83519CompareJuly 20, 2026 09:38
@rugpanov
rugpanov added this pull request to the merge queueJul 20, 2026
Merged via the queue into main with commit 56845c0Jul 20, 2026
23 checks passed
@rugpanov
rugpanov deleted the dbconnect/11-cluster-name branch July 20, 2026 11:05
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.
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 56845c0

Run: 29737385968

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux61234518105438:34
❌​aws windows6134477106754:31
🔄​aws-ucws linux352987864174:03
🔄​aws-ucws windows352929882180:14
🔄​azure linux334518105539:45
🔄​azure windows334475106853:15
🔄​azure-ucws linux352882899149:33
🔄​azure-ucws windows862818917158:41
💚​gcp linux44511106043:02
💚​gcp windows44468107354:06
25 interesting tests: 11 flaky, 6 FAIL, 5 RECOVERED, 2 SKIP, 1 KNOWN
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K🔄​f🔄​f🔄​f🔄​f🔄​f💚​R💚​R💚​R
🔄​TestAccept/bundle/deployment/bind/pipelines/recreate✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/pipelines/recreate/DATABRICKS_BUNDLE_ENGINE=terraform✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p
💚​TestAccept/bundle/invariant/no_drift🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
🔄​TestAccept/bundle/resources/dashboards/change-name🔄​f✅​p🔄​f✅​p🔄​f🔄​f🔄​f🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p🔄​f✅​p✅​p🔄​f✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=terraform🔄​f✅​p✅​p✅​p🔄​f✅​p🔄​f✅​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/quality_monitors/create🙈​s🙈​s✅​p✅​p🙈​s🙈​s✅​p🔄​f🙈​s🙈​s
🔄​TestAccept/bundle/resources/quality_monitors/create/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p🔄​f
🔄​TestAccept/bundle/resources/synced_database_tables/basic🙈​s🙈​s✅​p🔄​f🙈​s🙈​s✅​p✅​p🙈​s🙈​s
🔄​TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct✅​p🔄​f✅​p✅​p
💚​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/combinations/classic✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=yes/PY=no/READPLAN=1✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f✅​p✅​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
13:44gcp linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
13:15gcp windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
12:55gcp windowsTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
12:05aws-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:39aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:55aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:57aws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:32azure windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:29aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:21aws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:20azure-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:18azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:00gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:18azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
7:16aws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:11aws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:04azure linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:53gcp linuxTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:50azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:46azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:37aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
6:29gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:21gcp windowsTestAccept
6:15aws-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
6:15aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
6:00aws-ucws linuxTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=yes/READPLAN=
5:55aws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:46azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
5:44aws-ucws linuxTestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:38aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:36aws-ucws windowsTestAccept/bundle/resources/postgres_roles/update/DATABRICKS_BUNDLE_ENGINE=terraform
5:29azure-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:19aws-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
5:16aws-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:10aws-ucws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
5:09azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:09aws-ucws windowsTestAccept/bundle/resources/postgres_endpoints/update_autoscaling/DATABRICKS_BUNDLE_ENGINE=terraform
5:03aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:01azure windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:58gcp windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:55azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
4:53azure linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:51azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
4:48aws-ucws windowsTestAccept/bundle/resources/postgres_projects/update_display_name/DATABRICKS_BUNDLE_ENGINE=terraform
4:46gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:46azure-ucws linuxTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=no/PY=no/READPLAN=
4:46azure-ucws windowsTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes/READPLAN=
4:45azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:42gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:41gcp linuxTestAccept/bundle/resources/apps/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct

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
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