Skip to content

Avoid syncing cluster policy values into shared bundle config - #7170

Draft
ilyakuz-db wants to merge 9 commits into
mainfrom
ilyakuz-db/fix-policy-values-in-remote-sync
Draft

ilyakuz-db wants to merge 9 commits into
mainfrom
ilyakuz-db/fix-policy-values-in-remote-sync

Conversation

@ilyakuz-db

@ilyakuz-db ilyakuz-db commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Changes

config-remote-sync no longer copies cluster policy values into bundle YAML. After changes are extracted and selected, job and cluster specs whose remote policy_id is set are checked against that policy (read lazily, once per sync):

  • Fields under fixed rules, including * wildcards, are never synced. The backend rejects any other value for them, so the remote value always comes from the policy.
  • Fields under other rules are dropped only when they equal the policy defaultValue and apply_policy_default_values is set; any other value is a user edit and syncs.
  • Values authored in YAML are kept, and policy values never remove them.
  • If the policy no longer exists, policy-dependent fields are listed in skippedChanges with the new partial status, and other edits still sync.

Clusters without a policy are not filtered. The blanket custom_tags/cluster_log_conf skip is removed, so tags added in the UI now sync.

Why

Syncing a UI edit could copy one target's policy values into shared YAML, and deploying that YAML to a target with a different policy then failed validation.

Tests

Unit tests for rule matching, plus acceptance tests for cross-target deploys, missing policies and deploy-and-plan after sync.

This PR was written with assistance from Codex.

This pull request and its description were written by Isaac.

@github-actions github-actions Bot added the DABs DABs related issues label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Commit: a832169e2 | Workflow run

Regression test report

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

12 tests: regression=10 unreleased=0 coverage=2 failing=0

test branch main (814bdfe) latest (v1.22.1)
TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS=true ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS= ✅ ✅ ✅
TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS=true ✅ ✅ ✅
TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_cross_target2702789762/002/output.txt
        @@ -13,6 +13,9 @@
         
         Resource: resources.jobs.policy_sync
           description: replace
        +  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: add
        +  job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: add
        +  job_clusters[job_cluster_key='main'].new_cluster.workload_type: add
         
         
         
        @@ -26,56 +29,39 @@
         +      description: Edited in the UI
                job_clusters:
                  - job_cluster_key: main
        -
        -=== Deploy shared YAML with the prod policy
        ->>> [CLI] bundle deploy -t prod
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Created cluster_policies.policy
        -Created jobs.policy_sync
        -Files: 4 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        -=== Add a user tag beside the policy tag in the UI
        ->>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.policy_sync
        -  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['UserTag']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -39,4 +39,5 @@
        +@@ -39,4 +39,11 @@
                      custom_tags:
                        owner: bundle-author
        -+              UserTag: edited-in-ui
        ++              workspace: dev
        ++            spark_env_vars:
        ++              ENVIRONMENT: dev
        ++            workload_type:
        ++              clients:
        ++                jobs: true
        ++                notebooks: false
                tasks:
                  - task_key: main
         
        -=== Deploy the user tag with the prod policy
        +=== Deploy shared YAML with the prod policy
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Updated jobs.policy_sync
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Created cluster_policies.policy
        +Error: cannot create resources.jobs.policy_sync: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev") (400 INVALID_PARAMETER_VALUE)
         
        ->>> [CLI] jobs get [POLICY_SYNC_ID_2] -o json
        -{
        -  "UserTag": "edited-in-ui",
        -  "owner": "bundle-author",
        -  "workspace": "prod"
        -}
        +Endpoint: POST [DATABRICKS_URL]/api/2.2/jobs/create
        +HTTP Status: 400 Bad Request
        +API error_code: INVALID_PARAMETER_VALUE
        +API message: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev")
         
        +Files: 4 uploaded, 0 deleted
        +
         >>> [CLI] bundle destroy -t prod --auto-approve
         The following resources will be deleted:
           delete resources.cluster_policies.policy
        -  delete resources.jobs.policy_sync
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod
         
        -Destroy: 2 deleted
        +Destroy: 1 deleted
         
         >>> [CLI] bundle destroy -t dev --auto-approve
         The following resources will be deleted:
        @@ -85,3 +56,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/dev
         
         Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_cross_target1261037187/002/output.txt
        @@ -13,6 +13,9 @@
         
         Resource: resources.jobs.policy_sync
           description: replace
        +  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: add
        +  job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: add
        +  job_clusters[job_cluster_key='main'].new_cluster.workload_type: add
         
         
         
        @@ -26,56 +29,39 @@
         +      description: Edited in the UI
                job_clusters:
                  - job_cluster_key: main
        -
        -=== Deploy shared YAML with the prod policy
        ->>> [CLI] bundle deploy -t prod
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Created cluster_policies.policy
        -Created jobs.policy_sync
        -Files: 4 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        -
        -=== Add a user tag beside the policy tag in the UI
        ->>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        -
        -Resource: resources.jobs.policy_sync
        -  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['UserTag']: add
        -
        -
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -39,4 +39,5 @@
        +@@ -39,4 +39,11 @@
                      custom_tags:
                        owner: bundle-author
        -+              UserTag: edited-in-ui
        ++              workspace: dev
        ++            spark_env_vars:
        ++              ENVIRONMENT: dev
        ++            workload_type:
        ++              clients:
        ++                jobs: true
        ++                notebooks: false
                tasks:
                  - task_key: main
         
        -=== Deploy the user tag with the prod policy
        +=== Deploy shared YAML with the prod policy
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Updated jobs.policy_sync
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Created cluster_policies.policy
        +Error: cannot create resources.jobs.policy_sync: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev") (400 INVALID_PARAMETER_VALUE)
         
        ->>> [CLI] jobs get [POLICY_SYNC_ID_2] -o json
        -{
        -  "UserTag": "edited-in-ui",
        -  "owner": "bundle-author",
        -  "workspace": "prod"
        -}
        +Endpoint: POST [DATABRICKS_URL]/api/2.2/jobs/create
        +HTTP Status: 400 Bad Request
        +API error_code: INVALID_PARAMETER_VALUE
        +API message: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev")
         
        +Files: 4 uploaded, 0 deleted
        +
         >>> [CLI] bundle destroy -t prod --auto-approve
         The following resources will be deleted:
           delete resources.cluster_policies.policy
        -  delete resources.jobs.policy_sync
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod
         
        -Destroy: 2 deleted
        +Destroy: 1 deleted
         
         >>> [CLI] bundle destroy -t dev --auto-approve
         The following resources will be deleted:
        @@ -85,3 +56,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/dev
         
         Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_remote_addition/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_remote_addit487875574/002/output.txt
        @@ -10,7 +10,6 @@
         Detected changes in 1 resource(s):
         
         Resource: resources.jobs.test_job
        -  tasks[task_key='test'].new_cluster.custom_tags: add
           tasks[task_key='test'].new_cluster.spark_conf: add
         
         
        @@ -18,11 +17,9 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -24,4 +24,8 @@
        +@@ -24,4 +24,6 @@
                      node_type_id: [NODE_TYPE_ID]
                      num_workers: 1
        -+            custom_tags:
        -+              UserTag: edited-in-ui
         +            spark_conf:
         +              spark.sql.shuffle.partitions: "7"
                    spark_python_task:
        @@ -31,9 +26,8 @@
         === Synced config deploys and converges under the policy
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Updated jobs.test_job
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
         Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        @@ -50,12 +43,10 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -30,2 +30,14 @@
        +@@ -28,2 +28,12 @@
                    spark_python_task:
                      python_file: ./hello.py
         +        - new_cluster:
        -+            custom_tags:
        -+              UserTag: new-task
         +            node_type_id: [NODE_TYPE_ID]
         +            num_workers: 1
         +            policy_id: ${resources.cluster_policies.policy.id}

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_remote_addition/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_remote_addit3873778898/002/output.txt
        @@ -10,7 +10,6 @@
         Detected changes in 1 resource(s):
         
         Resource: resources.jobs.test_job
        -  tasks[task_key='test'].new_cluster.custom_tags: add
           tasks[task_key='test'].new_cluster.spark_conf: add
         
         
        @@ -18,11 +17,9 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -24,4 +24,8 @@
        +@@ -24,4 +24,6 @@
                      node_type_id: [NODE_TYPE_ID]
                      num_workers: 1
        -+            custom_tags:
        -+              UserTag: edited-in-ui
         +            spark_conf:
         +              spark.sql.shuffle.partitions: "7"
                    spark_python_task:
        @@ -31,9 +26,8 @@
         === Synced config deploys and converges under the policy
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Updated jobs.test_job
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Resources: 0 created, 0 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
         Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        @@ -50,12 +43,10 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -30,2 +30,14 @@
        +@@ -28,2 +28,12 @@
                    spark_python_task:
                      python_file: ./hello.py
         +        - new_cluster:
        -+            custom_tags:
        -+              UserTag: new-task
         +            node_type_id: [NODE_TYPE_ID]
         +            num_workers: 1
         +            policy_id: ${resources.cluster_policies.policy.id}
        
