datacatalog: add RICHTEXT to TagTemplate primitive_type enum (#13597)#60
Open
jbbqqf wants to merge 13 commits into
Open
datacatalog: add RICHTEXT to TagTemplate primitive_type enum (#13597)#60jbbqqf wants to merge 13 commits into
jbbqqf wants to merge 13 commits into
Conversation
…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. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
RICHTEXTto the allowed enum values ofgoogle_data_catalog_tag_template.fields.type.primitive_type. The DataCatalog v1 API has supported
RICHTEXTfor years (it's listed alongsideDOUBLE,STRING,BOOL,TIMESTAMPin the Discovery descriptor forGoogleCloudDatacatalogV1FieldType.PrimitiveType), but the mmv1 schemaomitted it. Users who needed to declare rich-text tag-template fields had
to fall back to hand-rolled
gcloudcalls or imports.Fixes hashicorp/terraform-provider-google#13597 — see hashicorp/terraform-provider-google#13597
Why
Data Catalog tag templates can declare fields whose
primitive_typeisRICHTEXT(an HTML-aware longer-form description). This is documented inthe API enum and is observable in the published Discovery doc:
But
mmv1/products/datacatalog/TagTemplate.yamlonly listed four values,so the generated provider validates
primitive_typeagainst{DOUBLE, STRING, BOOL, TIMESTAMP}and rejectsRICHTEXTat plan-time.GCP API reference:
What changed
This change is to a mmv1-generated resource. Files touched in
magic-modules:
The downstream regeneration adds
RICHTEXTto:ValidateEnum([]string{"DOUBLE", "STRING", "BOOL", "TIMESTAMP", "RICHTEXT", ""})in
resource_data_catalog_tag_template.go(TPG and TPGB), andPossible valueslist in the field description.No expand/flatten logic changes are needed:
primitive_typeis alreadyround-tripped as an opaque string.
Edge cases tested
primitive_type = "RICHTEXT"expected primitive_type to be one of [DOUBLE STRING BOOL TIMESTAMP]go build,go vetall clean; theValidateEnumslice now contains"RICHTEXT"DOUBLE,STRING,BOOL,TIMESTAMP)ValidateEnumslice retains all fourValidateEnumslice still contains""for the unset caseTest protocol
cd mmv1&& go run . --output ../tpg-out --version ga --no-docsgo build ./google/services/datacatalog/...(TPG)go vet ./google/services/datacatalog/...(TPG)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 diffversus current main is the addition of the enum value to the validation
slice and to the description string.
Resources
GoogleCloudDatacatalogV1FieldType.PrimitiveType(Discovery doc — vendored Go client at
google.golang.org/api/datacatalog/v1)https://github.com/jbbqqf/magic-modules/blob/feat/13597-datacatalog-richtext/mmv1/products/datacatalog/TagTemplate.yaml
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.