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

Migrate internal/testing/types package to internal/testtypes package #724

Closed
bflad opened this issue Apr 12, 2023 · 1 comment · Fixed by #773
Closed

Migrate internal/testing/types package to internal/testtypes package #724

bflad opened this issue Apr 12, 2023 · 1 comment · Fixed by #773
Assignees
Labels
tech-debt Issues tracking technical debt that we're carrying. types Issues and pull requests about our types abstraction and implementations.

Comments

@bflad
Copy link
Contributor

bflad commented Apr 12, 2023

Module version

v1.2.0

Use-cases

The framework includes some test value types in the internal/testing/types package. However since the import name matches the exported value types in the types package, most usages need to use an import alias:

import (
  // ...
  testtypes "github.com/hashicorp/terraform-plugin-framework/internal/testing/types"
  // ...
)

This also confuses the Go language server and automatic editor suggestions to add the test types import since the package information cannot be determined by typing types... or testtypes....

Proposal

git mv internal/testing/types internal/testtypes and replace package types in internal/testtypes files with package testtypes. Replace any testtypes "github.com/hashicorp/terraform-plugin-framework/internal/testing/types" imports with "github.com/hashicorp/terraform-plugin-framework/internal/testtypes".

@bflad bflad added tech-debt Issues tracking technical debt that we're carrying. types Issues and pull requests about our types abstraction and implementations. labels Apr 12, 2023
@bflad bflad self-assigned this Jun 14, 2023
bflad added a commit that referenced this issue Jun 14, 2023
… collisions

Reference: #724

This was a mechanical migration consisting of the following steps:

- `git mv internal/testing/types internal/testing/testtypes`
- In `internal/testing/testtypes`, replace `package types` with `package testtypes`
- Replace `testtypes "github.com/hashicorp/terraform-plugin-framework/internal/testing/types"` with `"github.com/hashicorp/terraform-plugin-framework/internal/testing/testtypes"`

Other than removing the import aliasing, this now enables the Go language server to automatically suggest and import when typing `testtypes.`.
bflad added a commit that referenced this issue Jun 14, 2023
… collisions (#773)

Reference: #724

This was a mechanical migration consisting of the following steps:

- `git mv internal/testing/types internal/testing/testtypes`
- In `internal/testing/testtypes`, replace `package types` with `package testtypes`
- Replace `testtypes "github.com/hashicorp/terraform-plugin-framework/internal/testing/types"` with `"github.com/hashicorp/terraform-plugin-framework/internal/testing/testtypes"`

Other than removing the import aliasing, this now enables the Go language server to automatically suggest and import when typing `testtypes.`.
@github-actions
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 Jul 15, 2023
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. types Issues and pull requests about our types abstraction and implementations.
Projects
None yet
1 participant