Repository navigation
acc: record target override failure when the bundle key is null - #8165
Conversation
When databricks.yml has an empty (null) bundle key, a target that sets mode, cluster_id or git fails with 'expected a map to index "bundle.mode", found nil'. Record the current behavior with Badness. Co-authored-by: Isaac <no-reply@databricks.com>
Regression test report ✅Commit: Selected 1 changed tests (limit=20, 0 not selected) 2 tests: regression=0 unreleased=0 coverage=2 failing=0
|
✅ Integration test reportCommit: ab91473
Top 3 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 14a0932. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR adds the acceptance test acceptance/bundle/override/null-bundle-key. It captures the current failure when bundle: is present but null and a target sets mode, cluster_id or git, with a Badness entry describing the expected behavior. The test is fine as a record of the bug. The one problem is that it filters the JSON output with an inline jq pipeline, which the testing rules ask to replace with the acceptance/bin helpers.
Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Opus 5.5 + Claude Sonnet 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
No new issues found.
Changes
New test acceptance/bundle/override/null-bundle-key: a databricks.yml whose
bundle:key is present but empty (null), as it is when every field under it is commented out, with four targets.bundle validate -o json -t <target>currently:mode: development:Error: failed to perform target override for target=with_mode: expected a map to index "bundle.mode", found nilcluster_id: ...: the same error forbundle.cluster_idgit: {branch: main}: the same error forbundle.gitrequired field "name" is not setwarning.With
bundle: {}instead ofbundle:all four targets validate. The name is left out on purpose (it would makebundlea map);workspace.root_pathmakes the bundle valid without one. Badness in test.toml describes the wrong behavior and the expected one.Cause:
MergeTargetOverridesin bundle/config/root.go creates thebundlemap before it setsmode,cluster_idandgit, but only when the key is missing (dyn.KindInvalid), not when it is null (dyn.KindNil).Why
This PR was created by analyzing coverage gaps. Coverage: http://go/cli/dashboard/coverage/file/bundle/config/root.go (
(*Root).MergeTargetOverrides, lines 329-451: the error returns after settingbundle.mode,bundle.cluster_idandbundle.gitnever ran).This is a new small test next to the other override tests; none of them has a null
bundlekey. It only runsbundle validate(about 1-2s locally, DMS matrix inherited from acceptance/bundle, 2 variants).Fix: #8166
Gaps and risks
bundle validateruns, not deploy (deploy fails the same way, since both select the target through the same mutator).🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.