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

tfprotov5+tfprotov6: Replace usage of diagnostics in CallFunction RPC with function error #380

Merged
merged 7 commits into from
Feb 22, 2024

Conversation

bendbennett
Copy link
Contributor

Reference: hashicorp/terraform#34603

The next version of the plugin protocol (5.5/6.5) includes support for provider defined functions. This change modifies the response returned from the CallFunction RPC, replacing diagnostics with function error.

… with function error

Reference: hashicorp/terraform#34603

The next version of the plugin protocol (5.5/6.5) includes support for provider defined functions. This change modifies the response returned from the CallFunction RPC, replacing diagnostics with function error.
@bendbennett bendbennett added the breaking-change This will impact or improve our compatibility posture label Feb 21, 2024
@bendbennett bendbennett marked this pull request as ready for review February 21, 2024 10:36
@bendbennett bendbennett requested a review from a team as a code owner February 21, 2024 10:36
@bflad bflad added this to the v0.22.0 milestone Feb 21, 2024
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀 Since we know we are breaking the downstream SDKs, I wonder if our changelog here should also call out that this terraform-plugin-go release should only be updated with the upcoming minor versions of those SDKs:

  • terraform-plugin-framework@v1.6.0
  • terraform-plugin-mux@v0.15.0
  • terraform-plugin-sdk/v2@v2.33.0

@bendbennett bendbennett merged commit 90a82fe into main Feb 22, 2024
7 of 67 checks passed
@bendbennett bendbennett deleted the pdf-err-handling branch February 22, 2024 08:23
bendbennett added a commit to hashicorp/terraform-plugin-mux that referenced this pull request Feb 23, 2024
Reference: hashicorp/terraform-plugin-go#380

The next versions of the plugin protocol (5.5/6.5) include support for the CallFunction RPC and server capability. This change includes a modified implementation of the new RPC in all server implementations which accounts for returning a FunctionError rather than Diagnostics.
bendbennett added a commit to hashicorp/terraform-plugin-mux that referenced this pull request Feb 23, 2024
Reference: hashicorp/terraform-plugin-go#380

The next versions of the plugin protocol (5.5/6.5) include support for the CallFunction RPC and server capability. This change includes a modified implementation of the new RPC in all server implementations which accounts for returning a FunctionError rather than Diagnostics.
bendbennett added a commit to hashicorp/terraform-plugin-sdk that referenced this pull request Feb 23, 2024
Reference: hashicorp/terraform-plugin-go#380
Reference: https://developer.hashicorp.com/terraform/plugin/framework/migrating

The next versions of the plugin protocol (5.5/6.5) include support for provider defined functions. The terraform-plugin-sdk Go module will not be receiving this feature, however this Go module must be updated to handle the new RPC with errors.

Provider developers can implement provider defined functions by introducing terraform-plugin-mux and using their terraform-plugin-sdk based providers in combination with a terraform-plugin-framework provider that contains the provider defined functions.
bendbennett added a commit to hashicorp/terraform-plugin-sdk that referenced this pull request Feb 23, 2024
Reference: hashicorp/terraform-plugin-go#380
Reference: https://developer.hashicorp.com/terraform/plugin/framework/migrating

The next versions of the plugin protocol (5.5/6.5) include support for provider defined functions. The terraform-plugin-sdk Go module will not be receiving this feature, however this Go module must be updated to handle the new RPC with errors.

Provider developers can implement provider defined functions by introducing terraform-plugin-mux and using their terraform-plugin-sdk based providers in combination with a terraform-plugin-framework provider that contains the provider defined functions.
bendbennett added a commit to hashicorp/terraform-plugin-mux that referenced this pull request Feb 23, 2024
Reference: hashicorp/terraform-plugin-go#380

The next versions of the plugin protocol (5.5/6.5) include support for the CallFunction RPC and server capability. This change includes a modified implementation of the new RPC in all server implementations which accounts for returning a FunctionError rather than Diagnostics.
@veksh
Copy link

veksh commented Feb 23, 2024

@bflad @bendbennett routine update from dependabot ("Bump github.com/hashicorp/terraform-plugin-go from 0.21.0 to 0.22.0") now breaks the build

alex@alexair:terraform-provider-godaddy-dns$ go build
# github.com/hashicorp/terraform-plugin-framework/internal/toproto6
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto6/callfunction.go:21:3: unknown field Diagnostics in struct literal of type tfprotov6.CallFunctionResponse
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto6/callfunction.go:26:35: proto.Diagnostics undefined (type *tfprotov6.CallFunctionResponse has no field or method Diagnostics)
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto6/diagnostics.go:39:24: tfprotov6Diagnostic.FunctionArgument undefined (type *tfprotov6.Diagnostic has no field or method FunctionArgument)
# github.com/hashicorp/terraform-plugin-framework/internal/toproto5
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto5/callfunction.go:21:3: unknown field Diagnostics in struct literal of type tfprotov5.CallFunctionResponse
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto5/callfunction.go:26:35: proto.Diagnostics undefined (type *tfprotov5.CallFunctionResponse has no field or method Diagnostics)
../../go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.5.0/internal/toproto5/diagnostics.go:39:24: tfprotov5Diagnostic.FunctionArgument undefined (type *tfprotov5.Diagnostic has no field or method FunctionArgument)

jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Feb 27, 2024
Pending release of terraform-plugin-framework@v1.6.0

Ref: hashicorp/terraform-plugin-go#380
matt-FFFFFF added a commit to Azure/terraform-provider-alz that referenced this pull request Feb 27, 2024
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Feb 28, 2024
Pending release of terraform-plugin-framework@v1.6.0

Ref: hashicorp/terraform-plugin-go#380
@bendbennett
Copy link
Contributor Author

The following releases are all now available:

If you are upgrading to terraform-plugin-go@v0.22.0 and you are using terraform-plugin-framework, terraform-plugin-mux and/or terraform-plugin-sdk/v2, you will also need to upgrade those Go modules.

rishabh-bector pushed a commit to rishabh-bector/terraform-provider-cloudflare that referenced this pull request Mar 1, 2024
Pending release of terraform-plugin-framework@v1.6.0

Ref: hashicorp/terraform-plugin-go#380
rishabh-bector pushed a commit to rishabh-bector/terraform-provider-cloudflare that referenced this pull request Mar 1, 2024
Pending release of terraform-plugin-framework@v1.6.0

Ref: hashicorp/terraform-plugin-go#380
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change This will impact or improve our compatibility posture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants