Commit 2156629
authored
testserver: 404 on permissions GET when V2 parent is gone (#5186)
## Changes
`testserver.GetPermissions` now returns 404 when the parent object
backing
a permissions request is gone, defaulting to V2 permissions API
behavior.
The check is wired up for `vector-search-endpoints` only; other resource
types fall through to the existing "empty ACL on miss" branch.
The acceptance test
`bundle/resources/vector_search_endpoints/drift/recreated_same_name`
now asserts `create` (instead of `update`) for the permissions resource
when the parent endpoint is recreated remotely with a different UUID,
and
the recorded `output.txt` is regenerated to match.
## Why
The integration variant of the test was failing with:
```
recreate vector_search_endpoints.my_endpoint
-update vector_search_endpoints.my_endpoint.permissions
+create vector_search_endpoints.my_endpoint.permissions
-Plan: 1 to add, 1 to change, 1 to delete, 0 unchanged
+Plan: 2 to add, 0 to change, 1 to delete, 0 unchanged
```
I confirmed the cloud behavior end-to-end against dogfood-aws:
| Resource | After delete: GET permissions returns |
|----------|---------------------------------------|
| Jobs | 200 with full ACL data (incl. IS_OWNER) |
| Pipelines | 200 with full ACL data |
| Vector search endpoints | 404 "not found" |
| Experiments | 404 "does not exist" |
There is a known inconsistency in how the cloud permissions API handles
deletion across resource types: V2 resources (vector search,
experiments)
cascade-delete ACLs immediately and return 404 on subsequent GETs, while
V1 resources (jobs, pipelines) retain ACL data after the parent is
deleted
via async/soft delete. The testserver previously matched neither
behavior — it returned an empty ACL for any unknown object id. The new
default is V2; V1 resources keep their existing fall-through.
When more V2 resources gain coverage that exercises this path, they
should add a case to `permissionsParentExists`.
## Tests
- `go test ./acceptance -run
'TestAccept/bundle/resources/vector_search_endpoints'` — green.
- `go test ./acceptance -run 'TestAccept/bundle/resources/permissions'`
— green.
- `go test ./libs/testserver/...` — green.
- `./task lint` and `./task fmt` — clean.
_This PR was written by Claude Code._1 parent 796a01d commit 2156629
3 files changed
Lines changed: 33 additions & 3 deletions
File tree
- acceptance/bundle/resources/vector_search_endpoints/drift/recreated_same_name
- libs/testserver
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
123 | 136 | | |
124 | 137 | | |
125 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
0 commit comments