Skip to content

Ignore the cluster policy creator's CAN_USE in config-remote-sync - #7717

Merged
denik merged 3 commits into
mainfrom
ccpolicy-creator-can-use
Nov 18, 2026
Merged

denik merged 3 commits into
mainfrom
ccpolicy-creator-can-use

Conversation

@denik

@denik denik commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Changes

bundle config-remote-sync no longer imports the current user's CAN_USE on a cluster policy that declares no permissions. The backend grants the creator CAN_USE on a new policy, so this entry is there without any remote edit. It is dropped like the deployer's own IS_OWNER/CAN_MANAGE on other resources. withoutCurrentUserManage is renamed to withoutCurrentUserDefaults and now takes the resource type.

The testserver now gives the creator CAN_USE when a cluster policy is created, matching the cloud, so local runs cover this case.

Why

Since #7536, config-remote-sync reads the ACL of deployed resources that declare no permissions. On cloud, the three config-remote-sync cluster policy tests began reporting Resource: resources.cluster_policies.policy permissions: add and writing this into databricks.yml:

+      permissions:
+        - level: CAN_USE
+          service_principal_name: [USERNAME]

After that, the next deploy created cluster_policies.policy.permissions. They fail on AWS, Azure and GCP, for both DMS variants. The testserver gave a new policy no ACL, which is why #7536 passed locally.

Decisions:

  • The current user's CAN_USE on a cluster policy is always dropped, also when other principals are imported with it. Only workspace admins create or edit cluster policies, and admins can use every policy regardless of its ACL. So the grant isn't needed in the config, and writing it would apply one deployer's grant to other targets and deployers. As a result, a deploy after such a sync removes the deployer's direct CAN_USE entry, and they keep access as an admin.
  • Only cluster policies are affected. Other resource types keep the existing filter as is.
  • The current user is taken to be the creator, so the policy's creator_user_name is not read.

Tests

  • Unit tests for the cluster policy filter, alone and next to other grants. The existing owner-filter test still passes.
  • New acceptance test config-remote-sync/cluster_policy_permissions: the first sync reports no changes. Then a group is granted CAN_USE remotely, and the sync imports only the group. The deploy that follows applies that ACL, and the plan is a no-op.
  • Before the fix, the testserver change makes the three tests fail locally the same way they fail on cloud. With the fix, the whole local acceptance suite passes.
  • Ran the three tests and the new one on AWS with the fix, both DMS variants: all pass. The commit message asks CI to run them on every cloud.

Dashboard

Failing since the 2026-11-17 nightly (the dashboard has not ingested that run yet; I will add the error links once it does):

+Created cluster_policies.policy.permissions
-Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
+Resources: 1 created, 1 changed, 0 deleted, 1 unchanged

This pull request and its description were written by Isaac.

The backend grants the creator CAN_USE on a new cluster policy, so
config-remote-sync imported it as a permissions block for policies that
declare none. Drop it like the deployer's IS_OWNER/CAN_MANAGE, and seed the
grant in the testserver so local runs cover it.

cloud: TestAccept/bundle/config-remote-sync/cluster_policy_cross_target TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields

Co-authored-by: Isaac <no-reply@databricks.com>
@denik denik added the ai-auto Deprecated: use factory-generated instead. label Nov 17, 2026
@github-actions github-actions Bot added the DABs DABs related issues label Nov 17, 2026
FixPermissions does not add a cluster policy grant back, so dropping the
creator's CAN_USE next to other imported grants would revoke it on the next
deploy. Drop it only when it is the whole ACL, credit the creator by token in
the testserver, and cover sync and deploy with a remote group grant.

cloud: TestAccept/bundle/config-remote-sync/cluster_policy_cross_target TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields TestAccept/bundle/config-remote-sync/cluster_policy_permissions

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 1d52db99f | Workflow run

Regression test report

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

8 tests: regression=8 unreleased=0 coverage=0 failing=0
test branch main (c15c8c6) latest (v1.26.0)
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_permissions/DMS= ✅ ❌ ❌
TestAccept/bundle/config-remote-sync/cluster_policy_permissions/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/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 (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_cross_target2982351802/002/output.txt
        @@ -11,8 +11,11 @@
         === Sync the UI edit into shared YAML
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.policy_sync
           description: replace
         
        @@ -21,7 +23,13 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -29,5 +29,5 @@
        +@@ -26,8 +26,11 @@
        +           type: fixed
        +           value: false
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
        +   jobs:
              policy_sync:
                name: test-job-[UNIQUE_NAME]-${bundle.target}
         -      description: Before UI edit
        @@ -34,9 +42,10 @@
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
         Created cluster_policies.policy
        +Created cluster_policies.policy.permissions
         Created jobs.policy_sync
         Files: 4 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        +Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
         
         === Add a user tag beside the policy tag in the UI
         
        @@ -51,7 +58,7 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -39,4 +39,5 @@
        +@@ -42,4 +42,5 @@
                      custom_tags:
                        owner: bundle-author
         +              UserTag: edited-in-ui
        @@ -64,7 +71,7 @@
         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
        +Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] jobs get [POLICY_SYNC_ID_2] -o json
         {
TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_cross_target/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_cross_target296620773/002/output.txt
        @@ -11,8 +11,11 @@
         === Sync the UI edit into shared YAML
         
         >>> [CLI] bundle config-remote-sync -t dev --save
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.policy_sync
           description: replace
         
        @@ -21,7 +23,13 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -29,5 +29,5 @@
        +@@ -26,8 +26,11 @@
        +           type: fixed
        +           value: false
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
        +   jobs:
              policy_sync:
                name: test-job-[UNIQUE_NAME]-${bundle.target}
         -      description: Before UI edit
        @@ -34,9 +42,10 @@
         >>> [CLI] bundle deploy -t prod
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/prod/files...
         Created cluster_policies.policy
        +Created cluster_policies.policy.permissions
         Created jobs.policy_sync
         Files: 4 uploaded, 0 deleted
        -Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        +Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
         
         === Add a user tag beside the policy tag in the UI
         
        @@ -51,7 +58,7 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -39,4 +39,5 @@
        +@@ -42,4 +42,5 @@
                      custom_tags:
                        owner: bundle-author
         +              UserTag: edited-in-ui
        @@ -64,7 +71,7 @@
         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
        +Resources: 0 created, 1 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] jobs get [POLICY_SYNC_ID_2] -o json
         {
TestAccept/bundle/config-remote-sync/cluster_policy_permissions/DMS=: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ❌

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_permissions/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_permissions3607638308/002/output.txt
        @@ -8,9 +8,13 @@
         === The creator's CAN_USE is not a remote change
         
         >>> [CLI] bundle config-remote-sync
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
         
        +
        +
         === Grant a group CAN_USE in the UI
         
         >>> [CLI] bundle config-remote-sync --save
        @@ -22,7 +24,7 @@
         
         
         >>> [CLI] bundle validate -o json
        -[{"principal":"users","level":"CAN_USE"}]
        +[{"principal":"[USERNAME]","level":"CAN_USE"},{"principal":"users","level":"CAN_USE"}]
         
         === Deploy applies the synced ACL
         
        @@ -33,7 +35,7 @@
         Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
         
         >>> [CLI] permissions get cluster-policies [POLICY_ID]
        -[{"principal":"users","level":"CAN_USE"}]
        +[{"principal":"[USERNAME]","level":"CAN_USE"},{"principal":"users","level":"CAN_USE"}]
         
         >>> [CLI] bundle plan
         Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_permissions/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_permissions2535621609/002/output.txt
        @@ -14,30 +14,12 @@
         === Grant a group CAN_USE in the UI
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 1 resource(s):
        +No changes detected.
         
        -Resource: resources.cluster_policies.policy
        -  permissions: add
         
        -
        -
         >>> [CLI] bundle validate -o json
        -[{"principal":"users","level":"CAN_USE"}]
        +jq: error (at <stdin>:36): Cannot iterate over null (null)
         
        -=== Deploy applies the synced ACL
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Created cluster_policies.policy.permissions
        -Files: 1 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] permissions get cluster-policies [POLICY_ID]
        -[{"principal":"users","level":"CAN_USE"}]
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.cluster_policies.policy
        @@ -45,3 +23,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
         
         Destroy: 1 deleted
        +
        +Exit code: 5
