Skip to content

Fix config-remote-sync failing to add a key the YAML already declares - #7947

Open
ilyakuz-db wants to merge 8 commits into
mainfrom
ilya/config-sync-add-existing-key
Open

ilyakuz-db wants to merge 8 commits into
mainfrom
ilya/config-sync-add-existing-key

Conversation

@ilyakuz-db

@ilyakuz-db ilyakuz-db commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Changes

bundle config-remote-sync --save no longer fails with key ... already exists and can not be added when the remote has a value for a field that the merged configuration lacks but the YAML still declares.

  • When a mutator clears or rebuilds a field (for example OverrideCompute dropping job_cluster_key on a target with cluster_id), the change is resolved against the pre-resolved configuration: it is reported as replace, written to the block whose definition wins the merge, and keeps ${...} references.
  • A change to a field outside any sequence is written to the block whose definition wins, so a target override that also declares the field is the one updated.
  • The YAML patcher replaces a key the file writes as null (absent from the merged configuration) instead of failing the add.
  • Only keys the file writes itself are replaced: a key inherited through a YAML merge key is still added, as before, and a key with an anchor above, on or inside its value is never replaced, so aliases keep loading. A cleared field written as a complex variable reference is skipped rather than hardcoded.

Why

Sync picks add or replace from the merged configuration, which can lack a key the file has, and the YAML patcher rejects an add on an existing key, so the whole save failed.

Tests

Reproduced the error with a cluster_id target first, then added unit tests for the patcher (including anchored keys) and acceptance tests for a cluster_id target (including ${var...} and complex variable values), merge keys with anchors inside and outside resources, a task split across the top-level and target blocks, and a field declared in both blocks, plain and anchored. Existing config-remote-sync acceptance tests pass unchanged.

Status Check Revision Comments
❌ Local review 7e0980b (latest) 3 rounds; one P1 left: an anchored winning value is skipped but still listed as replace
✅ Design review 1217292 RIGHT-SIZED: the fix lands where changes are located against the pre-mutator YAML
⚠️ E2E validation 7e0980b (latest) not run on a workspace; acceptance tests run locally
➖ Isaac review 7e0980b (latest) n/a
⏳ Code owners review 7e0980b (latest) andrewnester commented on 58662c4; both points fixed
✅ CI / merge conflicts 7e0980b (latest) no conflicts; 18 checks pass, 9 skipped

✅ success · ⏳ pending · ⚠️ warning · ❌ failed · ➖ n/a

This pull request and its description were written by Isaac.

@ilyakuz-db
ilyakuz-db requested review from a team as code owners November 24, 2026 20:34
@ilyakuz-db ilyakuz-db self-assigned this Nov 24, 2026
@github-actions github-actions Bot added the DABs DABs related issues label Nov 24, 2026

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

Not ready yet: 1 blocking issue(s), tagged [blocking]; 1 open question(s) about a change users could be hurt by.

This PR stops bundle config-remote-sync --save from failing with already exists when a mutator has cleared a field the YAML still declares. It does this by resolving those changes against the pre-resolved config as replaces, sending non-sequence edits to the block that wins the merge, and making the patcher replace an existing key on add. The main case works, but the anchor check in ResolveChanges misses anchors defined inside resources, which can abort a save that works at base. The new acceptance output also shows the saved edit never takes effect on the cluster_id target, which needs a decision before merge.

Questions

  1. [blocking] On a cluster_id target, OverrideCompute clears job_cluster_key on every deploy. So the value --save writes into the top-level block never reaches the synced target, and the next sync reports the same replace again (cluster_override_existing_key/output.txt, second sync). Should these changes be marked skip and counted, like the variable-reference case at resolve.go:287-292? Or do users really want the top-level value, which other targets deploy, rewritten on every run?
  2. The new branch in routeChange (sequences.go:369-373) applies only to paths with no sequence. It sends every non-removal edit to winningBlock, with no top-level-first fallback. It isn't involved in the job_cluster_key fix, which goes through sequence routing. It fixes a separate case where a top-level value was rewritten while a target override kept winning (split/top_level_field_both_blocks). Should this go in its own PR, per the one-change-per-PR rule, or stay here? (non-blocking)

Comments outside the changed lines

  • [nice to have] cmd/bundle/config_remote_sync.go: This changes what bundle config-remote-sync --save does for users. A save that used to fail now succeeds, these changes are now reported as replace instead of add, and a target override's value is now the one rewritten. The diff adds nothing under .nextchanges/. Can you add a fragment under .nextchanges/bundles/?

Comment thread bundle/configsync/resolve.go Outdated
if blocks != nil && resolved.leaf.Location().File == "" && configChange.Operation != OperationRemove &&
!slices.ContainsFunc(resolved.steps, func(s sequenceStep) bool { return s.newElement }) {
if declared, ok := preResolvedValueAt(preResolved, mergedIndexPath.String()); ok {
if _, inBlock := blocks.winningBlock(declared); inBlock {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[blocking] The yamlloader gives values pulled in through <<: *anchor the anchor's own locations. So when the anchor sits inside resources, winningBlock(declared) still maps it to the top-level block, and the comment's anchor exclusion doesn't apply. Example: task A is - &base {task_key: a, job_cluster_key: shared, ...}, task B is - <<: *base with task_key: b, and the target sets cluster_id. B's job_cluster_key becomes a replace at B's path, which has no such key in the file. The replace then fails in applyChange and the whole save aborts. At base the same input stayed an add and wrote the key explicitly on B. Could this check that the routed block actually has the key at the block-local path, or leave the add to the patcher's yamlKeyExists upgrade?

}})
case OperationAdd:
opType := yamlpatch.OperationAdd
// A key the file writes as null is absent from the merged config, so the change

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The comment says this is for a key the file writes as null, but yamlKeyExists turns an add on any existing mapping key into a replace. The scalar case in TestApplyChangeAddToExistingKey shows job_cluster_key: old being overwritten. For an unrouted change it also means the top-level candidate wins and AltWritePath is never tried. Maybe: "The merged config can lack a key the file declares (written as null, or cleared by a mutator), so the change arrives as an add; as in RFC 6902, an add on an existing key replaces it."

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 7e0980bc7 | Workflow run

Regression test report

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

