Skip to content

datacatalog: add RICHTEXT to TagTemplate primitive_type enum (#13597)#17489

Merged
trodge merged 1 commit into
GoogleCloudPlatform:mainfrom
jbbqqf:feat/13597-datacatalog-richtext
Jun 3, 2026
Merged

datacatalog: add RICHTEXT to TagTemplate primitive_type enum (#13597)#17489
trodge merged 1 commit into
GoogleCloudPlatform:mainfrom
jbbqqf:feat/13597-datacatalog-richtext

Conversation

@jbbqqf

@jbbqqf jbbqqf commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds RICHTEXT to the allowed enum values of
google_data_catalog_tag_template.fields.type.primitive_type. The Data
Catalog v1 API has supported RICHTEXT for years (it's listed alongside
DOUBLE, STRING, BOOL, TIMESTAMP in the Discovery descriptor for
GoogleCloudDatacatalogV1FieldType.PrimitiveType), but the mmv1 schema
omitted it. Users who needed to declare rich-text tag-template fields had
to fall back to hand-rolled gcloud calls or imports.

Fixes hashicorp/terraform-provider-google#13597 — see hashicorp/terraform-provider-google#13597

Why

Data Catalog tag templates can declare fields whose primitive_type is
RICHTEXT (an HTML-aware longer-form description). This is documented in
the API enum and is observable in the published Discovery doc:

.gopath/pkg/mod/google.golang.org/api@v0.278.0/datacatalog/v1/datacatalog-gen.go:
  // PrimitiveType: ...
  // Possible values:
  //   "PRIMITIVE_TYPE_UNSPECIFIED" - The default invalid value for a type.
  //   "DOUBLE" - A double precision number.
  //   "STRING" - An UTF-8 string.
  //   "BOOL" - A boolean value.
  //   "TIMESTAMP" - A timestamp.
  //   "RICHTEXT" - A Richtext description.
  PrimitiveType string `json:"primitiveType,omitempty"`

But mmv1/products/datacatalog/TagTemplate.yaml only listed four values,
so the generated provider validates primitive_type against
{DOUBLE, STRING, BOOL, TIMESTAMP} and rejects RICHTEXT at plan-time.

GCP API reference:

What changed

This change is to a mmv1-generated resource. Files touched in
magic-modules:

 mmv1/products/datacatalog/TagTemplate.yaml | 1 +
 1 file changed, 1 insertion(+)

The downstream regeneration adds RICHTEXT to:

  • ValidateEnum([]string{"DOUBLE", "STRING", "BOOL", "TIMESTAMP", "RICHTEXT", ""})
    in resource_data_catalog_tag_template.go (TPG and TPGB), and
  • the documented Possible values list in the field description.

No expand/flatten logic changes are needed: primitive_type is already
round-tripped as an opaque string.

Edge cases tested

# Scenario Behavior Verified by
1 primitive_type = "RICHTEXT" Accepted at plan-time; rejected before this PR with expected primitive_type to be one of [DOUBLE STRING BOOL TIMESTAMP] Static: regenerated provider, go build, go vet all clean; the ValidateEnum slice now contains "RICHTEXT"
2 Existing values (DOUBLE, STRING, BOOL, TIMESTAMP) Unchanged Same regenerated ValidateEnum slice retains all four
3 Empty value Still allowed (computed-from-API) ValidateEnum slice still contains "" for the unset case

Test protocol

Test Result Notes
cd mmv1&& go run . --output ../tpg-out --version ga --no-docs OK Regeneration completed without warnings
go build ./google/services/datacatalog/... (TPG) OK clean compile against regenerated source
go vet ./google/services/datacatalog/... (TPG) OK no findings

This is a purely additive enum extension — there is no API call
behavior change, no expand/flatten path change, and no need for live
GCP smoke. The Discovery doc is the authoritative source that the API
already accepts RICHTEXT, and the regenerated provider's only diff
versus current main is the addition of the enum value to the validation
slice and to the description string.

Resources

Release notes

data_catalog: added `RICHTEXT` to allowed values of `primitive_type` on `google_data_catalog_tag_template` fields.

Disclosure

This PR was implemented with assistance from Claude Code as part of a
focused contribution batch on small mmv1 enum gaps. The diff was
reviewed manually against the GCP Data Catalog v1 API Discovery
descriptor (the canonical source for the enum's accepted values). The
regenerated TPG/TPGB provider compiled and vetted cleanly with the new
enum value. Because this is a purely additive validation extension — no
expand/flatten or API-call change — no live smoke was run.

The author (a human) reviewed the diff and the regenerated provider
output before opening this PR.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 9, 2026
@google-cla

google-cla Bot commented May 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot requested a review from trodge May 9, 2026 09:16
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@trodge, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@jbbqqf

jbbqqf commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

@modular-magician modular-magician added service/datacatalog and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels May 12, 2026
@modular-magician

modular-magician commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 2d9801e:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 3 insertions(+), 3 deletions(-)
google-beta provider View Diff 2 files changed, 3 insertions(+), 3 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
29 28 1 0
Affected Service Packages
  • datacatalog

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the build log

@jbbqqf, @trodge VCR tests complete for 2d9801e!

@github-actions

Copy link
Copy Markdown

@trodge This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions

Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @trodge This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

…oogleCloudPlatform#13597)

Adds RICHTEXT to the allowed enum values for
google_data_catalog_tag_template.fields.type.primitive_type. The Data
Catalog v1 API has long supported RICHTEXT (per the Discovery
descriptor) but the mmv1 schema was missing the value, blocking users
who manage tag templates with rich-text fields via Terraform.
@jbbqqf jbbqqf force-pushed the feat/13597-datacatalog-richtext branch from 2d9801e to 6429e2a Compare May 24, 2026 15:15
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 24, 2026
@github-actions

Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @trodge This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 27, 2026
@modular-magician

modular-magician commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 6429e2a:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 3 insertions(+), 3 deletions(-)
google-beta provider View Diff 2 files changed, 3 insertions(+), 3 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
29 28 1 0
Affected Service Packages
  • datacatalog

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@jbbqqf, @trodge VCR tests complete for 6429e2a!

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @trodge This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

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.

Enhancement: google_data_catalog_tag_template: RICHTEXT support

3 participants