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

@rugpanov rugpanov 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 🙈​skip Time
💚​ aws linux 4 4 227 1125 4:40
💚​ aws windows 4 4 229 1123 9:10
💚​ aws-ucws linux 4 4 314 1042 5:59
💚​ aws-ucws windows 4 4 316 1040 7:52
💚​ azure linux 4 4 227 1124 4:22
💚​ azure windows 4 4 229 1122 6:44
💚​ azure-ucws linux 4 4 316 1039 6:33
💚​ azure-ucws windows 4 4 318 1037 8:13
💚​ gcp linux 4 4 226 1126 3:58
💚​ gcp windows 4 4 228 1124 6:42
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp 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):
duration env testname
8:31 aws windows TestAccept
6:34 azure-ucws windows TestAccept
6:19 azure windows TestAccept
6:18 gcp windows TestAccept
6:17 aws-ucws windows TestAccept
3:00 aws linux TestAccept
2:53 gcp linux TestAccept
2:52 azure linux TestAccept
2:48 aws-ucws linux TestAccept
2:47 azure-ucws linux TestAccept

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-107 anton-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
rugpanov force-pushed the dbconnect/10-flag-renames branch 2 times, most recently from a84ab00 to 97a0ec4 Compare July 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
rugpanov force-pushed the dbconnect/11-cluster-name branch from 08c5535 to e5e16ab Compare July 20, 2026 09:17
@rugpanov

Copy link
Copy Markdown
Contributor Author

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 main July 20, 2026 09:36
rugpanov added 2 commits July 20, 2026 11:37
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
rugpanov force-pushed the dbconnect/11-cluster-name branch from e5e16ab to 8e83519 Compare July 20, 2026 09:38
@rugpanov
rugpanov added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit 56845c0 Jul 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 🙈​skip Time
❌​ aws linux 6 1 2 3 4 518 1054 38:34
❌​ aws windows 6 1 3 4 477 1067 54:31
🔄​ aws-ucws linux 3 5 2 987 864 174:03
🔄​ aws-ucws windows 3 5 2 929 882 180:14
🔄​ azure linux 3 3 4 518 1055 39:45
🔄​ azure windows 3 3 4 475 1068 53:15
🔄​ azure-ucws linux 3 5 2 882 899 149:33
🔄​ azure-ucws windows 8 6 2 818 917 158:41
💚​ gcp linux 4 4 511 1060 43:02
💚​ gcp windows 4 4 468 1073 54:06
25 interesting tests: 11 flaky, 6 FAIL, 5 RECOVERED, 2 SKIP, 1 KNOWN
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp 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):
duration env testname
13:44 gcp linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
13:15 gcp windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
12:55 gcp windows TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
12:05 aws-ucws windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:39 aws-ucws linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:55 aws-ucws linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:57 aws linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:32 azure windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:29 aws-ucws windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:21 aws windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:20 azure-ucws windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:18 azure-ucws linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:00 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:18 azure-ucws linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
7:16 aws linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:11 aws windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:04 azure linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:53 gcp linux TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:50 azure-ucws windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:46 azure-ucws linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:37 aws-ucws windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
6:29 gcp linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:21 gcp windows TestAccept
6:15 aws-ucws linux TestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
6:15 aws-ucws linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
6:00 aws-ucws linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=yes/READPLAN=
5:55 aws windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:46 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
5:44 aws-ucws linux TestAccept/bundle/resources/registered_models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:38 aws-ucws linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:36 aws-ucws windows TestAccept/bundle/resources/postgres_roles/update/DATABRICKS_BUNDLE_ENGINE=terraform
5:29 azure-ucws windows TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:19 aws-ucws linux TestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
5:16 aws-ucws windows TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:10 aws-ucws windows TestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
5:09 azure-ucws linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:09 aws-ucws windows TestAccept/bundle/resources/postgres_endpoints/update_autoscaling/DATABRICKS_BUNDLE_ENGINE=terraform
5:03 aws-ucws linux TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:01 azure windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:58 gcp windows TestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:55 azure-ucws linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
4:53 azure linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:51 azure-ucws linux TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
4:48 aws-ucws windows TestAccept/bundle/resources/postgres_projects/update_display_name/DATABRICKS_BUNDLE_ENGINE=terraform
4:46 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:46 azure-ucws linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=no/PY=no/READPLAN=
4:46 azure-ucws windows TestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes/READPLAN=
4:45 azure-ucws windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:42 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:41 gcp linux TestAccept/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 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