Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to override upstream DeprecationMessage #2703

Open
guineveresaenger opened this issue Dec 9, 2024 · 1 comment
Open

Unable to override upstream DeprecationMessage #2703

guineveresaenger opened this issue Dec 9, 2024 · 1 comment
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@guineveresaenger
Copy link
Contributor

What happened?

It looks like we cannot override a DeprecationMessage on a field if upstream has set one previously.
context: pulumi/pulumi-cloudflare#952 - was thinking that with the lack of repro on my side, I could at least make the deprecation message a little more strongly worded. It appears that if a field already has a DeprecationMessage from upstream, the bridge just ignores what's set in resources.go.

This may or may not be considered a bug - it's probably not a common use case, but my tendency would be to prioritize information from resources.go in the case of a conflict.

I've found no related issues.

Example

In the Cloudflare provider's resources.go, try the following test messages:

"cloudflare_record": {
				DeleteBeforeReplace: true,
				Fields: map[string]*tfbridge.SchemaInfo{
					"value": {
						DeprecationMessage: "HI OH SO SORRY UNICORN INVASION: " +
							"`value` is deprecated in favor of `content`. It will be removed in the next major release." +
							"If you encounter any irregularities on this field, we strongly recomment using `content` instead.",
					},
					"zone_id": {
						DeprecationMessage: "hey does this thing even work",
					},
				},
			},

Important note: value field has an existing upstream deprecation message; zone_id does not.

Run make schema.

Observe schema.json - value has upstream's deprecation message despite setting in resources.go.

 "value": {
                    "type": "string",
                    "description": "The value of the record. Must provide only one of `data`, `content`, `value`.\n",
                    "deprecationMessage": "`value` is deprecated in favour of `content` and will be removed in the next major release."
                },
                "zoneId": {
                    "type": "string",
                    "description": "The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**\n",
                    "deprecationMessage": "hey does this thing even work"
                }

Output of pulumi about

n/a

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@guineveresaenger guineveresaenger added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 9, 2024
@iwahbe iwahbe removed the needs-triage Needs attention from the triage team label Dec 10, 2024
@iwahbe
Copy link
Member

iwahbe commented Dec 10, 2024

Looks like a bug to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants