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

Introduce providerserver package, deprecate tfsdk server functionality #308

Merged
merged 2 commits into from Apr 28, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Apr 27, 2022

Reference: #215
Continues: #294
Continues: #296

This change represents the first half of the work necessary to extract the tfprotov6.ProviderServer implementation and helper functions out of the tfsdk package and into separate packages. The providerserver package will be the provider developer facing functionality, while the next iteration of this refactoring will move the actual server implementation into a separate internal package. Once in that separate internal package, efforts can be made to make that code handle terraform-plugin-go type conversions "at the edge" better.

Reference: #215
Reference: #294
Reference: #296

This change represents the first half of the work necessary to extract the `tfprotov6.ProviderServer` implementation and helper functions out of the `tfsdk` package and into separate packages. The `providerserver` package will be the provider developer facing functionality, while the next iteration of this refactoring will move the actual server implementation into a separate internal package. Once in that separate internal package, efforts can be made to make that code handle terraform-plugin-go type conversions "at the edge" better.
@bflad bflad added the tech-debt Issues tracking technical debt that we're carrying. label Apr 27, 2022
@bflad bflad added this to the v0.7.0 milestone Apr 27, 2022
@bflad bflad requested a review from a team as a code owner April 27, 2022 17:59
// Returns a protocol version 6 ProviderServer implementation based on the
// given Provider and suitable for usage with the terraform-plugin-go
// tf6server.Serve() function and various terraform-plugin-mux functions.
func NewProtocol6ProviderServer(p Provider) func() tfprotov6.ProviderServer {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is safe, as this function was not released as part of this package yet.

// acceptance testing helper/resource.TestCase.ProtoV6ProviderFactories.
//
// The error return is not currently used, but it may be in the future.
func NewProtocol6ProviderServerWithError(p Provider) func() (tfprotov6.ProviderServer, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is safe, as this function was not released as part of this package yet.

"github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server"
)

// Returns a protocol version 6 ProviderServer implementation based on the
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps prefix with NewProtocol6 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated in 81cba2c -- we should figure out what linter is triggering the warnings so we can either explicitly enable or disable it per team preference.

bflad added a commit to hashicorp/terraform-website that referenced this pull request Apr 28, 2022
@bflad bflad merged commit 74d4f9c into main Apr 28, 2022
@bflad bflad deleted the bflad-providerserver-package branch April 28, 2022 16:43
bflad added a commit that referenced this pull request Apr 28, 2022
bflad added a commit to hashicorp/terraform-website that referenced this pull request Apr 28, 2022
@github-actions
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 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tech-debt Issues tracking technical debt that we're carrying.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants