You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -329,3 +329,32 @@ Select the branch to cut the release from (default is main).
329
329
330
330
Input the `Release version number` which is the Semantic Release number including
331
331
the `v` prefix (i.e. `v1.4.0`) and click `Run workflow` to kickoff the release.
332
+
333
+
334
+
### Temporary Interfaces for New RPCs
335
+
336
+
As the `terraform-plugin-go` Go module represents the protocol for Terraform providers communicating with [Terraform core](https://github.com/hashicorp/terraform),
337
+
this module is the first to receive updates whenever a new RPC is added. This module defines what RPCs must be implemented by downstream provider servers,
338
+
such as `terraform-plugin-framework` and `terraform-plugin-sdk/v2`, which is represented by the [`tfprotov5/6.ProviderServer` interface](https://github.com/hashicorp/terraform-plugin-go/blob/3fd901baa420da6d63c8bb999304291117ff09df/tfprotov6/provider.go#L10-L12).
339
+
340
+
Whenever we add new RPCs to this interface, we typically introduce a temporary interface in the first module release, to allow downstream provider servers time
This allows downstream provider servers a chance to implement the RPCs, while not immediately breaking the CI of actual providers that may be upgrading their `terraform-plugin-go` implementations
345
+
which are not using the new RPCs yet. Once the downstream provider servers have been updated and released, we can remove the temporary interface in the next release without making any changes to
346
+
`terraform-plugin-framework` or `terraform-plugin-sdk/v2`.
Temporary interfaces work great for RPCs that are optional to implement for a provider server AND are not in the main path of Terraform core. For example, all the ephemeral resource
352
+
RPCs are only called when an ephemeral resource is supported in the provider. However, this approach can introduce bugs if used in an RPC that is always called by Terraform Core, regardless
353
+
of whether the downstream provider servers implement them fully, like the `GetResourceIdentitySchemas` RPC:
Using a temporary interface for RPCs like this, enables provider servers to not fully implement the RPC, but indicates to core that they are implemented:
For "global" RPCs like this, it's better to either ensure our temporary interface checks allow the downstream provider servers to not implement said RPC (i.e. [don't return a diagnostic](https://github.com/hashicorp/terraform-plugin-go/blob/2030c6ca744896f2e8d5a5c60ed87989a57ef0ce/tfprotov6/tf6server/server.go#L579-L595)),
360
+
or, just require that the downstream provider servers implement the new RPC methods in the `ProviderServer` interface and accept the CI errors that will result.
0 commit comments