10 tests: regression=8 unreleased=0 coverage=2 failing=0
test branch main (c639f9d) latest (v1.28.0)
TestAccept/bundle/config-remote-sync/cluster_override_existing_key/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_override_existing_key/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_override_merge_key/DMS= ✅ ✅ ✅
TestAccept/bundle/config-remote-sync/cluster_override_merge_key/DMS=true ✅ ✅ ✅
TestAccept/bundle/config-remote-sync/split/anchored_override_field/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/split/anchored_override_field/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/split/cleared_key_override/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/split/cleared_key_override/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_override_existing_key/DMS=: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/cluster_override_existing_key/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_override_existing_k73886568/002/output.txt
        @@ -8,44 +8,8 @@
         === Sync replaces the job_cluster_key the YAML already has and keeps the variables
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Error: failed to generate YAML files: failed to apply change to file [TEST_TMP_DIR]/databricks.yml for a field resources.jobs.my_job.tasks[2].new_cluster: failed to apply change: op add /resources/jobs/my_job/tasks/2/new_cluster: key new_cluster already exists and can not be added
         
        -Resource: resources.jobs.my_job
        -  tasks[task_key='by_complex_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_complex_variable'].new_cluster: skip
        -  tasks[task_key='by_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_variable'].job_cluster_key: replace
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -28,5 +28,5 @@
        -       tasks:
        -         - task_key: main
        --          job_cluster_key: shared
        -+          job_cluster_key: other
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/nb
        -
        -=== The override still clears job_cluster_key, so the next sync detects it again
        -
        ->>> [CLI] bundle config-remote-sync -t dev
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.my_job
        -  tasks[task_key='by_complex_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_complex_variable'].new_cluster: skip
        -  tasks[task_key='by_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_variable'].job_cluster_key: replace
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
         >>> [CLI] bundle destroy --auto-approve -t dev
         The following resources will be deleted:
           delete resources.jobs.my_job
        @@ -53,3 +16,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev
         
         Destroy: 1 deleted
        +
        +Exit code: 1

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/cluster_override_existing_key/DMS=true: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/cluster_override_existing_key/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_override_existing_k1131896623/002/output.txt
        @@ -8,44 +8,8 @@
         === Sync replaces the job_cluster_key the YAML already has and keeps the variables
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Error: failed to generate YAML files: failed to apply change to file [TEST_TMP_DIR]/databricks.yml for a field resources.jobs.my_job.tasks[2].new_cluster: failed to apply change: op add /resources/jobs/my_job/tasks/2/new_cluster: key new_cluster already exists and can not be added
         
        -Resource: resources.jobs.my_job
        -  tasks[task_key='by_complex_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_complex_variable'].new_cluster: skip
        -  tasks[task_key='by_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_variable'].job_cluster_key: replace
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -28,5 +28,5 @@
        -       tasks:
        -         - task_key: main
        --          job_cluster_key: shared
        -+          job_cluster_key: other
        -           notebook_task:
        -             notebook_path: /Users/{{workspace_user_name}}/nb
        -
        -=== The override still clears job_cluster_key, so the next sync detects it again
        -
        ->>> [CLI] bundle config-remote-sync -t dev
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.my_job
        -  tasks[task_key='by_complex_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_complex_variable'].new_cluster: skip
        -  tasks[task_key='by_variable'].existing_cluster_id: remove
        -  tasks[task_key='by_variable'].job_cluster_key: replace
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
         >>> [CLI] bundle destroy --auto-approve -t dev
         The following resources will be deleted:
           delete resources.jobs.my_job
        @@ -53,3 +16,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev
         
         Destroy: 1 deleted
        +
        +Exit code: 1

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/split/anchored_override_field/DMS=: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/split/anchored_override_field/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncsplitanchored_override_fie1708614252/002/output.txt
        @@ -16,6 +16,15 @@
         
         
         >>> diff.py databricks.yml.backup databricks.yml
        +--- databricks.yml.backup
        ++++ databricks.yml
        +@@ -8,5 +8,5 @@
        +   jobs:
        +     my_job:
        +-      max_concurrent_runs: 1
        ++      max_concurrent_runs: 10
        +       tasks:
        +         - task_key: main
         
         >>> [CLI] bundle validate -t dev -o json
         {"max_concurrent_runs":2,"timeout_seconds":2}

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/split/anchored_override_field/DMS=true: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/split/anchored_override_field/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncsplitanchored_override_fie4100110892/002/output.txt
        @@ -16,6 +16,15 @@
         
         
         >>> diff.py databricks.yml.backup databricks.yml
        +--- databricks.yml.backup
        ++++ databricks.yml
        +@@ -8,5 +8,5 @@
        +   jobs:
        +     my_job:
        +-      max_concurrent_runs: 1
        ++      max_concurrent_runs: 10
        +       tasks:
        +         - task_key: main
         
         >>> [CLI] bundle validate -t dev -o json
         {"max_concurrent_runs":2,"timeout_seconds":2}

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/split/cleared_key_override/DMS=: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/split/cleared_key_override/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncsplitcleared_key_override1884978601/002/output.txt
        @@ -8,24 +8,8 @@
         === Sync replaces the target's job_cluster_key
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Error: failed to generate YAML files: failed to apply change to file [TEST_TMP_DIR]/databricks.yml for a field resources.jobs.my_job.tasks[0].job_cluster_key: failed to apply change: op add /resources/jobs/my_job/tasks/0/job_cluster_key: key job_cluster_key already exists and can not be added
         
        -Resource: resources.jobs.my_job
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -33,4 +33,4 @@
        -           tasks:
        -             - task_key: main
        --              job_cluster_key: shared
        -+              job_cluster_key: other
        -               max_retries: 1
        -
         >>> [CLI] bundle destroy --auto-approve -t dev
         The following resources will be deleted:
           delete resources.jobs.my_job
        @@ -33,3 +16,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev
         
         Destroy: 1 deleted
        +
        +Exit code: 1

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/split/cleared_key_override/DMS=true: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/split/cleared_key_override/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncsplitcleared_key_override931019324/002/output.txt
        @@ -8,24 +8,8 @@
         === Sync replaces the target's job_cluster_key
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Error: failed to generate YAML files: failed to apply change to file [TEST_TMP_DIR]/databricks.yml for a field resources.jobs.my_job.tasks[0].job_cluster_key: failed to apply change: op add /resources/jobs/my_job/tasks/0/job_cluster_key: key job_cluster_key already exists and can not be added
         
        -Resource: resources.jobs.my_job
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -33,4 +33,4 @@
        -           tasks:
        -             - task_key: main
        --              job_cluster_key: shared
        -+              job_cluster_key: other
        -               max_retries: 1
        -
         >>> [CLI] bundle destroy --auto-approve -t dev
         The following resources will be deleted:
           delete resources.jobs.my_job
        @@ -33,3 +16,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev
         
         Destroy: 1 deleted
        +
        +Exit code: 1
        
