Repository navigation
Commit e09a58e
Ignore the cluster policy creator's CAN_USE in config-remote-sync (#7717)
## 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):
-
[TestAccept/bundle/config-remote-sync/cluster_policy_cross_target](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true?main=1&pr=1&end=2026-11-18T00:00:00Z&last=2d)
-
[TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true?main=1&pr=1&end=2026-11-18T00:00:00Z&last=2d)
-
[TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/config-remote-sync/policy_injected_cluster_fields/DMS=true?main=1&pr=1&end=2026-11-18T00:00:00Z&last=2d)
```
+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.
---------
Co-authored-by: Isaac <no-reply@databricks.com>1 parent c15c8c6 commit e09a58e
8 files changed
Lines changed: 155 additions & 9 deletions
File tree
- acceptance/bundle/config-remote-sync/cluster_policy_permissions
- bundle/configsync
- libs/testserver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
388 | 406 | | |
389 | 407 | | |
390 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
241 | 243 | | |
242 | | - | |
243 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
247 | 258 | | |
248 | 259 | | |
249 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
53 | 72 | | |
54 | 73 | | |
55 | 74 | | |
| |||
0 commit comments