From 062f3a0d8c7ad141ac8679b40b3b4e7e4c720120 Mon Sep 17 00:00:00 2001 From: Pavlo Kozlov Date: Tue, 12 May 2026 14:22:24 +0200 Subject: [PATCH] cmd/bundle: remove `summary --show-full-config` The hidden `--show-full-config` flag has been superseded by `bundle debug list-targets`. Drop the flag, its handler, and the corresponding acceptance test directory. --- .../summary/show-full-config/databricks.yml | 19 --- .../summary/show-full-config/out.test.toml | 3 - .../summary/show-full-config/output.txt | 135 ------------------ .../resources/my_dashboard.dashboard.yml | 6 - .../bundle/summary/show-full-config/script | 1 - .../src/my_dashboard.lvdash.json | 1 - .../show-full-config/targets/default.yml | 4 - .../show-full-config/targets/not_default.yml | 3 - .../targets/variable_default.yml | 3 - .../targets/variable_mode.yml | 3 - .../bundle/summary/show-full-config/test.toml | 3 - cmd/bundle/summary.go | 72 ++-------- 12 files changed, 12 insertions(+), 241 deletions(-) delete mode 100644 acceptance/bundle/summary/show-full-config/databricks.yml delete mode 100644 acceptance/bundle/summary/show-full-config/out.test.toml delete mode 100644 acceptance/bundle/summary/show-full-config/output.txt delete mode 100644 acceptance/bundle/summary/show-full-config/resources/my_dashboard.dashboard.yml delete mode 100644 acceptance/bundle/summary/show-full-config/script delete mode 100644 acceptance/bundle/summary/show-full-config/src/my_dashboard.lvdash.json delete mode 100644 acceptance/bundle/summary/show-full-config/targets/default.yml delete mode 100644 acceptance/bundle/summary/show-full-config/targets/not_default.yml delete mode 100644 acceptance/bundle/summary/show-full-config/targets/variable_default.yml delete mode 100644 acceptance/bundle/summary/show-full-config/targets/variable_mode.yml delete mode 100644 acceptance/bundle/summary/show-full-config/test.toml diff --git a/acceptance/bundle/summary/show-full-config/databricks.yml b/acceptance/bundle/summary/show-full-config/databricks.yml deleted file mode 100644 index 08ac0519c7c..00000000000 --- a/acceptance/bundle/summary/show-full-config/databricks.yml +++ /dev/null @@ -1,19 +0,0 @@ -bundle: - name: test-bundle - -include: - - targets/*.yml - - resources/*.yml - -variables: - mode: - default: development - default: - default: false - -targets: - also_default: - mode: development - default: true - workspace: - host: https://example.com diff --git a/acceptance/bundle/summary/show-full-config/out.test.toml b/acceptance/bundle/summary/show-full-config/out.test.toml deleted file mode 100644 index f784a183258..00000000000 --- a/acceptance/bundle/summary/show-full-config/out.test.toml +++ /dev/null @@ -1,3 +0,0 @@ -Local = true -Cloud = false -EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/summary/show-full-config/output.txt b/acceptance/bundle/summary/show-full-config/output.txt deleted file mode 100644 index 81654d82306..00000000000 --- a/acceptance/bundle/summary/show-full-config/output.txt +++ /dev/null @@ -1,135 +0,0 @@ - ->>> [CLI] bundle summary --show-full-config --include-locations -{ - "__locations": { - "files": [ - "databricks.yml", - "resources/my_dashboard.dashboard.yml", - "targets/default.yml", - "targets/not_default.yml", - "targets/variable_default.yml", - "targets/variable_mode.yml" - ], - "locations": { - "bundle": [ - [ - 0, - 2, - 3 - ] - ], - "include": [ - [ - 0, - 5, - 3 - ] - ], - "resources": [ - [ - 1, - 2, - 3 - ] - ], - "resources.dashboards": [ - [ - 1, - 3, - 5 - ] - ], - "resources.dashboards.my_dashboard": [ - [ - 1, - 4, - 7 - ] - ], - "targets": [ - [ - 0, - 15, - 3 - ], - [ - 2, - 2, - 3 - ], - [ - 3, - 2, - 3 - ], - [ - 4, - 2, - 3 - ], - [ - 5, - 2, - 3 - ] - ], - "variables": [ - [ - 0, - 9, - 3 - ] - ] - }, - "version": 1 - }, - "bundle": { - "name": "test-bundle" - }, - "include": [ - "targets/default.yml", - "targets/not_default.yml", - "targets/variable_default.yml", - "targets/variable_mode.yml", - "resources/my_dashboard.dashboard.yml" - ], - "resources": { - "dashboards": { - "my_dashboard": { - "display_name": "My Dashboard", - "file_path": "../src/my_dashboard.lvdash.json", - "warehouse_id": "[NUMID]abcdef" - } - } - }, - "targets": { - "also_default": { - "default": true, - "mode": "development", - "workspace": { - "host": "https://example.com" - } - }, - "default": { - "default": true, - "mode": "development" - }, - "not_default": { - "mode": "production" - }, - "variable_default": { - "default": "${var.default}" - }, - "variable_mode": { - "mode": "${var.mode}" - } - }, - "variables": { - "default": { - "default": false - }, - "mode": { - "default": "development" - } - } -} diff --git a/acceptance/bundle/summary/show-full-config/resources/my_dashboard.dashboard.yml b/acceptance/bundle/summary/show-full-config/resources/my_dashboard.dashboard.yml deleted file mode 100644 index 07ff8d8f75e..00000000000 --- a/acceptance/bundle/summary/show-full-config/resources/my_dashboard.dashboard.yml +++ /dev/null @@ -1,6 +0,0 @@ -resources: - dashboards: - my_dashboard: - display_name: My Dashboard - file_path: ../src/my_dashboard.lvdash.json - warehouse_id: 1234567890abcdef diff --git a/acceptance/bundle/summary/show-full-config/script b/acceptance/bundle/summary/show-full-config/script deleted file mode 100644 index eccfb0544cb..00000000000 --- a/acceptance/bundle/summary/show-full-config/script +++ /dev/null @@ -1 +0,0 @@ -trace $CLI bundle summary --show-full-config --include-locations diff --git a/acceptance/bundle/summary/show-full-config/src/my_dashboard.lvdash.json b/acceptance/bundle/summary/show-full-config/src/my_dashboard.lvdash.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/acceptance/bundle/summary/show-full-config/src/my_dashboard.lvdash.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/acceptance/bundle/summary/show-full-config/targets/default.yml b/acceptance/bundle/summary/show-full-config/targets/default.yml deleted file mode 100644 index 7dd22abd892..00000000000 --- a/acceptance/bundle/summary/show-full-config/targets/default.yml +++ /dev/null @@ -1,4 +0,0 @@ -targets: - default: - mode: development - default: true diff --git a/acceptance/bundle/summary/show-full-config/targets/not_default.yml b/acceptance/bundle/summary/show-full-config/targets/not_default.yml deleted file mode 100644 index 44f4a59fabc..00000000000 --- a/acceptance/bundle/summary/show-full-config/targets/not_default.yml +++ /dev/null @@ -1,3 +0,0 @@ -targets: - not_default: - mode: production diff --git a/acceptance/bundle/summary/show-full-config/targets/variable_default.yml b/acceptance/bundle/summary/show-full-config/targets/variable_default.yml deleted file mode 100644 index 3b086d8bfb1..00000000000 --- a/acceptance/bundle/summary/show-full-config/targets/variable_default.yml +++ /dev/null @@ -1,3 +0,0 @@ -targets: - variable_default: - default: ${var.default} diff --git a/acceptance/bundle/summary/show-full-config/targets/variable_mode.yml b/acceptance/bundle/summary/show-full-config/targets/variable_mode.yml deleted file mode 100644 index 2d0339c4b11..00000000000 --- a/acceptance/bundle/summary/show-full-config/targets/variable_mode.yml +++ /dev/null @@ -1,3 +0,0 @@ -targets: - variable_mode: - mode: ${var.mode} diff --git a/acceptance/bundle/summary/show-full-config/test.toml b/acceptance/bundle/summary/show-full-config/test.toml deleted file mode 100644 index 9cf9b33ecab..00000000000 --- a/acceptance/bundle/summary/show-full-config/test.toml +++ /dev/null @@ -1,3 +0,0 @@ -[[Repls]] -Old = '\\\\' -New = '/' diff --git a/cmd/bundle/summary.go b/cmd/bundle/summary.go index ff7356e2c60..b3a55a607cc 100644 --- a/cmd/bundle/summary.go +++ b/cmd/bundle/summary.go @@ -1,14 +1,10 @@ package bundle import ( - "context" - "github.com/databricks/cli/bundle" - "github.com/databricks/cli/bundle/config/mutator" "github.com/databricks/cli/bundle/render" "github.com/databricks/cli/cmd/bundle/utils" "github.com/databricks/cli/cmd/root" - "github.com/databricks/cli/libs/diag" "github.com/databricks/cli/libs/flags" "github.com/databricks/cli/libs/logdiag" "github.com/spf13/cobra" @@ -25,38 +21,23 @@ Useful after deployment to see what was created and where to find it.`, var forcePull bool var includeLocations bool - var shouldShowFullConfig bool cmd.Flags().BoolVar(&forcePull, "force-pull", false, "Skip local cache and load the state from the remote workspace") cmd.Flags().BoolVar(&includeLocations, "include-locations", false, "Include location information in the output") cmd.Flags().MarkHidden("include-locations") - cmd.Flags().BoolVar(&shouldShowFullConfig, "show-full-config", false, "Load and output the full bundle config") - cmd.Flags().MarkHidden("show-full-config") cmd.RunE = func(cmd *cobra.Command, args []string) error { - var err error - if shouldShowFullConfig { - ctx := logdiag.InitContext(cmd.Context()) - cmd.SetContext(ctx) - logdiag.SetSeverity(ctx, diag.Warning) - - err = showFullConfig(ctx, cmd, includeLocations) - if err != nil { - return err - } - } else { - b, err := utils.ProcessBundle(cmd, utils.ProcessOptions{ - ReadState: true, - AlwaysPull: forcePull, - IncludeLocations: includeLocations, - InitIDs: true, - }) - if err != nil { - return err - } - err = showSummary(cmd, b) - if err != nil { - return err - } + b, err := utils.ProcessBundle(cmd, utils.ProcessOptions{ + ReadState: true, + AlwaysPull: forcePull, + IncludeLocations: includeLocations, + InitIDs: true, + }) + if err != nil { + return err + } + err = showSummary(cmd, b) + if err != nil { + return err } if logdiag.HasError(cmd.Context()) { @@ -69,35 +50,6 @@ Useful after deployment to see what was created and where to find it.`, return cmd } -func showFullConfig(ctx context.Context, cmd *cobra.Command, includeLocations bool) error { - // call `MustLoad` directly instead of `MustConfigureBundle` because the latter does - // validation that we're not interested in here - b := bundle.MustLoad(ctx) - if b == nil || logdiag.HasError(ctx) { - return nil - } - - mutator.DefaultMutators(ctx, b) - if logdiag.HasError(ctx) { - return nil - } - - if includeLocations { - // Include location information in the output - bundle.ApplyContext(ctx, b, mutator.PopulateLocations()) - if logdiag.HasError(ctx) { - return nil - } - } - - err := renderJsonOutput(cmd, b) - if err != nil { - return err - } - - return nil -} - func showSummary(cmd *cobra.Command, b *bundle.Bundle) error { if root.OutputType(cmd) == flags.OutputText { return render.RenderSummary(cmd.Context(), cmd.OutOrStdout(), b)