Commit 9767900
direct: Fix permissions state path to match input config schema (#4703)
## Changes
- Add `EmbeddedSlice` field name convention to struct walkers in
`libs/structs/` — when a struct field is named `EmbeddedSlice`, walkers
treat it as transparent (no path segment added), so its elements appear
directly at the parent path
- Apply this to `PermissionsState`: rename `Permissions` field to
`EmbeddedSlice`, making state paths like
`resources.jobs.foo.permissions[0]` match input config paths (previously
`resources.jobs.foo.permissions.permissions[0]`)
- Change state file version to 2 and introduce automatic migration from
0 & 1 to 2.
## Why
The direct deployment engine's permissions state used a wrapper struct
that added an extra `permissions` segment to paths. This caused a
mismatch with input config paths, preventing dependency tracking between
permissions and their parent resources. With this fix, state and config
paths are consistent.
## Tests
- New acceptance & invariant tests for references from/to permissions.
- New invariant test that checks that bundle deployed with previous
fixed version (0.293.0) does not have drift when CLI is upgraded to
latest.
---------
Co-authored-by: Claude Opus 4.6 <[email protected]>1 parent c745805 commit 9767900
File tree
123 files changed
+1599
-610
lines changed- acceptance
- bundle
- apps/job_permissions
- deployment/bind/dashboard/recreation
- invariant
- configs
- continue_293
- migrate
- no_drift
- migrate
- basic
- dashboards
- default-python
- grants
- permissions
- runas
- refschema
- resource_deps/permission_ref
- resources
- jobs
- big_id
- update
- model_serving_endpoints/basic
- permissions
- apps
- current_can_manage
- other_can_manage
- clusters/current_can_manage
- dashboards/create
- database_instances/current_can_manage
- experiments/current_can_manage
- jobs
- added_remotely
- current_can_manage_run
- current_can_manage
- current_is_owner
- delete_one
- cloud
- local
- deleted_remotely
- other_can_manage
- other_is_owner
- update
- viewers
- models/current_can_manage
- pipelines
- current_can_manage
- current_is_owner
- other_can_manage
- other_is_owner
- update
- postgres_projects/current_can_manage
- sql_warehouses/current_can_manage
- target_permissions
- run_as/pipelines
- regular_user
- service_principal
- state
- future_version
- permission_level_migration
- templates/default-python
- classic
- integration_classic
- serverless
- user_agent/simple
- bundle/direct
- dresources
- dstate
- cmd/bundle/debug
- libs/structs
- structaccess
- structdiff
- structwalk
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
123 files changed
+1599
-610
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 1 | | |
8 | 2 | | |
9 | 3 | | |
10 | 4 | | |
11 | | - | |
| 5 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 27 additions & 0 deletions
| 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 | + | |
Lines changed: 21 additions & 0 deletions
| 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 | + | |
0 commit comments