Skip to content

acc: record that a null property schema in a template panics - #8167

Merged
denik merged 2 commits into
mainfrom
denik/acc-jsonschema-null-property
Nov 29, 2026
Merged

denik merged 2 commits into
mainfrom
denik/acc-jsonschema-null-property

Conversation

@denik

@denik denik commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Changes

New test acceptance/bundle/templates-machinery/null-property-schema: custom templates initialized non-interactively with bundle init, whose databricks_template_schema.json has a property whose schema is JSON null:

  • "properties": {"p": null} at the root: the CLI panics (runtime error: invalid memory address or nil pointer dereference) while loading the schema, even without a config file.
  • "anyOf": [{"properties": {"q": null}}], with q also declared at the root and set in --config-file: the CLI panics while validating the config.

The stack frames depend on the build, so the script tees each command's raw output into LOG.top / LOG.any-of (shown by go test -v, not diffed; they show the panic sites, LoadFS and validateEnum) and drops the frames after goroutine from output.txt. Badness in test.toml describes the wrong behavior and the expected one.

Cause: json.Unmarshal stores "p": null in Properties map[string]*Schema as a nil pointer. LoadFS in libs/jsonschema/schema.go reads property.Type on it for the root case, and the instance validators (validateEnum and the others in libs/jsonschema/instance.go) read fields of it for the anyOf case.

Why

This PR was created by analyzing coverage gaps. Coverage: http://go/cli/dashboard/coverage/file/libs/jsonschema/schema.go (LoadFS, lines 323-368: covered by unit and acceptance tests, but none loads a schema with a null property).
This is a new small test next to the other templates-machinery tests instead of an addition to null-value, which is about null values in the config file (and which an open PR is changing). Runtime is about 0.06s per variant (DMS matrix inherited from acceptance/bundle, 2 variants).

Fix: #8168

Gaps and risks

  • Test-only. The skip_prompt_if variant of the same panic needs a TTY, so it is covered by unit tests in the fix PR instead.
  • Risk: low.

🤖 AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

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 <no-reply@databricks.com>
@github-actions github-actions Bot added the DABs DABs related issues label Nov 29, 2026
@github-actions github-actions Bot added the test-only-fix PRs that update failing of flaky tests without changing CLI code. label Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Regression test report ✅

Commit: 8498221bc | Workflow run

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

2 tests: regression=0 unreleased=0 coverage=2 failing=0
test branch main (5cdaeb8) latest (v1.28.0)
TestAccept/bundle/templates-machinery/null-property-schema/DMS= ✅ ✅ ✅
TestAccept/bundle/templates-machinery/null-property-schema/DMS=true ✅ ✅ ✅

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 8498221

Run: 46210172458

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 2 1 171 18 4:37
💚​ aws-windows-latest-4core-16gb 1 173 18 1:52
💚​ azure linux-2core-8gb 1 172 18 4:34
💚​ azure-windows-latest-4core-16gb 1 172 18 1:33
💚​ gcp linux-2core-8gb 1 173 18 4:27
💚​ gcp-windows-latest-4core-16gb 1 173 18 2:18
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
🔄​ TestFilerRecursiveDelete 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestFilerRecursiveDelete/files 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:19 azure linux-2core-8gb TestAccept
3:19 aws linux-2core-8gb TestAccept
3:17 gcp linux-2core-8gb TestAccept

@denik
denik marked this pull request as ready for review November 29, 2026 00:45
@denik
denik requested review from a team as code owners November 29, 2026 00:45

@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 04ae399. Each finding was verified against the code.

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

This PR adds an acceptance test that records two bundle init panics, both caused by a template schema property whose schema is JSON null: one at the root and one inside a root anyOf branch. The fixtures are small and the Badness note describes the expected fix. My one change request is about the stack-trace filter, which drops every frame. As a result, the golden output can't tell these panics apart from any other nil dereference, and the trace isn't kept anywhere.

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 <no-reply@databricks.com>
@denik
denik requested a review from andrewnester November 29, 2026 01:12

@Sankalp-Mittal Sankalp-Mittal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No issues found.

@denik
denik added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit d164fcc Nov 29, 2026
27 checks passed
@denik
denik deleted the denik/acc-jsonschema-null-property branch November 29, 2026 02:21
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 test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants