Repository navigation
Fix target overrides when the bundle key is null - #8166
Conversation
52772c5 to
0f1623b
Compare
Regression test report ✅Commit: Selected 1 changed tests (limit=20, 0 not selected) 2 tests: regression=2 unreleased=0 coverage=0 failing=0
TestAccept/bundle/override/null-bundle-key/DMS=: branch ✅ | main (d164fcc) ❌ | latest (v1.28.0) ❌main (d164fcc): latest (v1.28.0): TestAccept/bundle/override/null-bundle-key/DMS=true: branch ✅ | main (d164fcc) ❌ | latest (v1.28.0) ❌main (d164fcc): latest (v1.28.0): |
✅ Integration test reportCommit: bbee465
Top 6 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 0f1623b. Each finding was verified against the code.
No blocking issues found.
This PR makes MergeTargetOverrides treat a null bundle key the same way as a missing one. It creates an empty map that keeps the null value's location, so overrides of mode, cluster_id and git now work instead of failing with expected a map to index ..., found nil. The guard is small and matches the existing KindInvalid handling, and the updated acceptance output covers all three overrides plus the case with no overrides. I found no problems that need changing.
0f1623b to
7c5bef5
Compare
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Sonnet 5.5, cross-verified). Only points the reviewers agreed on are posted.
No issues found.
An empty bundle key in databricks.yml is a null value, not a missing one, so the guard that creates the bundle map before setting mode, cluster_id and git did not fire and SetByPath failed with 'expected a map to index "bundle.mode", found nil'. Treat null like missing and keep its location. Co-authored-by: Isaac <no-reply@databricks.com>
7c5bef5 to
bbee465
Compare
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
No issues found.
Changes
MergeTargetOverridesin bundle/config/root.go now creates thebundlemap before settingmode,cluster_idandgitwhen the key is null, not only when it is missing. The new map keeps the null value's location, so diagnostics atbundlestill point to databricks.yml.Effect in acceptance/bundle/override/null-bundle-key (from the test PR): the targets with
mode,cluster_idandgitnow validate and show the overridden value (json.bundle.mode = "development";,json.bundle.cluster_id = "0123-456789-abcdef";,json.bundle.git.branch = "main";) instead of failing withexpected a map to index "bundle.mode", found nil. Badness is removed.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).bundle:with all its fields commented out is valid YAML and behaves likebundle: {}everywhere else; only a target that setsmode,cluster_idorgitfailed, with a message that doesn't point at the config.Test: #8165
Gaps and risks
bundle validateis tested; deploy goes through the sameSelectTargetmutator.bundlekey has no name, so it already gets arequired field "name" is not setwarning; the fix doesn't change that.git: ${var.g}with a complex variable fails withcannot merge map with stringwhen the root has nobundle.git; and target variable shorthands under the deprecatedenvironmentskey are not rewritten, so the override is dropped with a warning.🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.