-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reflect v0.15 schema changes #28
Conversation
Marking this as a draft temporarily until a version bump is decided/implemented per hashicorp/terraform#28050 (comment) |
Version bump implemented in hashicorp/terraform#28115 |
Given that this package mostly doesn't attempt to interpret the data, I think the job of deeper validation - such as whether |
Updating notes based on internal discussions: NOW:
AFTER:
|
@@ -38,8 +38,10 @@ func (p *ProviderSchemas) Validate() error { | |||
return errors.New("unexpected provider schema data, format version is missing") | |||
} | |||
|
|||
if ProviderSchemasFormatVersion != p.FormatVersion { | |||
return fmt.Errorf("unsupported provider schema data format version: expected %q, got %q", PlanFormatVersion, p.FormatVersion) | |||
oldVersion := "0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor assuming that this is going to be logic that will need to be changed in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I assume so, but from what I understand it most likely won't happen until the next major version of Terraform itself.
Your notes above look accurate. FWIW naming-wise I think that calling the root thing a block was and is inaccurate, because "block" includes the header (with type and labels). Calling it a "body" would've been IMO better. This is also how HCL internally refers to these things. But even the docs call it a "block" apparently https://www.terraform.io/docs/cli/commands/providers/schema.html#block-representation This might be something to address prior to v1 though, certainly not now and not in this PR. |
btw. I don't seem to have write access and so I can't merge this PR - would you do that for me, please? |
Not opposed to this, I'll leave it to you 🙂 the rationale around most of the field names was to ensure they matched what came in from the JSON, where possible. |
This reflects a change introduced a while ago in hashicorp/terraform#20949 and also changes introduced as part of hashicorp/terraform#28055, hashicorp/terraform#27699 and hashicorp/terraform#27793
The mentioned PRs do not change anything about the underlying syntax that couldn't be already expressed using the
SchemaAttribute.AttributeType
, however these changes allow the SDK and providers to communicate some additional metadata that cannot be communicated via "pure"cty.Type
, such as sensitivity, or description for each individual attribute.These new features are not in use by the SDK nor the built-in
terraform
provider yet (AFAIK), but this allows us to support it when the time comes.Closes #27