From 04ae399527147b23a22a3e194cc823c02bf260aa Mon Sep 17 00:00:00 2001 From: "denis.bilenko" Date: Sat, 28 Nov 2026 08:35:08 +0000 Subject: [PATCH 1/2] acc: record that a null property schema in a template panics A template schema with "properties": {"p": null} (at the root, or in a root anyOf branch with a matching config value) makes bundle init panic with a nil pointer dereference. Record the current behavior with a Badness note. Co-authored-by: Isaac --- .../any-of/databricks_template_schema.json | 15 +++++++++++ .../any-of/template/values.txt.tmpl | 1 + .../null-property-schema/out.test.toml | 2 ++ .../null-property-schema/output.txt | 26 +++++++++++++++++++ .../null-property-schema/q.json | 1 + .../null-property-schema/script | 6 +++++ .../null-property-schema/test.toml | 2 ++ .../top/databricks_template_schema.json | 5 ++++ .../top/template/values.txt.tmpl | 1 + 9 files changed, 59 insertions(+) create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/any-of/databricks_template_schema.json create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/any-of/template/values.txt.tmpl create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/out.test.toml create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/output.txt create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/q.json create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/script create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/test.toml create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/top/databricks_template_schema.json create mode 100644 acceptance/bundle/templates-machinery/null-property-schema/top/template/values.txt.tmpl diff --git a/acceptance/bundle/templates-machinery/null-property-schema/any-of/databricks_template_schema.json b/acceptance/bundle/templates-machinery/null-property-schema/any-of/databricks_template_schema.json new file mode 100644 index 00000000000..583a0c09faf --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/any-of/databricks_template_schema.json @@ -0,0 +1,15 @@ +{ + "properties": { + "q": { + "type": "integer", + "description": "q" + } + }, + "anyOf": [ + { + "properties": { + "q": null + } + } + ] +} diff --git a/acceptance/bundle/templates-machinery/null-property-schema/any-of/template/values.txt.tmpl b/acceptance/bundle/templates-machinery/null-property-schema/any-of/template/values.txt.tmpl new file mode 100644 index 00000000000..13094d3d500 --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/any-of/template/values.txt.tmpl @@ -0,0 +1 @@ +value: ok diff --git a/acceptance/bundle/templates-machinery/null-property-schema/out.test.toml b/acceptance/bundle/templates-machinery/null-property-schema/out.test.toml new file mode 100644 index 00000000000..a927a5fbc06 --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/out.test.toml @@ -0,0 +1,2 @@ +Cloud = false +EnvMatrix.DMS = ["", "true"] diff --git a/acceptance/bundle/templates-machinery/null-property-schema/output.txt b/acceptance/bundle/templates-machinery/null-property-schema/output.txt new file mode 100644 index 00000000000..1a39e922d11 --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/output.txt @@ -0,0 +1,26 @@ + +=== top-level property whose schema is null + +>>> musterr [CLI] bundle init ./top --output-dir rendered +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 + +CLI Version: [CLI_VERSION] + +Panic Payload: runtime error: invalid memory address or nil pointer dereference + +Stack Trace: + +=== property whose schema is null in a root anyOf branch + +>>> musterr [CLI] bundle init ./any-of --config-file q.json --output-dir rendered +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 + +CLI Version: [CLI_VERSION] + +Panic Payload: runtime error: invalid memory address or nil pointer dereference + +Stack Trace: diff --git a/acceptance/bundle/templates-machinery/null-property-schema/q.json b/acceptance/bundle/templates-machinery/null-property-schema/q.json new file mode 100644 index 00000000000..4b6a2e5c65a --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/q.json @@ -0,0 +1 @@ +{"q": 1} diff --git a/acceptance/bundle/templates-machinery/null-property-schema/script b/acceptance/bundle/templates-machinery/null-property-schema/script new file mode 100644 index 00000000000..bb90c9c6eef --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/script @@ -0,0 +1,6 @@ +# The panic's stack trace depends on the build, so drop its frames. +title "top-level property whose schema is null" +trace musterr $CLI bundle init ./top --output-dir rendered 2>&1 | sed '/^goroutine /,$d' + +title "property whose schema is null in a root anyOf branch" +trace musterr $CLI bundle init ./any-of --config-file q.json --output-dir rendered 2>&1 | sed '/^goroutine /,$d' diff --git a/acceptance/bundle/templates-machinery/null-property-schema/test.toml b/acceptance/bundle/templates-machinery/null-property-schema/test.toml new file mode 100644 index 00000000000..a7df3b5f2ff --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/test.toml @@ -0,0 +1,2 @@ +Badness = "A template schema property whose schema is null (\"p\": null under properties), at the root or in a root anyOf branch, makes bundle init panic with a nil pointer dereference; it should fail with an error naming the property." +Ignore = ["rendered"] diff --git a/acceptance/bundle/templates-machinery/null-property-schema/top/databricks_template_schema.json b/acceptance/bundle/templates-machinery/null-property-schema/top/databricks_template_schema.json new file mode 100644 index 00000000000..cc7b87b531a --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/top/databricks_template_schema.json @@ -0,0 +1,5 @@ +{ + "properties": { + "p": null + } +} diff --git a/acceptance/bundle/templates-machinery/null-property-schema/top/template/values.txt.tmpl b/acceptance/bundle/templates-machinery/null-property-schema/top/template/values.txt.tmpl new file mode 100644 index 00000000000..13094d3d500 --- /dev/null +++ b/acceptance/bundle/templates-machinery/null-property-schema/top/template/values.txt.tmpl @@ -0,0 +1 @@ +value: ok From 8498221bc8b37d006a8f8cdb1ba77575da062281 Mon Sep 17 00:00:00 2001 From: "denis.bilenko" Date: Sun, 29 Nov 2026 01:11:25 +0000 Subject: [PATCH 2/2] Keep the raw panic output of null-property-schema in LOG files The stack trace says where each panic comes from (LoadFS for the root case, validateEnum for the anyOf case); go test -v shows LOG.* files but the runner doesn't diff them. Co-authored-by: Isaac --- .../bundle/templates-machinery/null-property-schema/script | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/templates-machinery/null-property-schema/script b/acceptance/bundle/templates-machinery/null-property-schema/script index bb90c9c6eef..d675aa2ba32 100644 --- a/acceptance/bundle/templates-machinery/null-property-schema/script +++ b/acceptance/bundle/templates-machinery/null-property-schema/script @@ -1,6 +1,7 @@ -# The panic's stack trace depends on the build, so drop its frames. +# The panic's stack trace depends on the build, so keep it in LOG.* (shown by +# go test -v, not diffed) and drop its frames from the output. title "top-level property whose schema is null" -trace musterr $CLI bundle init ./top --output-dir rendered 2>&1 | sed '/^goroutine /,$d' +trace musterr $CLI bundle init ./top --output-dir rendered 2>&1 | tee LOG.top | sed '/^goroutine /,$d' title "property whose schema is null in a root anyOf branch" -trace musterr $CLI bundle init ./any-of --config-file q.json --output-dir rendered 2>&1 | sed '/^goroutine /,$d' +trace musterr $CLI bundle init ./any-of --config-file q.json --output-dir rendered 2>&1 | tee LOG.any-of | sed '/^goroutine /,$d'