FAIL

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS=: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_replaces_array/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_replaces_arr3222379993/002/output.txt
        @@ -13,25 +13,32 @@
         }
         
         >>> [CLI] bundle config-remote-sync --save
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.jobs.test_job
        +  tasks[task_key='main'].new_cluster.init_scripts: replace
         
        +
        +
         >>> diff.py databricks.yml.backup databricks.yml
        +--- databricks.yml.backup
        ++++ databricks.yml
        +@@ -17,8 +17,6 @@
        +             num_workers: 1
        +             init_scripts:
        +-              - workspace:
        +-                  destination: /Workspace/init-a.sh
        +-              - workspace:
        +-                  destination: /Workspace/init-b.sh
        ++              - volumes:
        ++                  destination: /Volumes/catalog/schema/volume/policy.sh
        +           spark_python_task:
        +             python_file: ./hello.py
         
         === Authored scripts are kept without copying the policy script
         >>> [CLI] bundle validate -o json
        -true
        +false
         
        -=== Synced config deploys and converges under the policy
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Updated jobs.test_job
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.test_job
        @@ -41,3 +41,5 @@
         Destroy: 1 deleted
         
         >>> [CLI] cluster-policies delete [POLICY_ID]
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS=true: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/cluster_policy_replaces_array/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_replaces_arr3985009700/002/output.txt
        @@ -13,25 +13,32 @@
         }
         
         >>> [CLI] bundle config-remote-sync --save
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.jobs.test_job
        +  tasks[task_key='main'].new_cluster.init_scripts: replace
         
        +
        +
         >>> diff.py databricks.yml.backup databricks.yml
        +--- databricks.yml.backup
        ++++ databricks.yml
        +@@ -17,8 +17,6 @@
        +             num_workers: 1
        +             init_scripts:
        +-              - workspace:
        +-                  destination: /Workspace/init-a.sh
        +-              - workspace:
        +-                  destination: /Workspace/init-b.sh
        ++              - volumes:
        ++                  destination: /Volumes/catalog/schema/volume/policy.sh
        +           spark_python_task:
        +             python_file: ./hello.py
         
         === Authored scripts are kept without copying the policy script
         >>> [CLI] bundle validate -o json
        -true
        +false
         
        -=== Synced config deploys and converges under the policy
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Updated jobs.test_job
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.test_job
        @@ -41,3 +41,5 @@
         Destroy: 1 deleted
         
         >>> [CLI] cluster-policies delete [POLICY_ID]
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/external_cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncexternal_cluster_policy_cro784999241/002/output.txt
        @@ -13,6 +13,8 @@
         
         Resource: resources.jobs.policy_sync
           description: replace
        +  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: add
        +  job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: add
         
         
         
        @@ -26,101 +28,31 @@
         +      description: Edited in the UI
                job_clusters:
                  - job_cluster_key: main
        +@@ -23,4 +23,7 @@
        +             custom_tags:
        +               owner: bundle-author
        ++              workspace: dev
        ++            spark_env_vars:
        ++              ENVIRONMENT: dev
        +       tasks:
        +         - task_key: main
         
         === Deploy shared YAML with the prod policy
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Created jobs.policy_sync
        -Files: 5 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
        +Error: cannot create resources.jobs.policy_sync: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev") (400 INVALID_PARAMETER_VALUE)
         
        -=== A deleted policy skips policy-dependent fields but still syncs authored edits
        ->>> [CLI] cluster-policies delete [DEV_POLICY_ID]
        +Endpoint: POST [DATABRICKS_URL]/api/2.2/jobs/create
        +HTTP Status: 400 Bad Request
        +API error_code: INVALID_PARAMETER_VALUE
        +API message: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev")
         
        ->>> [CLI] bundle config-remote-sync -t dev --save -o json
        -{
        -  "status": "partial",
        -  "changes": {
        -    "resources.jobs.policy_sync": {
        -      "description": {
        -        "operation": "replace",
        -        "value": "Another UI edit"
        -      },
        -      "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['owner']": {
        -        "operation": "replace",
        -        "value": "edited-owner"
        -      }
        -    }
        -  },
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    }
        -  ]
        -}
        +Files: 5 uploaded, 0 deleted
         
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -13,5 +13,5 @@
        -     policy_sync:
        -       name: test-job-[UNIQUE_NAME]-${bundle.target}
        --      description: Edited in the UI
        -+      description: Another UI edit
        -       job_clusters:
        -         - job_cluster_key: main
        -@@ -22,5 +22,5 @@
        -             num_workers: 1
        -             custom_tags:
        --              owner: bundle-author
        -+              owner: edited-owner
        -       tasks:
        -         - task_key: main
        -
        -=== Only policy-dependent fields remain on the next sync
        ->>> [CLI] bundle config-remote-sync -t dev -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    }
        -  ]
        -}
        -
        -=== Text output reports the incomplete sync
        ->>> [CLI] bundle config-remote-sync -t dev
        -Sync is incomplete: some remote changes were skipped.
        -Skipped resources.jobs.policy_sync.job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: cluster policy [DEV_POLICY_ID] was not found.
        -Skipped resources.jobs.policy_sync.job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: cluster policy [DEV_POLICY_ID] was not found.
        -No changes could be synced.
        -
         >>> [CLI] bundle destroy -t prod --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.policy_sync
        -
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod
         
        -Destroy: 1 deleted
        +Destroy: 0 deleted
         
         >>> [CLI] bundle destroy -t dev --auto-approve
         The following resources will be deleted:
        @@ -130,4 +52,8 @@
         
         Destroy: 1 deleted
         
        +>>> [CLI] cluster-policies delete [DEV_POLICY_ID]
        +
         >>> [CLI] cluster-policies delete [PROD_POLICY_ID]
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=true: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/external_cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncexternal_cluster_policy_cro1162177894/002/output.txt
        @@ -13,6 +13,8 @@
         
         Resource: resources.jobs.policy_sync
           description: replace
        +  job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: add
        +  job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: add
         
         
         
        @@ -26,101 +28,31 @@
         +      description: Edited in the UI
                job_clusters:
                  - job_cluster_key: main
        +@@ -23,4 +23,7 @@
        +             custom_tags:
        +               owner: bundle-author
        ++              workspace: dev
        ++            spark_env_vars:
        ++              ENVIRONMENT: dev
        +       tasks:
        +         - task_key: main
         
         === Deploy shared YAML with the prod policy
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
        -Created jobs.policy_sync
        -Files: 5 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
        +Error: cannot create resources.jobs.policy_sync: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev") (400 INVALID_PARAMETER_VALUE)
         
        -=== A deleted policy skips policy-dependent fields but still syncs authored edits
        ->>> [CLI] cluster-policies delete [DEV_POLICY_ID]
        +Endpoint: POST [DATABRICKS_URL]/api/2.2/jobs/create
        +HTTP Status: 400 Bad Request
        +API error_code: INVALID_PARAMETER_VALUE
        +API message: Cluster validation error: Validation failed for custom_tags, workspace must be prod (is "dev")
         
        ->>> [CLI] bundle config-remote-sync -t dev --save -o json
        -{
        -  "status": "partial",
        -  "changes": {
        -    "resources.jobs.policy_sync": {
        -      "description": {
        -        "operation": "replace",
        -        "value": "Another UI edit"
        -      },
        -      "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['owner']": {
        -        "operation": "replace",
        -        "value": "edited-owner"
        -      }
        -    }
        -  },
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    }
        -  ]
        -}
        +Files: 5 uploaded, 0 deleted
         
        ->>> diff.py databricks.yml.backup databricks.yml
        ---- databricks.yml.backup
        -+++ databricks.yml
        -@@ -13,5 +13,5 @@
        -     policy_sync:
        -       name: test-job-[UNIQUE_NAME]-${bundle.target}
        --      description: Edited in the UI
        -+      description: Another UI edit
        -       job_clusters:
        -         - job_cluster_key: main
        -@@ -22,5 +22,5 @@
        -             num_workers: 1
        -             custom_tags:
        --              owner: bundle-author
        -+              owner: edited-owner
        -       tasks:
        -         - task_key: main
        -
        -=== Only policy-dependent fields remain on the next sync
        ->>> [CLI] bundle config-remote-sync -t dev -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.policy_sync",
        -      "path": "job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[DEV_POLICY_ID]"
        -    }
        -  ]
        -}
        -
        -=== Text output reports the incomplete sync
        ->>> [CLI] bundle config-remote-sync -t dev
        -Sync is incomplete: some remote changes were skipped.
        -Skipped resources.jobs.policy_sync.job_clusters[job_cluster_key='main'].new_cluster.custom_tags['workspace']: cluster policy [DEV_POLICY_ID] was not found.
        -Skipped resources.jobs.policy_sync.job_clusters[job_cluster_key='main'].new_cluster.spark_env_vars: cluster policy [DEV_POLICY_ID] was not found.
        -No changes could be synced.
        -
         >>> [CLI] bundle destroy -t prod --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.policy_sync
        -
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod
         
        -Destroy: 1 deleted
        +Destroy: 0 deleted
         
         >>> [CLI] bundle destroy -t dev --auto-approve
         The following resources will be deleted:
        @@ -130,4 +52,8 @@
         
         Destroy: 1 deleted
         
        +>>> [CLI] cluster-policies delete [DEV_POLICY_ID]
        +
         >>> [CLI] cluster-policies delete [PROD_POLICY_ID]
        +
        +Exit code: 1

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS=: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/missing_cluster_policy_structural_changes/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncmissing_cluster_policy_stru3926602930/002/output.txt
        @@ -31,111 +31,51 @@
         === A selected job's policy permission error fails sync without saving
         >>> [CLI] bundle config-remote-sync --select-ids jobs:[ARRAY_CHANGE_ID] --save -o json
         {
        -  "status": "failed",
        -  "error": "failed to extract changes: filtering policy values for resources.jobs.array_change.tasks[task_key='main'].new_cluster.init_scripts (no configuration was saved): reading cluster policy [POLICY_ID]: Fault injected by test.",
        -  "changes": {},
        -  "skippedChanges": null
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        ->>> print_requests.py //policies/clusters/get --get --oneline
        -{"method": "GET", "path": "/api/2.0/policies/clusters/get", "q": {"policy_id": "[POLICY_ID]"}}
        -
        -=== An indivisible array replacement leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[ARRAY_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.array_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== A log-storage switch leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[LOG_STORAGE_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.log_storage_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== Switching autoscale to a fixed worker count leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[WORKER_COUNT_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.worker_count_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== Unrelated edits still sync when other jobs have structural changes
        ->>> [CLI] bundle config-remote-sync --save -o json
        -{
        -  "status": "partial",
        +  "status": "success",
        +  "error": null,
           "changes": {
        -    "resources.jobs.unaffected": {
        +    "resources.jobs.array_change": {
               "description": {
                 "operation": "replace",
        -        "value": "Unrelated UI edit"
        +        "value": "Array changed in the UI"
        +      },
        +      "tasks[task_key='main'].new_cluster.init_scripts": {
        +        "operation": "replace",
        +        "value": [
        +          {
        +            "volumes": {
        +              "destination": "/Volumes/catalog/schema/volume/policy.sh"
        +            }
        +          }
        +        ]
               }
             }
           },
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.array_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.log_storage_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.new_task",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.worker_count_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        +  "skippedChanges": null
         }
         
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -67,5 +67,5 @@
        -     unaffected:
        -       name: test-unaffected-[UNIQUE_NAME]
        +@@ -9,5 +9,5 @@
        +     array_change:
        +       name: test-array_change-[UNIQUE_NAME]
         -      description: Before UI edit
        -+      description: Unrelated UI edit
        ++      description: Array changed in the UI
                tasks:
                  - task_key: main
        +@@ -18,8 +18,6 @@
        +             num_workers: 1
        +             init_scripts:
        +-              - workspace:
        +-                  destination: /Workspace/init-a.sh
        +-              - workspace:
        +-                  destination: /Workspace/init-b.sh
        ++              - volumes:
        ++                  destination: /Volumes/catalog/schema/volume/policy.sh
        +           spark_python_task:
        +             python_file: ./hello.py
        +databricks.yml.backup databricks.yml differ: char 232, line 11
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        @@ -148,3 +74,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
         
         Destroy: 5 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1119: LOG.cleanup-requests: 
    acceptance_test.go:1119: LOG.setup-requests:

latest (v1.22.1): same output as main (814bdfe)

TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS=true: branch ✅ | main (814bdfe) ❌ | latest (v1.22.1) ❌

main (814bdfe):

acceptance_test.go:1341: Diff:
        --- bundle/config-remote-sync/missing_cluster_policy_structural_changes/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncmissing_cluster_policy_stru902051524/002/output.txt
        @@ -31,111 +31,51 @@
         === A selected job's policy permission error fails sync without saving
         >>> [CLI] bundle config-remote-sync --select-ids jobs:[ARRAY_CHANGE_ID] --save -o json
         {
        -  "status": "failed",
        -  "error": "failed to extract changes: filtering policy values for resources.jobs.array_change.tasks[task_key='main'].new_cluster.init_scripts (no configuration was saved): reading cluster policy [POLICY_ID]: Fault injected by test.",
        -  "changes": {},
        -  "skippedChanges": null
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        ->>> print_requests.py //policies/clusters/get --get --oneline
        -{"method": "GET", "path": "/api/2.0/policies/clusters/get", "q": {"policy_id": "[POLICY_ID]"}}
        -
        -=== An indivisible array replacement leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[ARRAY_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.array_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== A log-storage switch leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[LOG_STORAGE_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.log_storage_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== Switching autoscale to a fixed worker count leaves the whole selected job unchanged
        ->>> [CLI] bundle config-remote-sync --select-ids jobs:[WORKER_COUNT_CHANGE_ID] --save -o json
        -{
        -  "status": "partial",
        -  "changes": {},
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.worker_count_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        -}
        -
        ->>> diff.py databricks.yml.backup databricks.yml
        -
        -=== Unrelated edits still sync when other jobs have structural changes
        ->>> [CLI] bundle config-remote-sync --save -o json
        -{
        -  "status": "partial",
        +  "status": "success",
        +  "error": null,
           "changes": {
        -    "resources.jobs.unaffected": {
        +    "resources.jobs.array_change": {
               "description": {
                 "operation": "replace",
        -        "value": "Unrelated UI edit"
        +        "value": "Array changed in the UI"
        +      },
        +      "tasks[task_key='main'].new_cluster.init_scripts": {
        +        "operation": "replace",
        +        "value": [
        +          {
        +            "volumes": {
        +              "destination": "/Volumes/catalog/schema/volume/policy.sh"
        +            }
        +          }
        +        ]
               }
             }
           },
        -  "skippedChanges": [
        -    {
        -      "resourceKey": "resources.jobs.array_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.log_storage_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.new_task",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    },
        -    {
        -      "resourceKey": "resources.jobs.worker_count_change",
        -      "reason": "cluster_policy_not_found",
        -      "policyId": "[POLICY_ID]"
        -    }
        -  ]
        +  "skippedChanges": null
         }
         
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -67,5 +67,5 @@
        -     unaffected:
        -       name: test-unaffected-[UNIQUE_NAME]
        +@@ -9,5 +9,5 @@
        +     array_change:
        +       name: test-array_change-[UNIQUE_NAME]
         -      description: Before UI edit
        -+      description: Unrelated UI edit
        ++      description: Array changed in the UI
                tasks:
                  - task_key: main
        +@@ -18,8 +18,6 @@
        +             num_workers: 1
        +             init_scripts:
        +-              - workspace:
        +-                  destination: /Workspace/init-a.sh
        +-              - workspace:
        +-                  destination: /Workspace/init-b.sh
        ++              - volumes:
        ++                  destination: /Volumes/catalog/schema/volume/policy.sh
        +           spark_python_task:
        +             python_file: ./hello.py
        +databricks.yml.backup databricks.yml differ: char 232, line 11
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        @@ -148,3 +74,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
         
         Destroy: 5 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1119: LOG.cleanup-requests: 
    acceptance_test.go:1119: LOG.setup-requests:

latest (v1.22.1): same output as main (814bdfe)

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: a832169

Run: 40552930447

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 293 17 6:32
✅​ aws-windows-latest-4core-16gb 283 19 4:57
✅​ azure linux-2core-8gb 292 17 5:38
✅​ azure-windows-latest-4core-16gb 282 19 4:29
✅​ gcp linux-2core-8gb 293 17 6:01
✅​ gcp-windows-latest-4core-16gb 283 19 4:13
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:52 aws-windows-latest-4core-16gb TestAccept
4:25 azure-windows-latest-4core-16gb TestAccept
4:05 gcp-windows-latest-4core-16gb TestAccept
3:53 aws linux-2core-8gb TestAccept
3:46 gcp linux-2core-8gb TestAccept
2:52 azure linux-2core-8gb TestAccept

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants