Skip to content

testserver: reject empty catalog and MLflow model names - #6157

Merged
radakam merged 6 commits into
mainfrom
testserver-reject-empty-resource-names
Aug 5, 2026
Merged

radakam merged 6 commits into
mainfrom
testserver-reject-empty-resource-names

Conversation

@radakam

@radakam radakam commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Changes

The catalog and MLflow registered-model fakes now reject an empty name with the 400 the real backends return, message verbatim from a real workspace.

Why

The fakes stored a resource created with an empty name under that empty key, so the CLI could never read it back: the deploy looked successful and the next plan saw the resource as missing.

Found by fuzz testing.

Tests

Unit tests per endpoint, plus acceptance tests where bundle deploy with an empty catalog / model name now fails with the backend error. They run against a real workspace too, so the goldens keep the verbatim UC and MLflow messages honest.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 2b277c0

Run: 31003099472

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🔄​ aws linux 1 4 4 295 1095 14:04
🔄​ aws windows 1 4 4 297 1093 13:28
🔄​ azure linux 1 4 4 294 1095 16:50
💚​ azure windows 4 4 297 1093 12:14
💚​ gcp linux 1 5 296 1095 11:22
💚​ gcp windows 1 5 298 1093 12:58
11 interesting tests: 4 RECOVERED, 4 SKIP, 3 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestSyncFullFileSync 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestSyncIncrementalFileSync ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestSyncIncrementalSyncPythonNotebookDelete ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 29 slowest tests (at least 2 minutes):
duration env testname
9:03 gcp windows TestAccept
8:14 aws windows TestAccept
6:35 azure windows TestAccept
5:41 gcp windows TestFilerWorkspaceFilesExtensionsStat
4:36 azure windows TestFilerWorkspaceFilesExtensionsReadDir
4:23 azure windows TestImportDirDoesNotOverwrite
4:16 azure linux TestFilerReadWrite/workspace_files
4:06 aws windows TestFilerRecursiveDelete/workspace_files_extensions
3:39 aws windows TestFilerReadWrite/workspace_files
3:39 azure windows TestExportDir
3:10 azure linux TestFilerWorkspaceFilesExtensionsRead
3:06 gcp linux TestAccept
3:00 azure linux TestFilerRecursiveDelete/workspace_files_extensions
2:57 aws linux TestAccept
2:56 gcp windows TestAccept/bundle/resources/models/empty-name/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 azure linux TestAccept
2:50 gcp windows TestFilerWorkspaceFilesExtensionsReadDir
2:48 gcp windows TestFilerWorkspaceFilesExtensionsRead
2:43 gcp windows TestFilerRecursiveDelete/workspace_files
2:39 azure windows TestFilerWorkspaceFilesExtensionsStat
2:27 azure linux TestFilerRecursiveDelete/workspace_files
2:19 gcp linux TestFilerWorkspaceFilesExtensionsReadDir
2:17 aws linux TestFilerWorkspaceFilesExtensionsRead
2:17 gcp linux TestFilerRecursiveDelete/workspace_files
2:12 azure windows TestFilerWorkspaceNotebook/pyNb.py
2:09 gcp windows TestAccept/bundle/resources/models/empty-name/DATABRICKS_BUNDLE_ENGINE=direct
2:07 gcp windows TestFilerReadWrite/workspace_files_extensions
2:01 gcp linux TestSyncIncrementalFileSync
2:01 azure windows TestFilerRecursiveDelete/workspace_files_extensions

@radakam radakam changed the title testserver: reject empty catalog and model names testserver: reject empty catalog and MLflow model names Aug 4, 2026
@radakam
radakam marked this pull request as ready for review August 5, 2026 10:41
radakam added 6 commits August 5, 2026 11:44
The fake server stored a catalog or registered model created with an empty name,
which the CLI could then never find again, so a deploy appeared to succeed and
the next plan saw the resource as missing.

Both real backends reject it. Return the same 400 they do, verified against a
real workspace.
Add acceptance tests showing that bundle deploy with an empty catalog or
MLflow model name now fails with the backend error instead of silently
succeeding, and use http.StatusBadRequest in catalogs.go for consistency
with the rest of the file.
…echo

The positive tests asserted the name echoed back in the create response, which
holds even if create stores the resource under a key nothing can look up - the
bug this change exists to prevent. Read the resource back instead, through the
same MapGet the catalogs GET route uses and through ModelRegistryGetModel, so a
mis-keyed store fails the test.

The rejection tests now also assert the collection stays empty, pinning the
symptom directly: a stored-but-unreadable entry is what made a deploy look
successful and the next plan see the resource as missing.
These goldens assert the UC and MLflow rejection messages verbatim, so their
value depends on those strings still matching the real backends. With
Cloud = false nothing ever checked that, and the fake could drift out of sync
silently. Enable cloud runs so the integration suite catches it, matching the
catalogs/with-schemas sibling.

The local goldens are unchanged; only out.test.toml moves.
The cloud runs deployed to a fixed ~/.bundle/<bundle-name>/default, so matrix
legs sharing a workspace raced on one root path, and the uploaded files carried
no run prefix for cleanBundles to find. Move the bundle name into a template
with $UNIQUE_NAME the way the sibling cloud tests do; the deploy fails, but only
after the files are uploaded, so there is something to sweep.

The models deploy reaches the create call on terraform too and surfaces the same
backend message wrapped in terraform's own output, so run both engines and split
the deploy output into per-engine goldens rather than dropping terraform.

Catalogs stay direct-only, but for the actual reason: terraform rejects catalog
resources before any API call, rather than merely formatting the error
differently.

Assert that the rejected resource was not stored before casting the error body.
The cast aborts the test when the rejection is missing, which is exactly the case
where the mis-keyed entry is worth reporting.
Trim every comment this branch adds to at most two lines, keeping the reason and
dropping the restatement.

Two are more than trimming. The catalog engine comment claimed catalogs are "only
supported by the direct engine, which rejects them before any API call on
terraform" - the relative clause pointed at the wrong engine. And the trailing
block in the models test.toml explained an EnvMatrix that file does not set, so it
moves to the script, next to the per-engine redirect it actually justifies.
@radakam
radakam force-pushed the testserver-reject-empty-resource-names branch from bfc8c80 to 2b277c0 Compare August 5, 2026 11:49
@radakam
radakam enabled auto-merge August 5, 2026 12:14
@radakam
radakam added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 6a4f9d2 Aug 5, 2026
25 checks passed
@radakam
radakam deleted the testserver-reject-empty-resource-names branch August 5, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants