Repository navigation
config: ForceSendFields on CLI config structs - #7117
Merged
Merged
Conversation
…rides Add ForceSendFields []string fields to key CLI-owned config structs so that explicitly set zero values can override non-zero base values. Affected structs: Presets, Lifecycle, LifecycleWithStarted, JobRunLifecycle, Experimental, Bundle, Deployment, Lock, Workspace, Artifact, AppEnvVar, Target, Script, Python. The ForceSendFields field is marked json:"-" to exclude it from JSON marshaling. The libs/dyn/convert layer already has support for populating and using this field. Co-authored-by: Isaac <no-reply@databricks.com>
Test that explicit zero values in target overrides win over non-zero base values: - target_lifecycle_override: prevent_destroy false overrides true - target_experimental_override: experimental flags false override true Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
Commit: Regression test reportSelected 2 changed tests (limit=20, 0 not selected) 4 tests: regression=4 unreleased=0 coverage=0 failing=0
TestAccept/bundle/validate/includes/clears_unforced_preset_values/DMS=: branch ✅ | main (8743718) ❌ | latest (v1.21.0) ❌main (8743718): latest (v1.21.0): TestAccept/bundle/validate/includes/clears_unforced_preset_values/DMS=true: branch ✅ | main (8743718) ❌ | latest (v1.21.0) ❌main (8743718): latest (v1.21.0): TestAccept/bundle/validate/lifecycle_override/DMS=: branch ✅ | main (8743718) ❌ | latest (v1.21.0) ❌main (8743718): latest (v1.21.0): TestAccept/bundle/validate/lifecycle_override/DMS=true: branch ✅ | main (8743718) ❌ | latest (v1.21.0) ❌main (8743718): latest (v1.21.0): |
Collaborator
Integration test reportCommit: 5322045
Top 3 slowest tests (at least 2 minutes):
|
Remove FSF from structs with pointer/map/slice/struct fields to avoid breaking null overrides: - Target (has pointers like RunAs, Workspace, etc.) - Script, Python (speculative, unused) - LifecycleWithStarted, JobRunLifecycle (have pointer/slice fields) - Workspace (has CurrentUser *User) - Experimental (has map, struct, pointer fields) - Bundle (has Terraform pointer, Git struct) - Lock (has Enabled *bool) - Artifact (has slice, pointer fields) Remove broken acceptance tests: - target_experimental_override (Target has no experimental field) - target_lifecycle_override (moved to cleaner single test) Keep only on truly safe structs: Presets, Lifecycle, Deployment, AppEnvVar Co-authored-by: Isaac <no-reply@databricks.com>
With ForceSendFields on Presets, explicit zero values (name_prefix: "", jobs_max_concurrent_runs: 0, artifacts_dynamic_version: false) are now preserved in bundle validate -o json output instead of being collapsed to an empty presets object. This is a more faithful representation of the bundle configuration and enables zero-value overrides to work in includes. Co-authored-by: Isaac <no-reply@databricks.com>
When creating AppEnvVar literals, the ForceSendFields field must be initialized even though it's empty. This fixes the exhaustruct_v5 lint error. Co-authored-by: Isaac <no-reply@databricks.com>
Test verifies that prevent_destroy: false in an include override wins over prevent_destroy: true in root - a key zero-value override scenario. Changelog fragment documents the user-visible change: bundle validate now preserves explicit zero values in presets output. Test FAILS on origin/main (shows null for overrides) and PASSES on this branch (shows false), proving the fix works. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…esources Co-authored-by: Isaac <no-reply@databricks.com>
…catenation Co-authored-by: Isaac <no-reply@databricks.com>
denik
enabled auto-merge
October 20, 2026 10:12
andrewnester
approved these changes
Oct 20, 2026
denik
added a commit
that referenced
this pull request
Oct 20, 2026
#7117 added ForceSendFields to Presets, so a written zero is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
denik
added a commit
that referenced
this pull request
Oct 20, 2026
#7117 added ForceSendFields to Presets, so a written zero is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
denik
added a commit
that referenced
this pull request
Oct 21, 2026
#7117 added ForceSendFields to Presets, so a written zero is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
denik
added a commit
that referenced
this pull request
Oct 21, 2026
#7117 added ForceSendFields to Presets, so a written zero is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
denik
added a commit
that referenced
this pull request
Oct 21, 2026
#7117 added ForceSendFields to Presets, so a written zero is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add
ForceSendFieldstoPresets,LifecycleandDeployment, so explicit zero values (false,0,"") written in a target or include replace non-zero base values.Fixes on main:
targets.dev.resources.jobs.j.lifecycle.prevent_destroy: falsewas ignored and the basetruestayed.Visible change:
bundle validate -o jsonnow shows explicit zero presets (e.g.name_prefix: "") instead ofpresets: {}.Not added to
Target,Workspace,Bundle,Experimental,Lock,Artifactor the other structs: they have pointer/map/slice fields, andForceSendFieldsthere turns explicitnulloverrides (e.g.run_as:) into forced values.Prerequisite for removing
libs/dyn(#7098).Tests
validate/lifecycle_override: fails on main, passes here.validate/includes/clears_unforced_preset_valuesgolden updated.This pull request and its description were written by Isaac.