Conversation
bflad
added a commit
that referenced
this pull request
Jan 13, 2022
This was referenced Jan 18, 2022
Merged
ewbankkit
reviewed
Jan 20, 2022
ewbankkit
reviewed
Jan 20, 2022
Comment on lines
+42
to
+44
| - terraform-plugin-framwork: Implements protocol version 6. | ||
| - terraform-plugin-sdk: Implements protocol version 5. | ||
| - terraform-plugin-go: Implements either protocol version, based on whether the `tf5server` package (protocol version 5) or `tf6server` package (protocol version 6) is being used. |
There was a problem hiding this comment.
Maybe add a link to each of the repos?
Contributor
Author
There was a problem hiding this comment.
Great idea, will add.
Reference: #19 This new package implements a protocol version 6 compatible mux server. It is implemented similar to the existing protocol version 5 mux server, where validation and schema caching occurs upfront, then most RPCs act as a router. The main differences between the existing implementation and this new one are as follows: - Functionality is bundled into a package below the root package. - Naming is simplified and clarified. Previously, the capabilities of the mux server were believed to become much more dynamic, however in practice this never materialized due to the protocol. The mux server serves much more than a "Schema" so it is named "Mux" to prevent confusion. - There is no separation between a "Factory" and creating the mux server. There is not currently a benefit to introducing two layers of mux server handling. The main and only necessary entrypoint is a `NewMuxServer` function. - A `ProviderServer` method is provided to further simplify implementations, rather than needing a wrapping `func() tfprotov6.ProviderServer`. Once this package lands, the existing `SchemaServer` and `SchemaServerFactory` handling in the root package will be converted into a new `tf5muxserver` package with a similar API and structure as this one. That breaking change will occur afterwards before the next release.
2c44aa2 to
3c500cb
Compare
Co-authored-by: Kit Ewbank <Kit_Ewbank@hotmail.com>
This was referenced Jan 20, 2022
kmoe
approved these changes
Feb 2, 2022
Member
kmoe
left a comment
There was a problem hiding this comment.
Excellent. Agree with simplifications, and delighted with tests!
|
|
||
| if resp.Provider != nil { | ||
| if result.providerSchema != nil && !schemaEquals(resp.Provider, result.providerSchema) { | ||
| return result, fmt.Errorf("got a different provider schema across servers. Provider schemas must be identical across providers. Diff: %s", schemaDiff(resp.Provider, result.providerSchema)) |
Member
There was a problem hiding this comment.
Good simplification - no need for providerSchemaFrom & factory pattern
bflad
added a commit
that referenced
this pull request
Feb 2, 2022
…sion 6 implementation (#39) * Move existing root SchemaServer and SchemaServerFactory implementation to new tf5muxserver package * Migrate SchemaServer implementation to be similar to new protocol version 6 implementation Reference: #19 Reference: #37 Includes new internal tf5testserver package implementation.
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19
This new package implements a protocol version 6 compatible mux server. It is implemented similar to the existing protocol version 5 mux server, where validation and schema caching occurs upfront, then most RPCs act as a router.
The main differences between the existing implementation and this new one are as follows:
NewMuxServerfunction.ProviderServermethod is provided to further simplify implementations, rather than needing a wrappingfunc() tfprotov6.ProviderServer.Once this package lands, the existing
SchemaServerandSchemaServerFactoryhandling in the root package will be converted into a newtf5muxserverpackage with a similar API and structure as this one. That breaking change will occur afterwards before the next release.