FAIL

latest (v1.28.0):

acceptance_test.go:1402: Diff:
        --- bundle/config-remote-sync/split/cleared_key_override/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncsplitcleared_key_override2296219287/002/output.txt
        @@ -8,24 +8,8 @@
         === Sync replaces the target's job_cluster_key
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Error: failed to generate YAML files: failed to apply change to file [TEST_TMP_DIR]/databricks.yml for a field resources.jobs.my_job.tasks[0].job_cluster_key: failed to apply change: op add /resources/jobs/my_job/tasks/0/job_cluster_key: key job_cluster_key already exists and can not be added
         
        -Resource: resources.jobs.my_job
        -  tasks[task_key='main'].existing_cluster_id: remove
        -  tasks[task_key='main'].job_cluster_key: replace
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -33,4 +33,4 @@
        -           tasks:
        -             - task_key: main
        --              job_cluster_key: shared
        -+              job_cluster_key: other
        -               max_retries: 1
        -
         >>> [CLI] bundle destroy --auto-approve -t dev
         The following resources will be deleted:
           delete resources.jobs.my_job
        @@ -33,3 +16,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev
         
         Destroy: 1 deleted
        +
        +Exit code: 1
TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS=: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...\nCreated jobs.my_job\nFiles: 2 uploaded, 0 deleted\nResources: 1 created, 0 changed, 0 deleted, 0 unchanged\n\n=== Change the field remotely\n\n=== Sync replaces the target's value\n\n>>> [CLI] bundle config-remote-sync -t dev --save\nDetected changes in 1 resource(s):\n\nResource: resources.jobs.my_job\n  max_concurrent_runs: replace\n\n\n\n>>> diff.py databricks.yml.backup databricks.yml\n--- databricks.yml.backup\n+++ databricks.yml\n@@ -19,3 +19,3 @@\n       jobs:\n         my_job:\n-          max_concurrent_runs: 2\n+          max_concurrent_runs: 10\n\n>>> [CLI] bundle destroy --auto-approve -t dev\nThe following resources will be deleted:\n  delete resources.jobs.my_job\n\nAll files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev\n\nDestroy: 1 deleted\n"
        	            	actual  : "Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...\nCreated jobs.my_job\nFiles: 2 uploaded, 0 deleted\nResources: 1 created, 0 changed, 0 deleted, 0 unchanged\n\n=== Change the field remotely\n\n=== Sync replaces the target's value\n\n>>> [CLI] bundle config-remote-sync -t dev --save\nDetected changes in 1 resource(s):\n\nResource: resources.jobs.my_job\n  max_concurrent_runs: replace\n\n\n\n>>> diff.py databricks.yml.backup databricks.yml\n--- databricks.yml.backup\n+++ databricks.yml\n@@ -8,5 +8,5 @@\n   jobs:\n     my_job:\n-      max_concurrent_runs: 1\n+      max_concurrent_runs: 10\n       tasks:\n         - task_key: main\n\n>>> [CLI] bundle destroy --auto-approve -t dev\nThe following resources will be deleted:\n  delete resources.jobs.my_job\n\nAll files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev\n\nDestroy: 1 deleted\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -20,7 +20,9 @@
        	            	 +++ databricks.yml
        	            	-@@ -19,3 +19,3 @@
        	            	-       jobs:
        	            	-         my_job:
        	            	--          max_concurrent_runs: 2
        	            	-+          max_concurrent_runs: 10
        	            	+@@ -8,5 +8,5 @@
        	            	+   jobs:
        	            	+     my_job:
        	            	+-      max_concurrent_runs: 1
        	            	++      max_concurrent_runs: 10
        	            	+       tasks:
        	            	+         - task_key: main
        	            	 
        	Test:       	TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS=
        	Messages:   	bundle/config-remote-sync/split/top_level_field_both_blocks/output.txt vs /tmp/TestAcceptbundleconfig-remote-syncsplittop_level_field_both_4235616415/002/output.txt

latest (v1.28.0): same output as main (c639f9d)

TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS=true: branch ✅ | main (c639f9d) ❌ | latest (v1.28.0) ❌

main (c639f9d):

