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

testserver: reject empty catalog and MLflow model names#6157
radakam merged 6 commits into
mainfrom
testserver-reject-empty-resource-names

Conversation

@radakam

@radakamradakam 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🙈​skipTime
🔄​aws linux144295109514:04
🔄​aws windows144297109313:28
🔄​azure linux144294109516:50
💚​azure windows44297109312:14
💚​gcp linux15296109511:22
💚​gcp windows15298109312:58
11 interesting tests: 4 RECOVERED, 4 SKIP, 3 flaky
Test Nameaws linuxaws windowsazure linuxazure windowsgcp linuxgcp 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):
durationenvtestname
9:03gcp windowsTestAccept
8:14aws windowsTestAccept
6:35azure windowsTestAccept
5:41gcp windowsTestFilerWorkspaceFilesExtensionsStat
4:36azure windowsTestFilerWorkspaceFilesExtensionsReadDir
4:23azure windowsTestImportDirDoesNotOverwrite
4:16azure linuxTestFilerReadWrite/workspace_files
4:06aws windowsTestFilerRecursiveDelete/workspace_files_extensions
3:39aws windowsTestFilerReadWrite/workspace_files
3:39azure windowsTestExportDir
3:10azure linuxTestFilerWorkspaceFilesExtensionsRead
3:06gcp linuxTestAccept
3:00azure linuxTestFilerRecursiveDelete/workspace_files_extensions
2:57aws linuxTestAccept
2:56gcp windowsTestAccept/bundle/resources/models/empty-name/DATABRICKS_BUNDLE_ENGINE=terraform
2:54azure linuxTestAccept
2:50gcp windowsTestFilerWorkspaceFilesExtensionsReadDir
2:48gcp windowsTestFilerWorkspaceFilesExtensionsRead
2:43gcp windowsTestFilerRecursiveDelete/workspace_files
2:39azure windowsTestFilerWorkspaceFilesExtensionsStat
2:27azure linuxTestFilerRecursiveDelete/workspace_files
2:19gcp linuxTestFilerWorkspaceFilesExtensionsReadDir
2:17aws linuxTestFilerWorkspaceFilesExtensionsRead
2:17gcp linuxTestFilerRecursiveDelete/workspace_files
2:12azure windowsTestFilerWorkspaceNotebook/pyNb.py
2:09gcp windowsTestAccept/bundle/resources/models/empty-name/DATABRICKS_BUNDLE_ENGINE=direct
2:07gcp windowsTestFilerReadWrite/workspace_files_extensions
2:01gcp linuxTestSyncIncrementalFileSync
2:01azure windowsTestFilerRecursiveDelete/workspace_files_extensions

@radakamradakam changed the title testserver: reject empty catalog and model namestestserver: reject empty catalog and MLflow model namesAug 4, 2026
@radakam
radakam marked this pull request as ready for review August 5, 2026 10:41
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
radakamforce-pushed the testserver-reject-empty-resource-names branch from bfc8c80 to 2b277c0CompareAugust 5, 2026 11:49
@radakam
radakam enabled auto-merge August 5, 2026 12:14
@radakam
radakam added this pull request to the merge queueAug 5, 2026
Merged via the queue into main with commit 6a4f9d2Aug 5, 2026
25 checks passed
@radakam
radakam deleted the testserver-reject-empty-resource-names branch August 5, 2026 16:17
Sign up for freeto 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

@radakam@eng-dev-ecosystem-bot@denik