Skip to content

Conversation

@alexott
Copy link
Contributor

@alexott alexott commented Oct 21, 2025

Changes

The GET API for serving endpoints does not return sensitive *_plaintext credential fields for external models (e.g., openai_api_key_plaintext, google_service_account_key_plaintext). This causes Terraform to detect drift even when no actual changes have been made.

Changes:

  • Added reflection-based copySensitiveFields() helper function that automatically copies all *Plaintext fields from Terraform state to API response during Read operations
  • Applied fix to both databricks_model_serving and databricks_model_serving_provisioned_throughput resources
  • Added comprehensive unit tests for the sensitive field copying logic
  • Refactored sensitive field tests to use MockWorkspaceClientFunc pattern

The solution is generic and will automatically handle new external model providers and their plaintext credential fields without code changes.

Fixes #5074

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework
  • has entry in NEXT_CHANGELOG.md file

Fixes #5074

The GET API for serving endpoints does not return sensitive *_plaintext
credential fields for external models (e.g., openai_api_key_plaintext,
google_service_account_key_plaintext). This causes Terraform to detect
drift even when no actual changes have been made.

Changes:
- Added reflection-based copySensitiveFields() helper function that
  automatically copies all *Plaintext fields from Terraform state to
  API response during Read operations
- Applied fix to both databricks_model_serving and
  databricks_model_serving_provisioned_throughput resources
- Added comprehensive unit tests for the sensitive field copying logic
- Refactored sensitive field tests to use MockWorkspaceClientFunc pattern

The solution is generic and will automatically handle new external model
providers and their plaintext credential fields without code changes.
@alexott alexott requested review from a team as code owners October 21, 2025 08:41
@alexott alexott requested review from Tejas-Kochar and removed request for a team October 21, 2025 08:41
@alexott alexott temporarily deployed to test-trigger-is October 21, 2025 08:41 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is October 21, 2025 08:42 — with GitHub Actions Inactive
@alexott alexott requested a review from rauchy October 27, 2025 15:34
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 5125
  • Commit SHA: 819135ab2b570f1a9179b130ceac29fdce978090

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE] Issue with databricks_model_serving resource

2 participants