TestAccept/bundle/config-remote-sync/cluster_policy_permissions/DMS=true: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ❌

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_permissions/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_permissions406288753/002/output.txt
        @@ -8,9 +8,13 @@
         === The creator's CAN_USE is not a remote change
         
         >>> [CLI] bundle config-remote-sync
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
         
        +
        +
         === Grant a group CAN_USE in the UI
         
         >>> [CLI] bundle config-remote-sync --save
        @@ -22,7 +24,7 @@
         
         
         >>> [CLI] bundle validate -o json
        -[{"principal":"users","level":"CAN_USE"}]
        +[{"principal":"[USERNAME]","level":"CAN_USE"},{"principal":"users","level":"CAN_USE"}]
         
         === Deploy applies the synced ACL
         
        @@ -33,7 +35,7 @@
         Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
         
         >>> [CLI] permissions get cluster-policies [POLICY_ID]
        -[{"principal":"users","level":"CAN_USE"}]
        +[{"principal":"[USERNAME]","level":"CAN_USE"},{"principal":"users","level":"CAN_USE"}]
         
         >>> [CLI] bundle plan
         Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged

latest (v1.26.0):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_permissions/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_permissions1522960306/002/output.txt
        @@ -14,30 +14,12 @@
         === Grant a group CAN_USE in the UI
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 1 resource(s):
        +No changes detected.
         
        -Resource: resources.cluster_policies.policy
        -  permissions: add
         
        -
        -
         >>> [CLI] bundle validate -o json
        -[{"principal":"users","level":"CAN_USE"}]
        +jq: error (at <stdin>:36): Cannot iterate over null (null)
         
        -=== Deploy applies the synced ACL
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Created cluster_policies.policy.permissions
        -Files: 1 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] permissions get cluster-policies [POLICY_ID]
        -[{"principal":"users","level":"CAN_USE"}]
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.cluster_policies.policy
        @@ -45,3 +23,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
         
         Destroy: 1 deleted
        +
        +Exit code: 5
        
FAIL
TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_remote_addition/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_remote_addit2247919419/002/output.txt
        @@ -7,8 +7,11 @@
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.test_job
           tasks[task_key='test'].new_cluster.custom_tags: add
           tasks[task_key='test'].new_cluster.spark_conf: add
        @@ -18,7 +20,15 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -24,4 +24,8 @@
        +@@ -14,4 +14,7 @@
        +           type: fixed
        +           value: from-policy
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
        +   jobs:
        +     test_job:
        +@@ -24,4 +27,8 @@
                      node_type_id: [NODE_TYPE_ID]
                      num_workers: 1
         +            custom_tags:
        @@ -32,12 +42,13 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        +Created cluster_policies.policy.permissions
         Updated jobs.test_job
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Resources: 1 created, 1 changed, 0 deleted, 1 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         === Add a task with user and policy cluster fields in the UI
         
        @@ -52,7 +59,7 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -30,2 +30,14 @@
        +@@ -33,2 +33,14 @@
                    spark_python_task:
                      python_file: ./hello.py
         +        - new_cluster:
        @@ -74,10 +81,10 @@
         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, 1 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/cluster_policy_remote_addition/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-synccluster_policy_remote_addit3413477038/002/output.txt
        @@ -7,8 +7,11 @@
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle config-remote-sync --save
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.test_job
           tasks[task_key='test'].new_cluster.custom_tags: add
           tasks[task_key='test'].new_cluster.spark_conf: add
        @@ -18,7 +20,15 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -24,4 +24,8 @@
        +@@ -14,4 +14,7 @@
        +           type: fixed
        +           value: from-policy
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
        +   jobs:
        +     test_job:
        +@@ -24,4 +27,8 @@
                      node_type_id: [NODE_TYPE_ID]
                      num_workers: 1
         +            custom_tags:
        @@ -32,12 +42,13 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        +Created cluster_policies.policy.permissions
         Updated jobs.test_job
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
        +Resources: 1 created, 1 changed, 0 deleted, 1 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         === Add a task with user and policy cluster fields in the UI
         
        @@ -52,7 +59,7 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -30,2 +30,14 @@
        +@@ -33,2 +33,14 @@
                    spark_python_task:
                      python_file: ./hello.py
         +        - new_cluster:
        @@ -74,10 +81,10 @@
         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, 1 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        
FAIL
TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS=: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/policy_injected_cluster_fields/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncpolicy_injected_cluster_fie316673228/002/output.txt
        @@ -7,16 +7,23 @@
         === Policy values alone do not need to be synced
         
         >>> [CLI] bundle config-remote-sync
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
         
        +
        +
         === Simulate a cluster policy injecting custom_tags and cluster_log_conf
         These fields exist only remotely (the user never set them in config).
         A legitimate edit (max_concurrent_runs) is made too, to show real edits still sync.
         
         === Detect and save all changes
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.job1
           max_concurrent_runs: replace
         
        @@ -27,7 +26,12 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -25,5 +25,5 @@
        +@@ -23,7 +23,10 @@
        +           type: fixed
        +           value: dbfs:/cluster-logs/dev
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
            jobs:
              job1:
         -      max_concurrent_runs: 1
        @@ -39,11 +43,12 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Created cluster_policies.policy.permissions
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 2 unchanged
        +Resources: 1 created, 0 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS=true: branch ✅ | main (c15c8c6) ❌ | latest (v1.26.0) ✅

