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: Add FunctionServer to ProviderServer interface #353

Closed
bflad opened this issue Dec 12, 2023 · 1 comment · Fixed by #388
Closed

tfprotov5+tfprotov6: Add FunctionServer to ProviderServer interface #353

bflad opened this issue Dec 12, 2023 · 1 comment · Fixed by #388
Assignees
Labels
breaking-change This will impact or improve our compatibility posture enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Dec 12, 2023

terraform-plugin-go version

v0.20.0 (not yet released)

Description

The upcoming v0.20.0 release will contain the tfprotov5 and tfprotov6 package FunctionServer interface, which contains the two RPC function handlers for provider defined functions. Rather than immediately requiring all downstream SDK implementations to implement this functionality immediately by requiring FunctionServer as part of ProviderServer, it seems ideal if we can stagger the releases between introducing and supporting the new FunctionServer bits then having a followup release that makes the implementation required with the "breaking change" to match the intended design of this Go module to always require all provider implementations to fully implement the protocol.

For provider developers, this type of terraform-plugin-go change previously surfaced as confusing missing method XXX when updating only some dependencies of terraform-plugin-framework, terraform-plugin-mux, terraform-plugin-sdk, or terraform-plugin-testing where terraform-plugin-go required the additional ProviderServer bits, but with the newer setup there can at least be better chance that particular update issue won't occur for them.

Proposal

In the first release, temporarily check for FunctionServer interface implementation in tfprotov5/tf5server and tfprotov6/tf6server package GetFunctions and CallFunction implementations. If found, pass request downstream. If not found, raise an error diagnostic.

In the second release (part of this issue), add FunctionServer interface in ProviderServer implementation. Remove temporary FunctionServer interface checks and associated error diagnostic.

References

@bflad bflad added enhancement New feature or request breaking-change This will impact or improve our compatibility posture labels Dec 12, 2023
@bflad bflad added this to the v0.21.0 milestone Dec 12, 2023
bflad added a commit that referenced this issue Dec 14, 2023
#351)

Reference: hashicorp/terraform#34383
Reference: #353

The next version of the plugin protocol (5.5/6.5) includes support for provider defined functions. This change introduces the initial implementation of that support including:

- Updated Protocol Buffers definitions
- Re-generated Protocol Buffers Go code
- Initial implementations of `tfprotov5` and `tfprotov6` package abstractions and wiring between those abstractions and the Protocol Buffers generated Go code
- Initial implementations of `tfprotov5/tf5server` and `tfprotov6/tf6server` for the new `GetFunctions` and `CallFunction` RPCs

This temporarily will not require `ProviderServer` implementations to include `FunctionServer` implementation, however that change will occur in a subsequent release.
@bflad bflad self-assigned this Dec 14, 2023
bflad added a commit that referenced this issue Dec 14, 2023
Reference: #353

This breaking change aligns the `tfprotov5` and `tfprotov6` packages with the intended design of this Go module, which is to fully implement the Terraform Plugin Protocol. The `FunctionServer` interface was temporarily optional in v0.20.0 so downstream SDKs could implement and release support first with a lesser likelihood that developers would run into compilation errors when only upgrading a single downstream Go module.

Provider developers should upgrade this Go module only after ensuring their provider Go module is using at least:

- github.com/hashicorp/terraform-plugin-framework@v1.5.0
- github.com/hashicorp/terraform-plugin-mux@v0.13.0
- github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0
@bflad bflad modified the milestones: v0.21.0, v0.22.0 Jan 12, 2024
@bflad bflad modified the milestones: v0.22.0, v0.23.0 Feb 21, 2024
bflad added a commit that referenced this issue Mar 11, 2024
…eResourceState in ResourceServer

Reference: #353
Reference: #363

This removes the temporary handling to smoothly release the new Terraform 1.8 and later RPC handling for provider servers. These changes codify this Go module's desired design that it reflects the protocol via its required implementations.
bflad added a commit that referenced this issue Apr 22, 2024
…eResourceState in ResourceServer (#388)

Reference: #353
Reference: #363

This removes the temporary handling to smoothly release the new Terraform 1.8 and later RPC handling for provider servers. These changes codify this Go module's desired design that it reflects the protocol via its required implementations.
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 enhancement New feature or request
Projects
None yet
1 participant