Commit 5fa9c5f
authored
filer: detect notebook already-exists across both error formats (#5106)
## Summary
The Workspace files import-file API used to return `Path (<path>)
already exists.` for notebook conflicts. The format has changed on some
workspaces to `RESOURCE_ALREADY_EXISTS: <path> already exists. ...`. The
original regex no longer matched the new format, so `fs.ErrExist` was
not returned — breaking `TestImportDirDoesNotOverwrite` and 8
`TestFilerWorkspaceNotebook` subtests on every cloud.
The new format might not have been rolled out to all workspaces yet (see
[databricks-sdk-go#1639](databricks/databricks-sdk-go#1639)),
and the JSON `error_code` is empty in both. Both messages end with
`already exists.`, so we anchor on that substring and return the request
`absPath` in the error rather than parsing the message.
The integration test assertion is updated to expect the path with
extension (`tc.name`) instead of without (`tc.nameWithoutExt`), since
`absPath` is the request path.
## Test plan
- [x] `go test ./libs/filer/...` passes locally
- [x] `TestFilerWorkspaceNotebook` passes on aws-prod-ucws (new format)
- [ ] Verify a workspace still emitting the old format also passes
(best-effort — single substring match handles both)
This pull request was AI-assisted by Isaac.1 parent 5d9e6e4 commit 5fa9c5f
2 files changed
Lines changed: 8 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
222 | 218 | | |
223 | 219 | | |
224 | 220 | | |
| |||
0 commit comments