main (c15c8c6):

acceptance_test.go:1380: Diff:
        --- bundle/config-remote-sync/policy_injected_cluster_fields/output.txt
        +++ /tmp/TestAcceptbundleconfig-remote-syncpolicy_injected_cluster_fie380921862/002/output.txt
        @@ -7,16 +7,23 @@
         === Policy values alone do not need to be synced
         
         >>> [CLI] bundle config-remote-sync
        -No changes detected.
        +Detected changes in 1 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
         
        +
        +
         === Simulate a cluster policy injecting custom_tags and cluster_log_conf
         These fields exist only remotely (the user never set them in config).
         A legitimate edit (max_concurrent_runs) is made too, to show real edits still sync.
         
         === Detect and save all changes
        -Detected changes in 1 resource(s):
        +Detected changes in 2 resource(s):
         
        +Resource: resources.cluster_policies.policy
        +  permissions: add
        +
         Resource: resources.jobs.job1
           max_concurrent_runs: replace
         
        @@ -27,7 +26,12 @@
         >>> diff.py databricks.yml.backup databricks.yml
         --- databricks.yml.backup
         +++ databricks.yml
        -@@ -25,5 +25,5 @@
        +@@ -23,7 +23,10 @@
        +           type: fixed
        +           value: dbfs:/cluster-logs/dev
        ++      permissions:
        ++        - level: CAN_USE
        ++          user_name: [USERNAME]
            jobs:
              job1:
         -      max_concurrent_runs: 1
        @@ -39,11 +43,12 @@
         
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        +Created cluster_policies.policy.permissions
         Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 2 unchanged
        +Resources: 1 created, 0 changed, 0 deleted, 2 unchanged
         
         >>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        +Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
         
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:

@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 1d52db9

Run: 44243117067

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 282 15 4:06
💚​ aws-windows-latest-4core-16gb 1 272 17 3:17
💚​ azure linux-2core-8gb 1 281 15 4:20
💚​ azure-windows-latest-4core-16gb 1 271 17 3:18
💚​ gcp linux-2core-8gb 1 282 15 4:27
💚​ gcp-windows-latest-4core-16gb 1 272 17 4:09
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
4:04 gcp-windows-latest-4core-16gb TestAccept
3:14 azure-windows-latest-4core-16gb TestAccept
3:12 aws-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 17, 2026 12:01
@denik
denik requested review from a team as code owners November 17, 2026 12:01
@denik
denik requested review from Sankalp-Mittal, andrewnester, rugpanov and shreyas-goenka and removed request for rugpanov November 17, 2026 12:01

@Sankalp-Mittal Sankalp-Mittal 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.

[AI Generated] Review by review-factory (Claude Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No blocking or major issues found.

Comment thread bundle/configsync/permissions.go Resolved
Comment thread bundle/configsync/permissions.go Resolved

@ilyakuz-db ilyakuz-db 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.

LGTM, please TAL at other comments as well

Only admins create cluster policies and admins can use every policy, so the
creator's CAN_USE is not needed in the config, and writing it there would
apply one deployer's grant to other targets and deployers.

cloud: TestAccept/bundle/config-remote-sync/cluster_policy_cross_target TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields TestAccept/bundle/config-remote-sync/cluster_policy_permissions

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik added this pull request to the merge queue Nov 18, 2026

@Sankalp-Mittal Sankalp-Mittal 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.

[AI Generated] Follow-up review by review-factory (Claude Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No new issues found.

Merged via the queue into main with commit e09a58e Nov 18, 2026
27 checks passed
@denik
denik deleted the ccpolicy-creator-can-use branch November 18, 2026 05:46
petrapostelnicu-db added a commit that referenced this pull request Nov 18, 2026
Resolve the conflict with #7717 in permissions.go: readUnmanagedPermissions
keeps returning the raw ACL (jobOwners needs the IS_OWNER entry), and
addPermissionsChanges now filters it with withoutCurrentUserDefaults.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik denik added factory-generated and removed ai-auto Deprecated: use factory-generated instead. labels Nov 20, 2026
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.

5 participants