Skip to content

[VPEX][9] Rename target flags to match spec (--cluster-id, --dry-run, …) - #5960

Merged
rugpanov merged 1 commit into
mainfrom
dbconnect/10-flag-renames
Jul 20, 2026
Merged

[VPEX][9] Rename target flags to match spec (--cluster-id, --dry-run, …)#5960
rugpanov merged 1 commit into
mainfrom
dbconnect/10-flag-renames

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Stacked on #5959 (the command rename).

What

Renames the environments setup-local flags to match the [P0] CLI Changes spec:

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

@rugpanovrugpanov changed the title [VPEX] Rename target flags to match spec (--cluster-id, --dry-run, …)[VPEX][9] Rename target flags to match spec (--cluster-id, --dry-run, …)Jul 17, 2026
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 97a0ec4

Run: 29729606871

Env🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4422711214:45
💚​aws windows4422911196:37
💚​aws-ucws linux4431410385:24
💚​aws-ucws windows4431610367:12
💚​azure linux4422711204:24
💚​azure windows4422911186:52
💚​azure-ucws linux4431610355:52
💚​azure-ucws windows4431810337:42
💚​gcp linux4422611224:00
🔄​gcp windows14422711207:30
9 interesting tests: 4 RECOVERED, 4 SKIP, 1 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
🔄​TestSyncIncrementalFileOverwritesFolder✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p✅​p🔄​f
💚​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
6:38gcp windowsTestAccept
6:28azure-ucws windowsTestAccept
6:27azure windowsTestAccept
6:11aws windowsTestAccept
6:11aws-ucws windowsTestAccept
3:01aws linuxTestAccept
3:01azure linuxTestAccept
2:57gcp linuxTestAccept
2:52aws-ucws linuxTestAccept
2:52azure-ucws linuxTestAccept

@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). Clean, mechanical rename with matching goldens — the flag definitions, GetString/GetBool reads, the mutually-exclusive group, and every user-facing message/hint move together, and the command stays Hidden. Approving.

One low/nit to fold in (here or in a follow-up):

  • [nit] Stale --check references in test files. This PR's description says the internal --check doc comments were updated to --dry-run, but the test files were never touched: libs/localenv/pipeline_test.go (lines 29, 35, 39, 43, 47, 51, 122, 130, 150, 154, 159, 186) and libs/localenv/constraints_test.go (128, 141) still say --check. Several are t.Error/assert-failure messages (e.g. pipeline_test.go:35 "EnsureAvailable must not be called under --check"), so on failure a developer sees a message referencing a flag that no longer exists.

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

Base automatically changed from dbconnect/09-rename-setup-local to mainJuly 20, 2026 08:18
@rugpanov
rugpanovforce-pushed the dbconnect/10-flag-renames branch from 78f2249 to a84ab00CompareJuly 20, 2026 08:52
Per the [P0] CLI Changes spec, rename the setup-local flags:
- --cluster → --cluster-id
- --serverless → --serverless-version
- --job → --job-id
- --check → --dry-run
- --constraint-source → --constraint-source-url (still hidden)
Updates the flag definitions, GetString/GetBool reads, the
mutually-exclusive group, and the user-facing flag names in
ValidateTargetFlags, noTargetMessage, the E_ENV_UNSUPPORTED hint, and the
job-ambiguity errors in compute.go. Internal --check doc comments are
updated to --dry-run for accuracy. Acceptance scripts and goldens
regenerated.
Co-authored-by: Isaac
@rugpanov
rugpanovforce-pushed the dbconnect/10-flag-renames branch from a84ab00 to 97a0ec4CompareJuly 20, 2026 08:56
@rugpanov

Copy link
Copy Markdown
ContributorAuthor

Fixed the stale --check references in both test files (libs/localenv/pipeline_test.go and libs/localenv/constraints_test.go) — all 14 now read --dry-run, including the t.Error/assert-failure messages. Amended into the rename commit and force-pushed. The commit message's claim that internal --check doc comments were updated is now accurate for the test files too.

@rugpanov
rugpanov enabled auto-merge July 20, 2026 09:10
@rugpanov
rugpanov added this pull request to the merge queueJul 20, 2026
Merged via the queue into main with commit bcc0851Jul 20, 2026
23 checks passed
@rugpanov
rugpanov deleted the dbconnect/10-flag-renames branch July 20, 2026 09:36
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: bcc0851

Run: 29732100578

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux61234518105141:57
❌​aws windows6134477106463:53
❌​aws-ucws linux101252977861148:42
❌​aws-ucws windows101252919879195:04
💚​azure linux44520105242:02
💚​azure windows44477106555:32
💚​azure-ucws linux62884896110:50
🔄​azure-ucws windows352824914141:23
💚​gcp linux44511105744:18
💚​gcp windows44468107058:03
28 interesting tests: 16 FAIL, 5 RECOVERED, 4 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💚​R💚​R💚​R🔄​f💚​R💚​R
💚​TestAccept/bundle/invariant/no_drift🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
🔄​TestAccept/bundle/resources/dashboards/change-name🔄​f✅​p✅​p🔄​f✅​p✅​p✅​p🔄​f✅​p✅​p
🔄​TestAccept/bundle/resources/dashboards/change-name/DATABRICKS_BUNDLE_ENGINE=direct🔄​f✅​p✅​p🔄​f✅​p✅​p✅​p🔄​f✅​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/postgres_synced_tables/recreate🙈​s🙈​s🔄​f✅​p🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
🔄​TestAccept/bundle/resources/postgres_synced_tables/recreate/DATABRICKS_BUNDLE_ENGINE=direct🔄​f✅​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/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:07azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
11:57gcp windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:31gcp linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
11:13gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:50aws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
9:32aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
9:14azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:04aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:50azure-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:46aws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
8:41aws-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:33aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:27gcp windowsTestAccept
7:53azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:48aws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:46gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:31azure linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:27azure windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:24aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:22aws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:21azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
7:17aws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:13aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
7:09gcp windowsTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:54aws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:53aws windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:27aws linuxTestAccept/bundle/resources/clusters/deploy/data_security_mode/DATABRICKS_BUNDLE_ENGINE=direct
6:21gcp linuxTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
6:18azure windowsTestAccept
6:07aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
6:06azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:00aws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
5:57azure linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:34azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:31aws-ucws windowsTestAccept/bundle/resources/postgres_databases/update/DATABRICKS_BUNDLE_ENGINE=terraform
5:28aws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:24aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:20aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
5:16aws-ucws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
5:15aws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
5:15azure windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:54gcp windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:47aws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:47azure-ucws windowsTestAccept/bundle/resources/models/basic/DATABRICKS_BUNDLE_ENGINE=terraform
4:46gcp linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:42azure linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
4:41gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:40aws-ucws windowsTestAccept/bundle/templates/default-python/combinations/serverless/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=yes/READPLAN=
4:35aws-ucws windowsTestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=no/NBOOK=no/PY=yes/READPLAN=
4:35gcp windowsTestAccept/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#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