Add direct-mode bundle support for AI Gateway mcp_service - #6633
Conversation
88d488b to
c7cd499
Compare
Integration test reportCommit: 61b4f2c
|
| reason: id_field | ||
| - field: mcp_service_id | ||
| reason: id_field | ||
| ignore_remote_changes: |
b0fb58b to
0dbe249
Compare
janniklasrose
left a comment
There was a problem hiding this comment.
comments can be follow-ups
| if ms == nil { | ||
| continue | ||
| } | ||
| ms.Parent = resolveParent(b, ms.Parent) |
There was a problem hiding this comment.
can be small follow-up: resolveAiGatewayParent so the function signature is clear
| >>> [CLI] ai-gateway get-mcp-service mcp-services/main.myschema.myservice | ||
| { | ||
| "name": "mcp-services/main.myschema.myservice", | ||
| "comment": "COMMENT1" | ||
| } |
There was a problem hiding this comment.
printing the whole API response here is going to cause the golden files to drift over time as more fields get added -> let's just assert the fields that you want to ensure the resource got deployed as expected.
I think this is also in model_services so if you could clean that up as a follow-up that'd be great :-)
There was a problem hiding this comment.
we are applying filtering to { "name", "comment" } through jq, so I think we should be good. Model service is already clean, mcp and mps are too now
There was a problem hiding this comment.
ah, somehow missed that you use jq already
Second of a stacked split of #6410 (databricks/cli), stacked on the model_service PR. Adds the direct-engine bundle resource for the AI Gateway MCP service securable (mcp_services): config/resource + dresources CRUD, testserver, acceptance (basic + remote-delete + bind) and an invariant config, plus registration and regenerated schema. All SDK struct literals set every field to satisfy exhaustruct; mcp_services added to the TF-lifecycle ignore list and the statemgmt full-resource-coverage fixtures. Direct engine only. Co-authored-by: Isaac <no-reply@databricks.com>
Adds a Cloud=true lifecycle test for mcp_services, matching model_services and model_provider_services. An MCP service must point at a pre-existing UC connection hosting the MCP server (config.source_connection), and there is no bundle `connections` resource to deploy it as a dependency, so the script creates a bearer-auth connection out-of-band on cloud (guarded by CLOUD_ENV) and tears it down via trap. Bearer auth with a placeholder host avoids the OAuth/DCR reachability probe the backend runs at create time for MCP connections. The mock testserver doesn't validate source_connection, so the connection is only created on the real-workspace run. basic and remote-delete opt out with Cloud=false (they inspect the recorded request stream / use a fixed out-of-band delete that can't run on cloud). Co-authored-by: Isaac <no-reply@databricks.com>
Follow-up to the mcp_service support, mirroring #6654 for model_services now that #6618 enabled it. Added catalog.McpService to apitypes.yml so the generator reads field behaviors from the response type (config.* paths), removed the hand-written config.source_connection.is_deleted override from resources.yml, and regenerated resources.generated.yml. The suppression is unchanged, just auto-derived from the OpenAPI schema instead of hand-listed. Co-authored-by: Isaac <no-reply@databricks.com>
…t_tag) Main upgraded databricks-sdk-go v0.177 -> v0.178, which is the GA-sync SDK that dropped `owner` (now effective_owner only) and the request_tag rate-limit feature from the AI Gateway securable types. Adapted the mcp_service resource to v0.178: removed the stale Owner field from mcpServiceBody, and regenerated the schema/validation/refschema/pydabs outputs. RATE_LIMIT_KEY_REQUEST_TAG (and the request_tag_key/value fields) are now absent from mcp_services and model_services alike, matching the v0.178 spec. Co-authored-by: Isaac <no-reply@databricks.com>
…test
The earlier cloud test created a metastore-level UC connection out-of-band,
which failed in CI: the deco service principal lacks metastore CREATE
CONNECTION, and under `bash -euo pipefail` the suppressed failure aborted the
script before deploy ("No active deployment found to destroy!").
Switch to a SCHEMA-SCOPED connection (parent schemas/main.default), which needs
only schema-level privileges the deploy SP already has. Schema-level connections
can't set is_mcp_connection (metastore-only), but the mcp_service accepts a
plain HTTP connection as its source_connection (validated end to end against a
staging workspace: create schema-scoped connection -> deploy -> no-drift plan ->
destroy). The reference uses the 3-part form connections/{catalog}.{schema}.{name}.
Also adds temporary debug output around `connections create` (silent on success;
prints the error on failure) so a CI failure surfaces the real cause instead of
being swallowed. Remove once the cloud run is confirmed green.
Co-authored-by: Isaac <no-reply@databricks.com>
…ayout Main #6679 split the monolithic bundle/direct/dresources/resources.yml and resources.generated.yml into one file per resource under configs/. Recreate the mcp_services rules in that layout: configs/mcp_services.yml (provided_id_fields for the immutable parent + mcp_service_id) and the regenerated configs/mcp_services.generated.yml (config.source_connection.is_deleted, derived from catalog.McpService via apitypes.yml). No behavior change; matches how model_services is expressed on main. Co-authored-by: Isaac <no-reply@databricks.com>
0dbe249 to
61b4f2c
Compare
Addresses jannik's review nit on #6633 (deferred as a follow-up): the helper resolves the compound schemas/{catalog}.{schema} parent shared by the AI Gateway securables, so the more specific name makes the signature clear. Renames the definition and all three call sites (model_services, mcp_services, model_provider_services). No behavior change. Co-authored-by: Isaac <no-reply@databricks.com>
Integration test reportCommit: ae97535
404 interesting tests: 311 MISS, 79 FAIL, 8 flaky, 5 KNOWN, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
Second of a stacked split of #6410 (databricks/cli), stacked on the model_service PR. Adds the direct-engine bundle resource for the AI Gateway MCP service securable (mcp_services): config/resource + dresources CRUD, testserver, acceptance (basic + remote-delete + bind) and an invariant config, plus registration and regenerated schema. All SDK struct literals set every field to satisfy exhaustruct; mcp_services added to the TF-lifecycle ignore list and the statemgmt full-resource-coverage fixtures. Direct engine only. ## Changes <!-- Brief summary of your changes that is easy to understand --> ## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> ## Tests <!-- How have you tested the changes? --> <!-- If your PR needs to be included in the release notes for next release, add a changelog fragment: create .nextchanges/<section>/<name>.md with a one-line description (e.g. .nextchanges/cli/quickstart.md). See .nextchanges/README.md. --> --------- Co-authored-by: Isaac <no-reply@databricks.com>
## Release v1.17.0 ### Notable Changes * Bump the direct deployment state version to 3. Clients older than v1.8.0 will reject bundles deployed with this release. ([#6713](#6713)) ### CLI * Add an `INVALID_REFRESH_TOKEN` error code to `databricks auth token --output json` failures. ([#6684](#6684)) * Add experimental `databricks auth docker configure` to configure Docker credential helper access for Databricks Artifact Registry. ([#6700](#6700)) * Add experimental `databricks auth docker token` to generate Docker credentials for Databricks Artifact Registry. ([#6699](#6699)) * `databricks environments setup-local` now reports the `E_PROVISION_CONFLICT` error code instead of the generic `E_PROVISION` when `uv sync` fails to resolve a dependency conflict. ([#6666](#6666)) * Preserve SSH sessions across temporary tunnel disconnects, with bounded replay and backpressure for large transfers. ([#6650](#6650)) * Allow OAuth U2M logins to override the CLI client ID with `--client-id`, profile `client_id`, or `DATABRICKS_CLIENT_ID`. ([#6594](#6594)) ### Bundles * direct: Store a dashboard's `serialized_dashboard` in state as a content hash instead of its full contents. ([#6105](#6105)) * direct: Fix pipelines recreation when the whole `ingestion_definition` block is added or removed. ([#6589](#6589)) * `bundle plan`, `deploy`, and `destroy` no longer report removing `permissions`, `grants`, or secret scope ACLs from a bundle as a deletion, since it leaves the resource untouched. ([#6647](#6647)) * `bundle plan` and `deploy` no longer list or count a resource that was already deleted remotely as a deletion, matching `bundle destroy`; applying still cleans up its stale state entry. ([#6675](#6675)) * Fix `bundle run` failing with `expected an int, found a string` when an unrelated resource references another resource that is not deployed. `bundle run` now resolves `${resources.*}` references only within the resource being run. ([#6690](#6690)) * Add grants support for the AI Gateway `model_service`, `mcp_service`, and `model_provider_service` resources (direct engine). ([#6635](#6635)) * Add bundle support for the AI Gateway `mcp_service` resource (direct engine). ([#6633](#6633)) * Add bundle support for the AI Gateway `model_provider_service` resource (direct engine). ([#6634](#6634)) * Add bundle support for the AI Gateway `model_service` resource (direct engine). ([#6525](#6525)) * Prevent resource drift on catalogs if `storage_root` contained a trailing slash in the URL. ([#6622](#6622)) * Fixed a "lineage mismatch in state files" error that could occur after destroying a bundle and redeploying it from another machine. `bundle destroy` now removes the local state file so no stale lineage is left behind, and prunes the state directories it leaves empty (such as `.internal/` and `sync-snapshots/`). ([#6210](#6210), [#6685](#6685)) * direct: `bundle plan` no longer reports a permanent update on a cluster that uses a cluster policy: when the cluster spec sets `policy_id`, a field present in the remote but absent from the bundle config is not treated as drift. ([#6531](#6531)) * `bundle deploy` on the direct engine now reports each resource as soon as it is deployed, instead of listing them all after the deployment finishes. A deploy that fails part way through now reports the resources it did apply. ([#6361](#6361)) * Direct-engine bundles no longer flag phantom drift on server-populated nested fields under reused config types (e.g. `external_locations` file-event-queue resource IDs, `database_instances` parent-instance refs, `apps` git credential ID). ([#6618](#6618)) * `databricks bundle generate app` now reproduces a git-backed app's `git_repository` and `git_source` configuration instead of emitting a workspace `source_code_path`, so generating from a Git-deployed app no longer silently converts it to workspace source. ([#6656](#6656)) * Improved configuration load time for bundles with many included files. ([#6195](#6195)) * `bundle destroy` no longer deletes triggered job runs, leaving them untouched on the backend. ([#6672](#6672)) * direct: resources.job\_runs: new lifecycle.triggers.on\_file\_change setting to restart the run when monitored files change. Can be set to a series of paths or globs. ([#6309](#6309)) * Bundle summary now shows a name for Postgres branches, endpoints, databases, and roles instead of a blank Name field. ([#6663](#6663)) * Added PyDABs (Python) support for cluster policies, dashboards, and Genie spaces. ([#6585](#6585)) * CLI commands no longer imply that a resource whose type has no workspace URL is merely not deployed yet. ([#6583](#6583)) * Capture the implicit dependency a vector search index has on a catalog or schema defined in the same bundle, so the catalog and schema are deployed first. ([#6655](#6655)) ### Dependency Updates * Bump dependencies with known vulnerabilities. ([#6695](#6695)) * Bump `github.com/databricks/databricks-sdk-go` from v0.177.0 to v0.178.0. ([#6673](#6673)) * Bump Terraform provider from v1.131.0 to v1.132.0. ([#6671](#6671))
Second of a stacked split of #6410 (databricks/cli), stacked on the model_service PR. Adds the direct-engine bundle resource for the AI Gateway MCP service securable (mcp_services): config/resource + dresources CRUD, testserver, acceptance (basic + remote-delete + bind) and an invariant config, plus registration and regenerated schema. All SDK struct literals set every field to satisfy exhaustruct; mcp_services added to the TF-lifecycle ignore list and the statemgmt full-resource-coverage fixtures. Direct engine only.
Changes
Why
Tests