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

tfsdk: Migrate server to internal/proto6server package #310

Merged
merged 3 commits into from May 3, 2022

Commits on Apr 29, 2022

  1. tfsdk: Migrate server to internal/proto6server package

    Reference: #215
    
    This change was accomplished by:
    
    - `mkdir internal/proto6server`
    - `git mv tfsdk/serve* internal/proto6server/`
    - Replacing `package tfsdk` with `package proto6server` in those moved files
    - Removing `NewProtocol6Server()`, `Serve()`, and `ServeOpts` in moved files
    - Adding necessary `tfsdk.` scoping to the now external `tfsdk` package references
    - Moved necessary unexported methods (e.g. `Schema.tfprotov6Schema()`) to `internal/toproto6` (this package will be expanded further in the future)
    - Moved attribute plan modification testing (including test plan modifiers) to `internal/proto6server/attribute_plan_modification_test.go`
    - Moved attribute validation testing (including test validators) to `internal/proto6server/attribute_validation_test.go`
    - Moved block plan modification testing (including test plan modifiers) to `internal/proto6server/block_plan_modification_test.go`
    - Moved block validation testing (including test validators) to `internal/proto6server/block_validation_test.go`
    - Copied tfsdk Config/Plan/State.getAttributeValue methods to internal/proto6server (Config/Plan/State)GetAttributeValue functions temporarily to not export existing methods
    
    There are some other planned refactorings in the future for the `internal/proto6server` and `tfsdk` code including:
    
    - Creating a shared implementation for the underlying `Config`/`Plan`/`State` details
    - Creating a `internal/fromproto6` package with protocol version 6 type to framework type conversions
    - Migrating additional framework type to protocol version 6 code to `internal/toproto6`
    - Migrating RPC handling into individual code and test files
    
    These will be handled separately to reduce review burden, as this change was already very large.
    bflad committed Apr 29, 2022
    Copy the full SHA
    3a3be3e View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG for #310

    bflad committed Apr 29, 2022
    Copy the full SHA
    3cc81d4 View commit details
    Browse the repository at this point in the history
  3. internal: Disable staticcheck deprecation warnings on migrated code

    Since the code is now external to the package that declares these as deprecated, staticcheck will raise an issue. This silences those reports, either by denoting that the support is required in the case of Block support, or denoting that the functionality will be removed in the case of ResourceImportStateNotImplemented().
    bflad committed Apr 29, 2022
    Copy the full SHA
    0ae9a76 View commit details
    Browse the repository at this point in the history