From fed33a6107d2be0c1185689c615d473f85bda817 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 24 Apr 2026 12:15:05 +0200 Subject: [PATCH 1/3] Apply upstream patch warehouses update-default-warehouse-override --- cmd/workspace/warehouses/warehouses.go | 33 +++++++------------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/cmd/workspace/warehouses/warehouses.go b/cmd/workspace/warehouses/warehouses.go index 7d64d24a542..ff7160ec8c5 100755 --- a/cmd/workspace/warehouses/warehouses.go +++ b/cmd/workspace/warehouses/warehouses.go @@ -1388,7 +1388,8 @@ func newUpdateDefaultWarehouseOverride() *cobra.Command { } return nil } - return nil + check := root.ExactArgs(3) + return check(cmd, args) } cmd.PreRunE = root.MustWorkspaceClient @@ -1407,29 +1408,13 @@ func newUpdateDefaultWarehouseOverride() *cobra.Command { return err } } - } else { - if len(args) == 0 { - sp := cmdio.NewSpinner(ctx) - sp.Update("No TYPE argument specified. Loading names for Warehouses drop-down.") - names, err := w.Warehouses.EndpointInfoNameToIdMap(ctx, sql.ListWarehousesRequest{}) - sp.Close() - if err != nil { - return fmt.Errorf("failed to load names for Warehouses drop-down. Please manually specify required arguments. Original error: %w", err) - } - id, err := cmdio.Select(ctx, names, "The type of override behavior") - if err != nil { - return err - } - args = append(args, id) - } - if len(args) != 1 { - return fmt.Errorf("expected to have the type of override behavior") - } - updateDefaultWarehouseOverrideReq.Name = args[0] - if args[1] != "" { - updateMaskArray := strings.Split(args[1], ",") - updateDefaultWarehouseOverrideReq.UpdateMask = *fieldmask.New(updateMaskArray) - } + } + updateDefaultWarehouseOverrideReq.Name = args[0] + if args[1] != "" { + updateMaskArray := strings.Split(args[1], ",") + updateDefaultWarehouseOverrideReq.UpdateMask = *fieldmask.New(updateMaskArray) + } + if !cmd.Flags().Changed("json") { _, err = fmt.Sscan(args[2], &updateDefaultWarehouseOverrideReq.DefaultWarehouseOverride.Type) if err != nil { return fmt.Errorf("invalid TYPE: %s", args[2]) From afde2aeefe539c08870f94936875dc0007c91db4 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 24 Apr 2026 12:25:18 +0200 Subject: [PATCH 2/3] Update Makefile --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1b6f058f262..75e7d0860d8 100644 --- a/Makefile +++ b/Makefile @@ -207,8 +207,16 @@ GENKIT_BINARY := $(UNIVERSE_DIR)/bazel-bin/openapi/genkit/genkit_/genkit .PHONY: generate generate: - @echo "Checking out universe at SHA: $$(cat .codegen/_openapi_sha)" - cd $(UNIVERSE_DIR) && git cat-file -e $$(cat $(PWD)/.codegen/_openapi_sha) 2>/dev/null || git fetch --filter=blob:none origin master && git checkout $$(cat $(PWD)/.codegen/_openapi_sha) + @if [ -z "$$UNIVERSE_SKIP_CHECKOUT" ]; then \ + if ! git -C $(UNIVERSE_DIR) diff --quiet || ! git -C $(UNIVERSE_DIR) diff --cached --quiet; then \ + echo "Error: universe repo at $(UNIVERSE_DIR) has uncommitted changes; commit or stash them, or set UNIVERSE_SKIP_CHECKOUT=1 to skip checkout"; \ + exit 1; \ + fi; \ + echo "Checking out universe at SHA: $$(cat .codegen/_openapi_sha)"; \ + cd $(UNIVERSE_DIR) && (git cat-file -e $$(cat $(PWD)/.codegen/_openapi_sha) 2>/dev/null || (git fetch --filter=blob:none origin master && git checkout $$(cat $(PWD)/.codegen/_openapi_sha))); \ + else \ + echo "UNIVERSE_SKIP_CHECKOUT set; using current $(UNIVERSE_DIR) HEAD"; \ + fi @echo "Building genkit..." cd $(UNIVERSE_DIR) && bazel build //openapi/genkit @echo "Generating CLI code..." From 4e6ec200018d52dbaac10f4d0466556f881a6416 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 24 Apr 2026 14:08:35 +0200 Subject: [PATCH 3/3] Add NEXT_CHANGELOG entry for warehouses panic fix Co-authored-by: Isaac --- NEXT_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 2b45922fd75..bb421d5605b 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -7,6 +7,7 @@ * Moved file-based OAuth token cache management from the SDK to the CLI. No user-visible change; part of a three-PR sequence that makes the CLI the sole owner of its token cache. * Added interactive pagination for list commands that have a row template (jobs, clusters, apps, pipelines, etc.). When stdin, stdout, and stderr are all TTYs, `databricks list` now streams 50 rows at a time and prompts `[space] more [enter] all [q|esc] quit`. ENTER can be interrupted by `q`/`esc`/`Ctrl+C` between pages. Colors and alignment match the existing non-paged output; column widths stay stable across pages. Piped output and `--output json` are unchanged. * Added experimental OS-native secure token storage opt-in via `DATABRICKS_AUTH_STORAGE=secure`. Legacy file-backed token storage remains the default. +* Fixed a panic in `databricks warehouses update-default-warehouse-override` when invoked without all required positional arguments (e.g. picking a warehouse from the interactive drop-down and then hitting an index-out-of-range crash). The command now validates arguments up front and returns a usage error. Fixes [#5070](https://github.com/databricks/cli/issues/5070) via [#5079](https://github.com/databricks/cli/pull/5079). ### Bundles