acceptance_test.go:1402: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1402
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1143
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:704
        	Error:      	Not equal: 
        	            	expected: "Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...\nCreated jobs.my_job\nFiles: 2 uploaded, 0 deleted\nResources: 1 created, 0 changed, 0 deleted, 0 unchanged\n\n=== Change the field remotely\n\n=== Sync replaces the target's value\n\n>>> [CLI] bundle config-remote-sync -t dev --save\nDetected changes in 1 resource(s):\n\nResource: resources.jobs.my_job\n  max_concurrent_runs: replace\n\n\n\n>>> diff.py databricks.yml.backup databricks.yml\n--- databricks.yml.backup\n+++ databricks.yml\n@@ -19,3 +19,3 @@\n       jobs:\n         my_job:\n-          max_concurrent_runs: 2\n+          max_concurrent_runs: 10\n\n>>> [CLI] bundle destroy --auto-approve -t dev\nThe following resources will be deleted:\n  delete resources.jobs.my_job\n\nAll files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev\n\nDestroy: 1 deleted\n"
        	            	actual  : "Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev/files...\nCreated jobs.my_job\nFiles: 2 uploaded, 0 deleted\nResources: 1 created, 0 changed, 0 deleted, 0 unchanged\n\n=== Change the field remotely\n\n=== Sync replaces the target's value\n\n>>> [CLI] bundle config-remote-sync -t dev --save\nDetected changes in 1 resource(s):\n\nResource: resources.jobs.my_job\n  max_concurrent_runs: replace\n\n\n\n>>> diff.py databricks.yml.backup databricks.yml\n--- databricks.yml.backup\n+++ databricks.yml\n@@ -8,5 +8,5 @@\n   jobs:\n     my_job:\n-      max_concurrent_runs: 1\n+      max_concurrent_runs: 10\n       tasks:\n         - task_key: main\n\n>>> [CLI] bundle destroy --auto-approve -t dev\nThe following resources will be deleted:\n  delete resources.jobs.my_job\n\nAll files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/dev\n\nDestroy: 1 deleted\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -20,7 +20,9 @@
        	            	 +++ databricks.yml
        	            	-@@ -19,3 +19,3 @@
        	            	-       jobs:
        	            	-         my_job:
        	            	--          max_concurrent_runs: 2
        	            	-+          max_concurrent_runs: 10
        	            	+@@ -8,5 +8,5 @@
        	            	+   jobs:
        	            	+     my_job:
        	            	+-      max_concurrent_runs: 1
        	            	++      max_concurrent_runs: 10
        	            	+       tasks:
        	            	+         - task_key: main
        	            	 
        	Test:       	TestAccept/bundle/config-remote-sync/split/top_level_field_both_blocks/DMS=true
        	Messages:   	bundle/config-remote-sync/split/top_level_field_both_blocks/output.txt vs /tmp/TestAcceptbundleconfig-remote-syncsplittop_level_field_both_2811999659/002/output.txt

latest (v1.28.0): same output as main (c639f9d)

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 7e0980b

Run: 45514274278

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 273 24 5:10
✅​ aws-windows-latest-4core-16gb 275 22 2:54
✅​ azure linux-2core-8gb 272 24 4:22
✅​ azure-windows-latest-4core-16gb 274 22 2:58
✅​ gcp linux-2core-8gb 273 24 5:06
✅​ gcp-windows-latest-4core-16gb 275 22 3:23
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:09 gcp linux-2core-8gb TestAccept
4:02 aws linux-2core-8gb TestAccept
3:24 azure linux-2core-8gb TestAccept
3:21 gcp-windows-latest-4core-16gb TestAccept
2:57 azure-windows-latest-4core-16gb TestAccept
2:47 aws-windows-latest-4core-16gb TestAccept

@andrewnester andrewnester 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.

Saving now fails when a cluster override clears a merge-inherited key, with the anchor inside or outside resources. Could it add the key as main does, and test both?

// A key the file writes as null is absent from the merged config, so the change
// arrives as an add; it replaces the existing key, as in RFC 6902.
if yamlKeyExists(content, fieldPathCandidate) {
opType = yamlpatch.OperationReplace

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.

Replacing an anchored null or cleared key drops the anchor its aliases need, so the saved file no longer loads. Could replaces skip anchored nodes, as addThroughNullAncestor does?

ilyakuz-db and others added 3 commits November 24, 2026 23:31
Co-authored-by: Isaac <no-reply@databricks.com>
…mplex variable references

Co-authored-by: Isaac <no-reply@databricks.com>
…ed safely

Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants