Skip to content

Fix target variable overrides dropped under environments - #8183

Open
denik wants to merge 10 commits into
mainfrom
denik/fix-environments-var-shorthand
Open

denik wants to merge 10 commits into
mainfrom
denik/fix-environments-var-shorthand

Conversation

@denik

@denik denik commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes

rewriteShorthands in bundle/config/root.go rewrites short-form target variable overrides (x: value to x: {default: value}) before the configuration is normalized. It only looked at targets. The deprecated environments key is renamed to targets only after loading, so short-form overrides under environments failed normalization and were dropped with a warning. The root value was used. The rewrite now also runs for environments. As a result, the undefined-variable check (variable x is not defined but is assigned a value) now applies to short-form overrides there too.

environments was not rewritten at all before, so it keeps what normalization already applied there. Maps with default or lookup, maps with only definition keys (the JSON fields of a target variable: default, lookup, description, sensitive, type, value), and variables blocks that are not maps, are left as they were. Only scalars, and other maps given for complex variables, are rewritten. So full-form overrides that the targets rules don't recognize keep working as before, for example {default: v, sensitive: false} (also for complex variables) or {sensitive: false} alone (also for complex variables, which keep their root value).

Fixed in the shared rewrite, for both keys:

  • An unquoted date (x: 2024-01-01, loaded as a time value) was not treated as a short form and was dropped with expected map, found time. This was recorded as Badness in acceptance/bundle/validate/variables/target_timestamp_shorthand. The golden now shows the date as the value, and the Badness is removed.
  • A non-string type on the root variable (type: 5) together with a map override panicked in MustString. Now normalization reports the invalid type.
  • A targets value that is not a map (targets: false) failed with failed to rewrite ...: expected a map or sequence, found bool, with no location. It is still an error, now reported at its location (Error: expected map, found bool at targets). This was recorded as Badness in acceptance/bundle/validate/targets/scalar_rewrite_diagnostic. The golden and the script's comment are updated, and the Badness is removed. A targets sequence keeps going through the rewrite and its errors, as before. A non-map environments stays a warning from normalization, as before.

Tests:

  • acceptance/bundle/variables/environments_shorthand (from acc: record dropped short-form variable override under environments #8182): the output now shows the target values with no warnings, and Badness is removed. Its new full-form/ case covers the environments maps that stay as they were ({default, sensitive}, {sensitive}, {value}, also for complex variables), with the same values as on main.
  • The other cases extend the existing tests on the same topic, one committed databricks.yml per subdirectory: validate/variables/target_timestamp_shorthand has an environments/ twin of its date case, and validate/targets/scalar_rewrite_diagnostic has the malformed-variables cases under targets (also in a sequence) and environments, and environments: false next to targets. The non-string type cases overlap no existing test, so they are in the new small acceptance/bundle/variables/target_override_nonstring_type (targets/ and environments/). A table test for isLegacyVariableOverrideDef is in root_test.go. Locally the four tests take about 0.42s per DMS variant in total (0.34s before the cases were moved).

Why

This PR was created by analyzing coverage gaps. Coverage: http://go/cli/dashboard/coverage/file/bundle/config/root.go (rewriteShorthands, which (*Root).MergeTargetOverrides relies on).
A dropped override gives no error: the bundle deploys with the root value of the variable. environments is still accepted: the JSON schema marks it deprecated, but there is no warning at runtime.

Test: #8182

Gaps and risks

  • Only bundle validate is tested. Every other bundle command uses the same loader.
  • Scalars under environments now go through the same rewrite as under targets, including its existing gaps. For example, .inf becomes a default that breaks -o json, as it already does under targets. Before, it was dropped with a warning.
  • Self-review: four Astra rounds and one Fable analysis before the PR was opened. Each widening of the fix drew new compatibility findings, and this narrower version addresses them. After rebasing, one more round (Opus and Astra) on the whole fix found one regression: under environments, a complex variable overridden with only {sensitive: false} took that map as its value. It is fixed in the last commit and pinned in the second test. Astra then reviewed that head and found no new regression. The review comments on this PR (a non-map targets had become a warning that fell back to the default target) went through one more round, which found the same problem for a targets sequence. Both are errors again, as on main, and are pinned in the tests. The second review-oss-bot review found a missing value key (a regression under environments, fixed, with a test that fails without the fix) and asked for the test layout above. Astra reviewed the final diff after that and found no new regression; its remaining points are the two known gaps below (included files, nested dates).
  • Known and left as is: under targets, a full-form override with sensitive is not recognized as full form, and the whole map becomes the default. A complex value that is itself a map with only a lookup key is read as a full definition. Both behave the same before and after this PR.
  • Complex values that contain an unquoted date ({created: 2024-01-01}) fail with cannot convert struct field to dynamic type "time". Under targets this already happens on main, even in a target that isn't selected. Under environments such a value was dropped before, and it now fails the same way. The conversion bug is separate.
  • Not fixed: under environments, a complex value (map or sequence) given in an included file whose root declaration is in another file is still dropped with a warning, as before. Each file is normalized before the merge, so the rewrite can't see the variable's type there. Under targets such values are wrapped without knowing the type. Doing the same under environments would change how other maps there are read, so it is left out. Short-form scalars in included files are fixed.
  • Under environments, a short-form override in an included file next to a full-form override of the same variable with a different type ({default: old} and 42) now fails with cannot merge string with int. Before, the short form was dropped with a warning. The same config under targets already fails this way on main, so this is the existing targets behavior, not a new failure mode.
  • Not in this PR (same file, found during the analysis): a target git: ${var.g} override with a complex variable fails with cannot merge map with string, with or without a root bundle.git. It is the same class as the known limitation recorded in acceptance/bundle/variables/issue_2436: targets are merged before complex variables resolve.
  • Risk: low.

🤖 AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

denik added a commit that referenced this pull request Nov 30, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 97ee686b7 | Workflow run

Selected 4 changed tests (limit=20, 0 not selected)

8 tests: regression=8 unreleased=0 coverage=0 failing=0
test branch main (9e5ad79) latest (v1.28.0)
TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS= ✅ ❌ ❌
TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS=true ✅ ❌ ❌
TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS= ✅ ❌ ❌
TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS=true ✅ ❌ ❌
TestAccept/bundle/variables/environments_shorthand/DMS= ✅ ❌ ❌
TestAccept/bundle/variables/environments_shorthand/DMS=true ✅ ❌ ❌
TestAccept/bundle/variables/target_override_nonstring_type/DMS= ✅ ❌ ❌
TestAccept/bundle/variables/target_override_nonstring_type/DMS=true ✅ ❌ ❌
TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS=: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate\nError: expected map, found bool\n  at targets\n  in databricks.yml:4:10\n\n\nFound 1 error\n\n=== malformed-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/malformed-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== malformed-environments\n\n>>> [CLI] bundle validate -t dev\nWarning: expected map, found string\n  at environments.old.variables\n  in databricks.yml:2:42\n\nName: shapes\nTarget: dev\nWorkspace:\n  User: [USERNAME]\n  Path: /Workspace/Users/[USERNAME]/.bundle/shapes/dev\n\nFound 1 warning\n\n=== sequence-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/sequence-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== toplevel\n\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found bool\n  at environments\n  in databricks.yml:3:15\n\njson.variables.x.value = \"target_value\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate\nError: failed to rewrite [TEST_TMP_DIR]/databricks.yml: expected a map or sequence, found bool\n\n\nFound 1 error\n\n=== malformed-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/malformed-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== malformed-environments\n\n>>> [CLI] bundle validate -t dev\nWarning: expected map, found string\n  at environments.old.variables\n  in databricks.yml:2:42\n\nName: shapes\nTarget: dev\nWorkspace:\n  User: [USERNAME]\n  Path: /Workspace/Users/[USERNAME]/.bundle/shapes/dev\n\nFound 1 warning\n\n=== sequence-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/sequence-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== toplevel\n\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found bool\n  at environments\n  in databricks.yml:3:15\n\njson.variables.x.value = \"target_value\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,3 @@
        	            	 >>> [CLI] bundle validate
        	            	-Error: expected map, found bool
        	            	-  at targets
        	            	-  in databricks.yml:4:10
        	            	+Error: failed to rewrite [TEST_TMP_DIR]/databricks.yml: expected a map or sequence, found bool
        	            	 
        	Test:       	TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS=
        	Messages:   	bundle/validate/targets/scalar_rewrite_diagnostic/output.txt vs /tmp/TestAcceptbundlevalidatetargetsscalar_rewrite_diagnosticDMS1645602233/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS=true: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate\nError: expected map, found bool\n  at targets\n  in databricks.yml:4:10\n\n\nFound 1 error\n\n=== malformed-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/malformed-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== malformed-environments\n\n>>> [CLI] bundle validate -t dev\nWarning: expected map, found string\n  at environments.old.variables\n  in databricks.yml:2:42\n\nName: shapes\nTarget: dev\nWorkspace:\n  User: [USERNAME]\n  Path: /Workspace/Users/[USERNAME]/.bundle/shapes/dev\n\nFound 1 warning\n\n=== sequence-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/sequence-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== toplevel\n\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found bool\n  at environments\n  in databricks.yml:3:15\n\njson.variables.x.value = \"target_value\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate\nError: failed to rewrite [TEST_TMP_DIR]/databricks.yml: expected a map or sequence, found bool\n\n\nFound 1 error\n\n=== malformed-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/malformed-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== malformed-environments\n\n>>> [CLI] bundle validate -t dev\nWarning: expected map, found string\n  at environments.old.variables\n  in databricks.yml:2:42\n\nName: shapes\nTarget: dev\nWorkspace:\n  User: [USERNAME]\n  Path: /Workspace/Users/[USERNAME]/.bundle/shapes/dev\n\nFound 1 warning\n\n=== sequence-targets\n\n>>> [CLI] bundle validate -t dev\nError: failed to rewrite [TEST_TMP_DIR]/sequence-targets/databricks.yml: expected a map or sequence, found string\n\n\nFound 1 error\n\n=== toplevel\n\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found bool\n  at environments\n  in databricks.yml:3:15\n\njson.variables.x.value = \"target_value\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,3 @@
        	            	 >>> [CLI] bundle validate
        	            	-Error: expected map, found bool
        	            	-  at targets
        	            	-  in databricks.yml:4:10
        	            	+Error: failed to rewrite [TEST_TMP_DIR]/databricks.yml: expected a map or sequence, found bool
        	            	 
        	Test:       	TestAccept/bundle/validate/targets/scalar_rewrite_diagnostic/DMS=true
        	Messages:   	bundle/validate/targets/scalar_rewrite_diagnostic/output.txt vs /tmp/TestAcceptbundlevalidatetargetsscalar_rewrite_diagnosticDMS3191660185/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS=: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate -t dev -o json\njson.variables.x.default = \"2020-01-02\";\njson.variables.x.value = \"2020-01-02\";\n\n=== environments\n\n>>> [CLI] bundle validate -t dev -o json\njson.variables.x.default = \"2020-01-02\";\njson.variables.x.value = \"2020-01-02\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate -t dev -o json\nWarning: expected map, found time\n  at targets.dev.variables.x\n  in databricks.yml:11:10\n\njson.variables.x.default = \"base\";\njson.variables.x.value = \"base\";\n\n=== environments\n\n>>> [CLI] bundle validate -t dev -o json\nWarning: expected map, found time\n  at environments.dev.variables.x\n  in databricks.yml:12:10\n\njson.variables.x.default = \"base\";\njson.variables.x.value = \"base\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,4 +2,8 @@
        	            	 >>> [CLI] bundle validate -t dev -o json
        	            	-json.variables.x.default = "2020-01-02";
        	            	-json.variables.x.value = "2020-01-02";
        	            	+Warning: expected map, found time
        	            	+  at targets.dev.variables.x
        	            	+  in databricks.yml:11:10
        	            	+
        	            	+json.variables.x.default = "base";
        	            	+json.variables.x.value = "base";
        	            	 
        	            	@@ -8,4 +12,8 @@
        	            	 >>> [CLI] bundle validate -t dev -o json
        	            	-json.variables.x.default = "2020-01-02";
        	            	-json.variables.x.value = "2020-01-02";
        	            	+Warning: expected map, found time
        	            	+  at environments.dev.variables.x
        	            	+  in databricks.yml:12:10
        	            	 
        	            	+json.variables.x.default = "base";
        	            	+json.variables.x.value = "base";
        	            	+
        	Test:       	TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS=
        	Messages:   	bundle/validate/variables/target_timestamp_shorthand/output.txt vs /tmp/TestAcceptbundlevalidatevariablestarget_timestamp_shorthand2066433506/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS=true: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate -t dev -o json\njson.variables.x.default = \"2020-01-02\";\njson.variables.x.value = \"2020-01-02\";\n\n=== environments\n\n>>> [CLI] bundle validate -t dev -o json\njson.variables.x.default = \"2020-01-02\";\njson.variables.x.value = \"2020-01-02\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate -t dev -o json\nWarning: expected map, found time\n  at targets.dev.variables.x\n  in databricks.yml:11:10\n\njson.variables.x.default = \"base\";\njson.variables.x.value = \"base\";\n\n=== environments\n\n>>> [CLI] bundle validate -t dev -o json\nWarning: expected map, found time\n  at environments.dev.variables.x\n  in databricks.yml:12:10\n\njson.variables.x.default = \"base\";\njson.variables.x.value = \"base\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,4 +2,8 @@
        	            	 >>> [CLI] bundle validate -t dev -o json
        	            	-json.variables.x.default = "2020-01-02";
        	            	-json.variables.x.value = "2020-01-02";
        	            	+Warning: expected map, found time
        	            	+  at targets.dev.variables.x
        	            	+  in databricks.yml:11:10
        	            	+
        	            	+json.variables.x.default = "base";
        	            	+json.variables.x.value = "base";
        	            	 
        	            	@@ -8,4 +12,8 @@
        	            	 >>> [CLI] bundle validate -t dev -o json
        	            	-json.variables.x.default = "2020-01-02";
        	            	-json.variables.x.value = "2020-01-02";
        	            	+Warning: expected map, found time
        	            	+  at environments.dev.variables.x
        	            	+  in databricks.yml:12:10
        	            	 
        	            	+json.variables.x.default = "base";
        	            	+json.variables.x.value = "base";
        	            	+
        	Test:       	TestAccept/bundle/validate/variables/target_timestamp_shorthand/DMS=true
        	Messages:   	bundle/validate/variables/target_timestamp_shorthand/output.txt vs /tmp/TestAcceptbundlevalidatevariablestarget_timestamp_shorthand1115006316/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/variables/environments_shorthand/DMS=: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex.value.key = \"target_value\";\njson.variables.full.value = \"target_value\";\njson.variables.short.value = \"target_value\";\n\n=== full-form\n\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex_metadata_only.value.workers = 1;\njson.variables.complex_value_key.value.workers = 1;\njson.variables.complex_with_sensitive.value.workers = 2;\njson.variables.metadata_only.value = \"root_value\";\njson.variables.value_key.value = \"root_value\";\njson.variables.with_sensitive.value = \"target_value\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found string\n  at environments.dev.variables.short\n  in databricks.yml:18:14\n\nWarning: unknown field: key\n  at environments.dev.variables.complex\n  in databricks.yml:22:9\n\njson.variables.complex.value.key = \"root_value\";\njson.variables.full.value = \"target_value\";\njson.variables.short.value = \"root_value\";\n\n=== full-form\n\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex_metadata_only.value.workers = 1;\njson.variables.complex_value_key.value.workers = 1;\njson.variables.complex_with_sensitive.value.workers = 2;\njson.variables.metadata_only.value = \"root_value\";\njson.variables.value_key.value = \"root_value\";\njson.variables.with_sensitive.value = \"target_value\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,13 @@
        	            	 >>> [CLI] bundle validate -o json -t dev
        	            	-json.variables.complex.value.key = "target_value";
        	            	+Warning: expected map, found string
        	            	+  at environments.dev.variables.short
        	            	+  in databricks.yml:18:14
        	            	+
        	            	+Warning: unknown field: key
        	            	+  at environments.dev.variables.complex
        	            	+  in databricks.yml:22:9
        	            	+
        	            	+json.variables.complex.value.key = "root_value";
        	            	 json.variables.full.value = "target_value";
        	            	-json.variables.short.value = "target_value";
        	            	+json.variables.short.value = "root_value";
        	            	 
        	Test:       	TestAccept/bundle/variables/environments_shorthand/DMS=
        	Messages:   	bundle/variables/environments_shorthand/output.txt vs /tmp/TestAcceptbundlevariablesenvironments_shorthandDMS=3747592022/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/variables/environments_shorthand/DMS=true: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex.value.key = \"target_value\";\njson.variables.full.value = \"target_value\";\njson.variables.short.value = \"target_value\";\n\n=== full-form\n\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex_metadata_only.value.workers = 1;\njson.variables.complex_value_key.value.workers = 1;\njson.variables.complex_with_sensitive.value.workers = 2;\njson.variables.metadata_only.value = \"root_value\";\njson.variables.value_key.value = \"root_value\";\njson.variables.with_sensitive.value = \"target_value\";\n"
        	            	actual  : "\n>>> [CLI] bundle validate -o json -t dev\nWarning: expected map, found string\n  at environments.dev.variables.short\n  in databricks.yml:18:14\n\nWarning: unknown field: key\n  at environments.dev.variables.complex\n  in databricks.yml:22:9\n\njson.variables.complex.value.key = \"root_value\";\njson.variables.full.value = \"target_value\";\njson.variables.short.value = \"root_value\";\n\n=== full-form\n\n>>> [CLI] bundle validate -o json -t dev\njson.variables.complex_metadata_only.value.workers = 1;\njson.variables.complex_value_key.value.workers = 1;\njson.variables.complex_with_sensitive.value.workers = 2;\njson.variables.metadata_only.value = \"root_value\";\njson.variables.value_key.value = \"root_value\";\njson.variables.with_sensitive.value = \"target_value\";\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,5 +2,13 @@
        	            	 >>> [CLI] bundle validate -o json -t dev
        	            	-json.variables.complex.value.key = "target_value";
        	            	+Warning: expected map, found string
        	            	+  at environments.dev.variables.short
        	            	+  in databricks.yml:18:14
        	            	+
        	            	+Warning: unknown field: key
        	            	+  at environments.dev.variables.complex
        	            	+  in databricks.yml:22:9
        	            	+
        	            	+json.variables.complex.value.key = "root_value";
        	            	 json.variables.full.value = "target_value";
        	            	-json.variables.short.value = "target_value";
        	            	+json.variables.short.value = "root_value";
        	            	 
        	Test:       	TestAccept/bundle/variables/environments_shorthand/DMS=true
        	Messages:   	bundle/variables/environments_shorthand/output.txt vs /tmp/TestAcceptbundlevariablesenvironments_shorthandDMS=true1201515756/002/output.txt

latest (v1.28.0): same output as main (9e5ad79)

TestAccept/bundle/variables/target_override_nonstring_type/DMS=: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: Diff:
        --- bundle/variables/target_override_nonstring_type/output.txt
        +++ /tmp/TestAcceptbundlevariablestarget_override_nonstring_typeDMS=3751930205/002/output.txt
        @@ -2,21 +2,93 @@
         === targets
         
         >>> [CLI] bundle validate -o json -t dev
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        -json.variables.x.value.a = 2;
        +CLI Version: [CLI_VERSION]
         
        -=== environments
        +Panic Payload: expected kind string, got int
         
        ->>> [CLI] bundle validate -o json -t dev
        -Warning: unknown field: a
        -  at environments.dev.variables.x
        -  in databricks.yml:3:38
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept2133865673/001/cmd/root/root.go:169 +0xd4
        +panic({0x35446d0?, 0x1d75a2c2b6f0?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/dyn.Value.MustString({{0x3544910, 0x1e68c28}, 0x5, {0x1d75a2d3d880, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/value_underlying.go:53 +0xe7
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1.1({0x1d75a2e2bc50, 0x2, 0x3755ce8?}, {{0x3847f10, 0x1d75a2d3da60}, 0x1, {0x1d75a2d3da80, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:537 +0x48e
        +github.com/databricks/cli/libs/dyn.Foreach.1({0x1d75a29475f0, 0x1, 0x1}, {{0x3847f10, 0x1d75a2d3dac0}, 0x1, {0x1d75a2d3dae0, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x1d75a2d3dac0}, 0x1, {0x1d75a2d3dae0, 0x1, 0x1}, 0x0}, {0x1d75a29475d8, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1c06135?, 0x37d8218?}, 0x10f0075a2ab0658?}, {{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0}, {0x3bbf100, 0x0, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0}, {0x1d75a2c2b6d0, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0}, {0x1d75a29475a8, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0}, {0x1c06135?, 0x9?}, 0x1d75a2c2b6c0)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1({0x1d75a2ab8068?, 0x44e027?, 0x43dda5?}, {{0x3847f10, 0x1d75a2d3db20}, 0x1, {0x1d75a2d3db40, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:515 +0x428
        +github.com/databricks/cli/libs/dyn.Foreach.func1({0x1d75a2947590, 0x1, 0x1}, {{0x3847f10, 0x1d75a2d3db80}, 0x1, {0x1d75a2d3dba0, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x1d75a2d3db80}, 0x1, {0x1d75a2d3dba0, 0x1, 0x1}, 0x0}, {0x1d75a2947578, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1c01267?, 0x37d8218?}, 0x601?}, {{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0}, {0x3bbf100, 0x0, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0}, {0x1d75a2c2b6b0, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0}, {0x1d75a2947548, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0}, {0x1c01267?, 0x1d75a2d3dbe0?}, 0x1d75a2c2b6a0)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands({{0x3847f10, 0x1d75a2d3dbe0}, 0x1, {0x1d75a2d3dc00, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:508 +0x199
        +github.com/databricks/cli/bundle/config.LoadFromBytes({0x1d75a2998c40, 0x65}, {0x1d75a2c7ac00, 0x6b, 0x200})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:129 +0x373
        +github.com/databricks/cli/bundle/config.Load({0x1d75a2998c40, 0x65})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:109 +0x59
        +github.com/databricks/cli/bundle/config/loader.(*entryPoint).Apply(0x1d75a2e4a060?, {0x392b2b0?, 0x1d75a2e2ae10?}, 0x1d75a2e4a008)
        +	/tmp/TestAccept2133865673/001/bundle/config/loader/entry_point.go:27 +0x4a
        +github.com/databricks/cli/bundle.ApplyContext({0x392b2b0, 0x1d75a2e2acf0}, 0x1d75a2e4a008, {0x3920340, 0x3bbf100})
        +	/tmp/TestAccept2133865673/001/bundle/mutator.go:91 +0x262
        +github.com/databricks/cli/bundle.ApplySeqContext({0x392b2b0, 0x1d75a2e2acf0}, 0x1d75a2e4a008, {0x1d75a2ab9250?, 0x1d75a2e3c4e0?, 0x1d75a2ab9270?})
        +	/tmp/TestAccept2133865673/001/bundle/mutator.go:100 +0x65
        +github.com/databricks/cli/bundle/config/mutator.DefaultMutators({0x392b2b0, 0x1d75a2e2acf0}, 0x1d75a2e4a008)
        +	/tmp/TestAccept2133865673/001/bundle/config/mutator/mutator.go:14 +0x1c5
        +github.com/databricks/cli/bundle/phases.LoadNamedTarget({0x392b2b0, 0x1d75a2e2acf0}, 0x1d75a2e4a008, {0x7fff3fad404b, 0x3})
        +	/tmp/TestAccept2133865673/001/bundle/phases/load.go:42 +0x50
        +github.com/databricks/cli/cmd/root.configureBundle(0x1d75a2e1e308, 0x1d75a2e4a008)
        +	/tmp/TestAccept2133865673/001/cmd/root/bundle.go:162 +0x7b
        +github.com/databricks/cli/cmd/root.MustConfigureBundle(0x1d75a2e1e308)
        +	/tmp/TestAccept2133865673/001/cmd/root/bundle.go:215 +0x7d
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundleRet(0x1d75a2e1e308, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        +	/tmp/TestAccept2133865673/001/cmd/bundle/utils/process.go:147 +0x256
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundle(...)
        +	/tmp/TestAccept2133865673/001/cmd/bundle/utils/process.go:104
        +github.com/databricks/cli/cmd/bundle.newValidateCommand.func1(0x1d75a2e1e308, {0x1d75a2d79240?, 0x4?, 0x1bfce4c?})
        +	/tmp/TestAccept2133865673/001/cmd/bundle/validate.go:65 +0x5f
        +github.com/spf13/cobra.(*Command).execute(0x1d75a2e1e308, {0x1d75a2d79200, 0x4, 0x4})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x1d75a2bcec08)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x392b278, 0x3bbf100}, 0x1d75a2bcec08, {0x1d75a2a30470, 0x6, 0x6})
        +	/tmp/TestAccept2133865673/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x1d75a2c2a130, {0x392b278, 0x3bbf100}, {0x1d75a2a30470, 0x6, 0x6})
        +	/tmp/TestAccept2133865673/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept2133865673/001/main.go:38 +0x136
         
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        -
        -json.variables.x.value.a = 1;
        +Exit code: 1

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/variables/target_override_nonstring_type/output.txt
        +++ /tmp/TestAcceptbundlevariablestarget_override_nonstring_typeDMS=1430760212/002/output.txt
        @@ -2,21 +2,93 @@
         === targets
         
         >>> [CLI] bundle validate -o json -t dev
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        -json.variables.x.value.a = 2;
        +CLI Version: [CLI_VERSION]
         
        -=== environments
        +Panic Payload: expected kind string, got int
         
        ->>> [CLI] bundle validate -o json -t dev
        -Warning: unknown field: a
        -  at environments.dev.variables.x
        -  in databricks.yml:3:38
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x34aeba8?, 0x244754f9d430?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/dyn.Value.MustString({{0x34aede8, 0x1e28308}, 0x5, {0x244754feab60, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/value_underlying.go:53 +0xe7
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1.1({0x24475502e6c0, 0x2, 0x42867c?}, {{0x37a4f08, 0x244754fead40}, 0x1, {0x244754fead60, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:536 +0x48e
        +github.com/databricks/cli/libs/dyn.Foreach.1({0x244754b946f0, 0x1, 0x1}, {{0x37a4f08, 0x244754feada0}, 0x1, {0x244754feadc0, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0x244754feada0}, 0x1, {0x244754feadc0, 0x1, 0x1}, 0x0}, {0x244754b946d8, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1bcbf06?, 0x3736440?}, 0x244754fe06a0?}, {{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0}, {0x3b11cc0, 0x0, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0}, {0x244754f9d410, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0}, {0x244754b946a8, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0}, {0x1bcbf06?, 0x244755038410?}, 0x244754f9d400)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1({0x244754feae80?, 0x20?, 0x244754f6e150?}, {{0x37a4f08, 0x244754feae00}, 0x1, {0x244754feae20, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:514 +0x428
        +github.com/databricks/cli/libs/dyn.Foreach.func1({0x244754b94690, 0x1, 0x1}, {{0x37a4f08, 0x244754feae60}, 0x1, {0x244754feae80, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0x244754feae60}, 0x1, {0x244754feae80, 0x1, 0x1}, 0x0}, {0x244754b94678, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1bc7170?, 0x3736440?}, 0x600?}, {{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0}, {0x3b11cc0, 0x0, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0}, {0x244754f9d3f0, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0}, {0x244754b94648, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0}, {0x1bc7170?, 0x0?}, 0x244754f9d3e0)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands({{0x37a4f08, 0x244754feaec0}, 0x1, {0x244754feaee0, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:507 +0x199
        +github.com/databricks/cli/bundle/config.LoadFromBytes({0x244754be6e00, 0x65}, {0x244754fc0400, 0x6b, 0x200})
        +	github.com/databricks/cli/bundle/config/root.go:129 +0x373
        +github.com/databricks/cli/bundle/config.Load({0x244754be6e00, 0x65})
        +	github.com/databricks/cli/bundle/config/root.go:109 +0x59
        +github.com/databricks/cli/bundle/config/loader.(*entryPoint).Apply(0x244755024060?, {0x3885670?, 0x244754ff3830?}, 0x244755024008)
        +	github.com/databricks/cli/bundle/config/loader/entry_point.go:27 +0x4a
        +github.com/databricks/cli/bundle.ApplyContext({0x3885670, 0x244754ff3710}, 0x244755024008, {0x387aa08, 0x3b11cc0})
        +	github.com/databricks/cli/bundle/mutator.go:91 +0x262
        +github.com/databricks/cli/bundle.ApplySeqContext({0x3885670, 0x244754ff3710}, 0x244755024008, {0x244754f6f0d8?, 0x244754c615e8?, 0x244754f6f0f8?})
        +	github.com/databricks/cli/bundle/mutator.go:100 +0x65
        +github.com/databricks/cli/bundle/config/mutator.DefaultMutators({0x3885670, 0x244754ff3710}, 0x244755024008)
        +	github.com/databricks/cli/bundle/config/mutator/mutator.go:14 +0x1c5
        +github.com/databricks/cli/bundle/phases.LoadNamedTarget({0x3885670, 0x244754ff3710}, 0x244755024008, {0x7ffe2d684fea, 0x3})
        +	github.com/databricks/cli/bundle/phases/load.go:34 +0x50
        +github.com/databricks/cli/cmd/root.configureBundle(0x244754fef208, 0x244755024008)
        +	github.com/databricks/cli/cmd/root/bundle.go:162 +0x7b
        +github.com/databricks/cli/cmd/root.MustConfigureBundle(0x244754fef208)
        +	github.com/databricks/cli/cmd/root/bundle.go:215 +0x7d
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundleRet(0x244754fef208, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        +	github.com/databricks/cli/cmd/bundle/utils/process.go:143 +0x217
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundle(...)
        +	github.com/databricks/cli/cmd/bundle/utils/process.go:100
        +github.com/databricks/cli/cmd/bundle.newValidateCommand.func1(0x244754fef208, {0x244755000580?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/validate.go:65 +0x5f
        +github.com/spf13/cobra.(*Command).execute(0x244754fef208, {0x244755000540, 0x4, 0x4})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x244754cfe008)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0x244754cfe008, {0x244754bd4550, 0x6, 0x6})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x244754bf5ea0, {0x3885638, 0x3b11cc0}, {0x244754bd4550, 0x6, 0x6})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
         
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        -
        -json.variables.x.value.a = 1;
        +Exit code: 1
TestAccept/bundle/variables/target_override_nonstring_type/DMS=true: branch ✅ | main (9e5ad79) ❌ | latest (v1.28.0) ❌

main (9e5ad79):

acceptance_test.go:1402: Diff:
        --- bundle/variables/target_override_nonstring_type/output.txt
        +++ /tmp/TestAcceptbundlevariablestarget_override_nonstring_typeDMS=t4212405758/002/output.txt
        @@ -2,21 +2,93 @@
         === targets
         
         >>> [CLI] bundle validate -o json -t dev
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        -json.variables.x.value.a = 2;
        +CLI Version: [CLI_VERSION]
         
        -=== environments
        +Panic Payload: expected kind string, got int
         
        ->>> [CLI] bundle validate -o json -t dev
        -Warning: unknown field: a
        -  at environments.dev.variables.x
        -  in databricks.yml:3:38
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	/tmp/TestAccept2133865673/001/cmd/root/root.go:169 +0xd4
        +panic({0x35446d0?, 0x19dfd3792da0?})
        +	/opt/hostedtoolcache/go/[GO_VERSION]/x64/src/runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/dyn.Value.MustString({{0x3544910, 0x1e68c28}, 0x5, {0x19dfd3790b20, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/value_underlying.go:53 +0xe7
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1.1({0x19dfd3774960, 0x2, 0x3755ce8?}, {{0x3847f10, 0x19dfd3790d00}, 0x1, {0x19dfd3790d20, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:537 +0x48e
        +github.com/databricks/cli/libs/dyn.Foreach.1({0x19dfd358c6d8, 0x1, 0x1}, {{0x3847f10, 0x19dfd3790d60}, 0x1, {0x19dfd3790d80, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x19dfd3790d60}, 0x1, {0x19dfd3790d80, 0x1, 0x1}, 0x0}, {0x19dfd358c6c0, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1c06135?, 0x7fdb256745b0?}, 0xf00db6c47fa00?}, {{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0}, {0x3bbf100, 0x0, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0}, {0x19dfd3792d80, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0}, {0x19dfd358c690, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0}, {0x1c06135?, 0x7fdb6c48a860?}, 0x19dfd3792d70)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1({0x19dfd3792c80?, 0x0?, 0x0?}, {{0x3847f10, 0x19dfd3790dc0}, 0x1, {0x19dfd3790de0, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:515 +0x428
        +github.com/databricks/cli/libs/dyn.Foreach.func1({0x19dfd358c678, 0x1, 0x1}, {{0x3847f10, 0x19dfd3790e20}, 0x1, {0x19dfd3790e40, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x19dfd3790e20}, 0x1, {0x19dfd3790e40, 0x1, 0x1}, 0x0}, {0x19dfd358c660, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1c01267?, 0x1?}, 0x1?}, {{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0}, {0x3bbf100, 0x0, 0x0}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0}, {0x19dfd3792d60, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0}, {0x19dfd358c630, 0x1, 0x1}, ...)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0}, {0x1c01267?, 0x19dfd3790e80?}, 0x19dfd3792d50)
        +	/tmp/TestAccept2133865673/001/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands({{0x3847f10, 0x19dfd3790e80}, 0x1, {0x19dfd3790ea0, 0x1, 0x1}, 0x0})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:508 +0x199
        +github.com/databricks/cli/bundle/config.LoadFromBytes({0x19dfd35dea10, 0x66}, {0x19dfd38bc400, 0x6b, 0x200})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:129 +0x373
        +github.com/databricks/cli/bundle/config.Load({0x19dfd35dea10, 0x66})
        +	/tmp/TestAccept2133865673/001/bundle/config/root.go:109 +0x59
        +github.com/databricks/cli/bundle/config/loader.(*entryPoint).Apply(0x19dfd35d0460?, {0x392b2b0?, 0x19dfd37b5e30?}, 0x19dfd35d0408)
        +	/tmp/TestAccept2133865673/001/bundle/config/loader/entry_point.go:27 +0x4a
        +github.com/databricks/cli/bundle.ApplyContext({0x392b2b0, 0x19dfd37b5d10}, 0x19dfd35d0408, {0x3920340, 0x3bbf100})
        +	/tmp/TestAccept2133865673/001/bundle/mutator.go:91 +0x262
        +github.com/databricks/cli/bundle.ApplySeqContext({0x392b2b0, 0x19dfd37b5d10}, 0x19dfd35d0408, {0x19dfd37b3250?, 0x19dfd3795860?, 0x19dfd37b3270?})
        +	/tmp/TestAccept2133865673/001/bundle/mutator.go:100 +0x65
        +github.com/databricks/cli/bundle/config/mutator.DefaultMutators({0x392b2b0, 0x19dfd37b5d10}, 0x19dfd35d0408)
        +	/tmp/TestAccept2133865673/001/bundle/config/mutator/mutator.go:14 +0x1c5
        +github.com/databricks/cli/bundle/phases.LoadNamedTarget({0x392b2b0, 0x19dfd37b5d10}, 0x19dfd35d0408, {0x7ffc883ca03d, 0x3})
        +	/tmp/TestAccept2133865673/001/bundle/phases/load.go:42 +0x50
        +github.com/databricks/cli/cmd/root.configureBundle(0x19dfd3a34308, 0x19dfd35d0408)
        +	/tmp/TestAccept2133865673/001/cmd/root/bundle.go:162 +0x7b
        +github.com/databricks/cli/cmd/root.MustConfigureBundle(0x19dfd3a34308)
        +	/tmp/TestAccept2133865673/001/cmd/root/bundle.go:215 +0x7d
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundleRet(0x19dfd3a34308, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        +	/tmp/TestAccept2133865673/001/cmd/bundle/utils/process.go:147 +0x256
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundle(...)
        +	/tmp/TestAccept2133865673/001/cmd/bundle/utils/process.go:104
        +github.com/databricks/cli/cmd/bundle.newValidateCommand.func1(0x19dfd3a34308, {0x19dfd39d02c0?, 0x4?, 0x1bfce4c?})
        +	/tmp/TestAccept2133865673/001/cmd/bundle/validate.go:65 +0x5f
        +github.com/spf13/cobra.(*Command).execute(0x19dfd3a34308, {0x19dfd39d0280, 0x4, 0x4})
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0x19dfd393c608)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x392b278, 0x3bbf100}, 0x19dfd393c608, {0x19dfd35cc550, 0x6, 0x6})
        +	/tmp/TestAccept2133865673/001/cmd/root/root.go:231 +0x413
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0x19dfd3943730, {0x392b278, 0x3bbf100}, {0x19dfd35cc550, 0x6, 0x6})
        +	/tmp/TestAccept2133865673/001/cmd/root/tree.go:65 +0x57
        +main.main()
        +	/tmp/TestAccept2133865673/001/main.go:38 +0x136
         
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        -
        -json.variables.x.value.a = 1;
        +Exit code: 1
        
FAIL

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/variables/target_override_nonstring_type/output.txt
        +++ /tmp/TestAcceptbundlevariablestarget_override_nonstring_typeDMS=t3622705158/002/output.txt
        @@ -2,21 +2,93 @@
         === targets
         
         >>> [CLI] bundle validate -o json -t dev
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        +The Databricks CLI unexpectedly had a fatal error.
        +Please report this issue to Databricks in the form of a GitHub issue at:
        +https://github.com/databricks/cli
         
        -json.variables.x.value.a = 2;
        +CLI Version: [CLI_VERSION]
         
        -=== environments
        +Panic Payload: expected kind string, got int
         
        ->>> [CLI] bundle validate -o json -t dev
        -Warning: unknown field: a
        -  at environments.dev.variables.x
        -  in databricks.yml:3:38
        +Stack Trace:
        +goroutine 1 [running]:
        +runtime/debug.Stack()
        +	runtime/debug/stack.go:26 +0x5e
        +github.com/databricks/cli/cmd/root.execute.func1()
        +	github.com/databricks/cli/cmd/root/root.go:167 +0xd4
        +panic({0x34aeba8?, 0xe551f5aa2a0?})
        +	runtime/panic.go:859 +0x125
        +github.com/databricks/cli/libs/dyn.Value.MustString({{0x34aede8, 0x1e28308}, 0x5, {0xe551f187cc0, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/value_underlying.go:53 +0xe7
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1.1({0xe551f59cf30, 0x2, 0x42867c?}, {{0x37a4f08, 0xe551f187ea0}, 0x1, {0xe551f187ec0, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:536 +0x48e
        +github.com/databricks/cli/libs/dyn.Foreach.1({0xe551f1c8ca8, 0x1, 0x1}, {{0x37a4f08, 0xe551f5b0000}, 0x1, {0xe551f5b0020, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0xe551f5b0000}, 0x1, {0xe551f5b0020, 0x1, 0x1}, 0x0}, {0xe551f1c8c90, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1bcbf06?, 0x3736440?}, 0xe551f5b0600?}, {{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0}, {0x3b11cc0, 0x0, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0}, {0xe551f5aa280, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0}, {0xe551f1c8c60, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0}, {0x1bcbf06?, 0xe551f5ae4e0?}, 0xe551f5aa270)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands.func1({0xe551f5b00e0?, 0x20?, 0xe551f58c150?}, {{0x37a4f08, 0xe551f5b0060}, 0x1, {0xe551f5b0080, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:514 +0x428
        +github.com/databricks/cli/libs/dyn.Foreach.func1({0xe551f1c8c48, 0x1, 0x1}, {{0x37a4f08, 0xe551f5b00c0}, 0x1, {0xe551f5b00e0, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/libs/dyn/visit_map.go:24 +0x5bd
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0xe551f5b00c0}, 0x1, {0xe551f5b00e0, 0x1, 0x1}, 0x0}, {0xe551f1c8c30, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:109 +0x17a
        +github.com/databricks/cli/libs/dyn.pathComponent.visit({{0x1bc7170?, 0x3736440?}, 0x600?}, {{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:149 +0x54a
        +github.com/databricks/cli/libs/dyn.visit({{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0}, {0x3b11cc0, 0x0, 0x0}, ...)
        +	github.com/databricks/cli/libs/dyn/visit.go:122 +0x346
        +github.com/databricks/cli/libs/dyn.MapByPattern({{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0}, {0xe551f5aa260, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:72 +0xf5
        +github.com/databricks/cli/libs/dyn.MapByPath({{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0}, {0xe551f1c8c00, 0x1, 0x1}, ...)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:61 +0x1b3
        +github.com/databricks/cli/libs/dyn.Map({{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0}, {0x1bc7170?, 0x0?}, 0xe551f5aa250)
        +	github.com/databricks/cli/libs/dyn/visit_map.go:54 +0x15c
        +github.com/databricks/cli/bundle/config.rewriteShorthands({{0x37a4f08, 0xe551f5b0120}, 0x1, {0xe551f5b0140, 0x1, 0x1}, 0x0})
        +	github.com/databricks/cli/bundle/config/root.go:507 +0x199
        +github.com/databricks/cli/bundle/config.LoadFromBytes({0xe551f4b2770, 0x66}, {0xe551f510400, 0x6b, 0x200})
        +	github.com/databricks/cli/bundle/config/root.go:129 +0x373
        +github.com/databricks/cli/bundle/config.Load({0xe551f4b2770, 0x66})
        +	github.com/databricks/cli/bundle/config/root.go:109 +0x59
        +github.com/databricks/cli/bundle/config/loader.(*entryPoint).Apply(0xe551f59e060?, {0x3885670?, 0xe551f59c1b0?}, 0xe551f59e008)
        +	github.com/databricks/cli/bundle/config/loader/entry_point.go:27 +0x4a
        +github.com/databricks/cli/bundle.ApplyContext({0x3885670, 0xe551f59c090}, 0xe551f59e008, {0x387aa08, 0x3b11cc0})
        +	github.com/databricks/cli/bundle/mutator.go:91 +0x262
        +github.com/databricks/cli/bundle.ApplySeqContext({0x3885670, 0xe551f59c090}, 0xe551f59e008, {0xe551f58d0d8?, 0xe551f4c9448?, 0xe551f58d0f8?})
        +	github.com/databricks/cli/bundle/mutator.go:100 +0x65
        +github.com/databricks/cli/bundle/config/mutator.DefaultMutators({0x3885670, 0xe551f59c090}, 0xe551f59e008)
        +	github.com/databricks/cli/bundle/config/mutator/mutator.go:14 +0x1c5
        +github.com/databricks/cli/bundle/phases.LoadNamedTarget({0x3885670, 0xe551f59c090}, 0xe551f59e008, {0x7ffe1ed84fdc, 0x3})
        +	github.com/databricks/cli/bundle/phases/load.go:34 +0x50
        +github.com/databricks/cli/cmd/root.configureBundle(0xe551f561508, 0xe551f59e008)
        +	github.com/databricks/cli/cmd/root/bundle.go:162 +0x7b
        +github.com/databricks/cli/cmd/root.MustConfigureBundle(0xe551f561508)
        +	github.com/databricks/cli/cmd/root/bundle.go:215 +0x7d
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundleRet(0xe551f561508, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
        +	github.com/databricks/cli/cmd/bundle/utils/process.go:143 +0x217
        +github.com/databricks/cli/cmd/bundle/utils.ProcessBundle(...)
        +	github.com/databricks/cli/cmd/bundle/utils/process.go:100
        +github.com/databricks/cli/cmd/bundle.newValidateCommand.func1(0xe551f561508, {0xe551f1cd500?, 0x4?, 0x1bc2e36?})
        +	github.com/databricks/cli/cmd/bundle/validate.go:65 +0x5f
        +github.com/spf13/cobra.(*Command).execute(0xe551f561508, {0xe551f1cd4c0, 0x4, 0x4})
        +	github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb3c
        +github.com/spf13/cobra.(*Command).ExecuteC(0xe551f1d0308)
        +	github.com/spf13/cobra@v1.10.2/command.go:1148 +0x450
        +github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        +	github.com/spf13/cobra@v1.10.2/command.go:1080
        +github.com/databricks/cli/cmd/root.execute({0x3885638, 0x3b11cc0}, 0xe551f1d0308, {0xe551f0da4e0, 0x6, 0x6})
        +	github.com/databricks/cli/cmd/root/root.go:227 +0x3b6
        +github.com/databricks/cli/cmd/root.(*Tree).Execute(0xe551f182d10, {0x3885638, 0x3b11cc0}, {0xe551f0da4e0, 0x6, 0x6})
        +	github.com/databricks/cli/cmd/root/tree.go:65 +0x57
        +main.main()
        +	github.com/databricks/cli/main.go:36 +0x125
         
        -Warning: invalid value "5" for enum field. Valid values are [complex]
        -  at variables.x.type
        -  in databricks.yml:2:23
        -
        -json.variables.x.value.a = 1;
        +Exit code: 1
        
FAIL

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 97ee686

Run: 46448581758

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 88 10 1:51
💚​ aws-windows-latest-4core-16gb 1 88 10 3:16
💚​ azure linux-2core-8gb 1 88 10 1:52
💚​ azure-windows-latest-4core-16gb 1 88 10 3:18
💚​ gcp linux-2core-8gb 1 88 10 2:03
💚​ gcp-windows-latest-4core-16gb 1 88 10 3:25
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:23 gcp-windows-latest-4core-16gb TestAccept
3:15 azure-windows-latest-4core-16gb TestAccept
3:14 aws-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 30, 2026 01:37
@denik
denik requested review from a team as code owners November 30, 2026 01:37
@denik
denik requested review from Sankalp-Mittal and andrewnester and removed request for a team November 30, 2026 01:37

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at 9bea59d. Each finding was verified against the code.

Not ready yet: 1 open question(s) about a change users could be hurt by.

This PR runs the target variable shorthand rewrite for the deprecated environments key as well as targets. It also accepts unquoted dates as short-form values, avoids the MustString panic on a non-string type, and leaves a non-map targets/environments for normalization to report. The rewrite logic looks right for the cases it targets. Before merging, please settle whether targets: false should still fail, and make the changelog mention the new failure for undefined variables under environments. The new acceptance test also builds its inputs in script, which the testing rules ask to avoid.

Questions

  1. [blocking] Should a non-map targets (e.g. targets: false) still fail? Before this PR, bundle validate exited 1. Now it prints a located warning, exits 0 and uses the implicit default target (see the scalar_rewrite_diagnostic golden). The old Badness note only objected to the message and the missing location. Would you keep the located diagnostic but make it an error, or is the downgrade to a warning intended?

Comments outside the changed lines

  • [nice to have] acceptance/bundle/variables/target_override_shorthand_shapes/script: The targets date case repeats what acceptance/bundle/validate/variables/target_timestamp_shorthand already covers. The environments override cases sit next to acceptance/bundle/variables/environments_shorthand. The testing rules ask to extend the existing directory when coverage overlaps. Could the environments cases go into environments_shorthand, with the targets date case dropped here? Or is there a reason they need their own directory?

Comment thread .nextchanges/bundles/8183.md Resolved
@denik

denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Thanks for the review at 9bea59d. Addressed in 09f34e1:

  1. Non-map targets (blocking question): the downgrade was not intended. targets: false is an error again, now reported at its location (Error: expected map, found bool at targets, exit 1; see the scalar_rewrite_diagnostic golden). A review round over this comment found one more instance of the same class: a targets sequence whose item has a malformed variables block (targets: [{variables: oops}]) failed on main, and the fix had turned it into a warning that fell back to default. targets now keeps the rewrite in any shape, as on main. The new sequence-targets case pins it, and it fails if the skip is applied to targets again. A non-map environments stays a warning, as on main.
  2. Overlap with existing tests: the targets date case is gone, since validate/variables/target_timestamp_shorthand covers it. I kept the environments cases in target_override_shorthand_shapes instead of moving them into environments_shorthand. Most of them compare targets with environments for the same input (type-*, malformed-*), and toplevel needs both keys in one file. environments_shorthand is the single-config record from acc: record dropped short-form variable override under environments #8182. I'm happy to move date-environments and maps there if you prefer.

The description's "Gaps and risks" now also lists one more case this round found. It behaves like targets on main, so it is not new: a short-form override in an included file that conflicts in type with a full-form one fails with cannot merge string with int.

AI agent (opus5.5, isaac_claude)

@denik

denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up: #7975 removed the errcode acceptance helper, so the errcode calls this PR adds will fail with errcode: command not found once it's tested against current main.

To fix: use musterr CMD for a command that must fail, and run commands expected to succeed without a wrapper. When the exact exit code is what the test checks, print it after musterr with printf '\nExit code: %s\n' "$MUSTERR_EXIT_CODE". cmd || true is only for best-effort cleanup. Details are in .agents/rules/testing.md.

denik added a commit that referenced this pull request Nov 30, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/acc-environments-var-shorthand branch from 655d23a to 5f584e4 Compare November 30, 2026 12:55
@denik
denik force-pushed the denik/fix-environments-var-shorthand branch from 83f9ada to 3dd4049 Compare November 30, 2026 12:55
@denik

denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Agreed, done in 3dd4049, after rebasing the stack on main (#8182 on 39d0695, this PR on top):

  • target_override_shorthand_shapes: the two calls that must fail (malformed-targets, sequence-targets) now use musterr. All other calls (date-environments, type-*, malformed-environments, toplevel, maps) run without a wrapper. No test checks the exact exit code, so there is no printf of $MUSTERR_EXIT_CODE.
  • scalar_rewrite_diagnostic: the conflict with acc: replace errcode with musterr or a bare command #7975 was resolved to musterr trace $CLI bundle validate, since the scalar targets case is an error again.

The regenerated goldens only drop errcode from the >>> headers and the Exit code: 1 lines. There are no other changes, and no errcode is left in the diff. bundle/variables, bundle/override and bundle/validate acceptance tests pass locally.

AI agent (opus5.5, isaac_claude)

@denik
denik requested a review from andrewnester November 30, 2026 12:56
Base automatically changed from denik/acc-environments-var-shorthand to main November 30, 2026 14:29
@denik denik closed this in #8182 Nov 30, 2026
@denik denik reopened this Nov 30, 2026
@github-actions github-actions Bot added the DABs DABs related issues label Nov 30, 2026
denik and others added 4 commits November 30, 2026 14:48
rewriteShorthands rewrote target variable shorthands only under
'targets'. The deprecated 'environments' key is renamed to 'targets'
after loading, so its short-form overrides failed normalization and were
dropped with a warning. Rewrite both keys.

Co-authored-by: Isaac <no-reply@databricks.com>
Rewrite unquoted dates, don't panic on a non-string variable type, and
leave a targets or environments value that is not a map to normalization,
which reports it at its location, instead of aborting the load.

'environments' was not rewritten before, so it keeps what normalization
already applied: maps with 'default' or 'lookup' and non-map variables
blocks are left as they were, and only scalars and other values of
complex variables are rewritten. Fixes the recorded badness in
target_timestamp_shorthand and scalar_rewrite_diagnostic.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Under environments, a map with only variable definition keys, such as
{sensitive: false}, was applied as a definition before. For a complex
variable it is now rewritten to its value. Leave such maps as they were.

Co-authored-by: Isaac <no-reply@databricks.com>
denik and others added 5 commits November 30, 2026 14:48
…hapes

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Address review: a scalar targets value (targets: false) failed before
this PR, and the fix had turned it into a warning that fell back to the
default target. Report it as an error at targets instead. The same holds
for a targets sequence whose items have a malformed variables block, so
targets keeps the rewrite in any shape. Mention the new undefined-variable
failure under environments in the changelog. Commit the inputs of
target_override_shorthand_shapes as files, project values with gron.py,
and drop its targets date case, which
validate/variables/target_timestamp_shorthand already covers.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
errcode was removed from main in #7975. Calls that fail use musterr,
calls that succeed run without a wrapper.

Co-authored-by: Isaac <no-reply@databricks.com>

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at 3dd4049. Each finding was verified against the code.

No blocking issues found. 6 non-blocking comment(s) and 1 question(s) below.

This PR runs the short-form variable override rewrite for the deprecated environments key too, using a narrower "legacy" rule set. It also accepts unquoted dates as short forms, fixes the MustString panic on a non-string type, and reports a scalar targets value at its location. The core fix looks right. Remaining issues: variableDefinitionKeys leaves out value, which breaks the stated goal of keeping what normalization did before; the changelog overstates what the targets diagnostic covers; and there are a few test-convention points.

Questions

  1. Besides the environments rewrite, this PR changes targets behavior in three independent ways: it accepts KindTime short forms, fixes the MustString panic, and adds the located scalarTargetsError. Each changes its own golden and has its own changelog clause. AGENTS.md asks for one change per PR. Should these go into separate PRs, or do you prefer to keep them together here? (non-blocking)

Comment thread bundle/config/root.go Resolved
Comment thread .nextchanges/bundles/8183.md Resolved
Comment thread bundle/config/root.go Resolved
@denik
denik force-pushed the denik/fix-environments-var-shorthand branch from 3dd4049 to f8ef767 Compare November 30, 2026 14:53
@denik
denik requested a review from andrewnester November 30, 2026 14:54
Derive the keys of a variable definition from the TargetVariable JSON
tags. The hand-written list left out value, so under environments a
complex variable overridden with {value: ...} was read as a value; on
main normalization read it as a definition.

Move the cases of target_override_shorthand_shapes into the existing
tests on the same topic, using withdir and gron.py, and keep the
non-string type cases in target_override_nonstring_type. Add a table test
for isLegacyVariableOverrideDef. Say in the changelog that only a scalar
targets value gets a location.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik

denik commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

🤖 On the question of splitting the three targets changes (review at 3dd4049): I'd keep them in this PR for now. I checked each one by putting the old code back on 97ee686:

  • Unquoted dates (KindTime): needed so both keys behave the same. With the rewrite running for environments, a date short form there would be dropped with expected map, found time, while every other scalar is applied. Without this change validate/variables/target_timestamp_shorthand fails, both its targets case and the new environments one.
  • MustString → AsString: needed for the same reason. The rewrite now reaches the root type lookup from environments too, so type: 5 with a map override would crash the CLI there as well, as it already does under targets on main. Without this change variables/target_override_nonstring_type fails with the CLI's fatal-error output.
  • Located error for a scalar targets (scalarTargetsError): this one is not needed for parity. Without it validate/targets/scalar_rewrite_diagnostic fails only because it shows main's unlocated failed to rewrite ...: expected a map or sequence, found bool again. It is here because it is in the same rewrite path and closes the Badness that test recorded on main.

If a human reviewer prefers it, I'll move the located-error change, and the other two if wanted, into a separate PR on top of this one.

AI agent (opus5.5, isaac_claude)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants