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

deps: Migrate from github.com/hashicorp/terraform to github.com/hashicorp/terraform-plugin-sdk #10253

Closed
wants to merge 3 commits into from

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Sep 26, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Reference: https://www.terraform.io/docs/extend/plugin-sdk.html

Release note for CHANGELOG:

NOTES

* provider: The underlying Terraform codebase dependency for the provider SDK and acceptance testing framework has been migrated from `github.com/hashicorp/terraform` to `github.com/hashicorp/terraform-plugin-sdk`. They are functionality equivalent and this should only impact codebase development to switch imports. For more information see the [Terraform Plugin SDK page in the Extending Terraform documentation](https://www.terraform.io/docs/extend/plugin-sdk.html).

Updated via:

$ tf-sdk-migrator migrate
$ go get github.com/terraform-providers/terraform-provider-tls@v2.1.1+incompatible
$ go get github.com/bflad/tfproviderlint@v0.5.0
$ go mod tidy
$ go mod vendor

I will also take a look at quickly switching bflad/tfproviderlint to the new dependency, which may completely remove hashicorp/terraform from the transitive dependencies as well.

Output from acceptance testing (provided as a smoke test):

--- PASS: TestAccAWSProvider_Region_AwsCommercial (2.85s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (2.85s)
--- PASS: TestAccAWSProvider_Region_AwsChina (2.86s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (3.06s)
--- PASS: TestAccAWSProvider_Endpoints (3.11s)

@bflad bflad added dependencies Used to indicate dependency changes. technical-debt Addresses areas of the codebase that need refactoring or redesign. provider Pertains to the provider itself, rather than any interaction with AWS. labels Sep 26, 2019
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Sep 26, 2019
@bflad bflad marked this pull request as ready for review September 26, 2019 14:39
@bflad bflad requested review from a team and removed request for a team September 26, 2019 14:39
@appilon
Copy link
Contributor

appilon commented Sep 26, 2019

@bflad I'm curious why terraform-provider-tls@v2.1.1+incompatible ? The project has a go.mod.

@bflad
Copy link
Contributor Author

bflad commented Sep 26, 2019

@bflad I'm curious why terraform-provider-tls@v2.1.1+incompatible ? The project has a go.mod.

The code within the project doesn't live under /v2, which is a requirement with Go modules:

$ go get github.com/terraform-providers/terraform-provider-tls@v2.1.1
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1
go get github.com/terraform-providers/terraform-provider-tls@v2.1.1: github.com/terraform-providers/terraform-provider-tls@v2.1.1: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

In fact, updating via Go 1.13 doesn't work at all:

$ go get github.com/terraform-providers/terraform-provider-tls@v2.1.1+incompatible
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
go get github.com/terraform-providers/terraform-provider-tls@v2.1.1+incompatible: github.com/terraform-providers/terraform-provider-tls@v2.1.1+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required

I used Go 1.12 to workaround ☝️ -- another good reason to get off Terraform Providers as codebase dependencies.

@appilon
Copy link
Contributor

appilon commented Sep 26, 2019

Ah yes forgot about that. Well if it compiles then it LGTM

@bflad
Copy link
Contributor Author

bflad commented Sep 27, 2019

Rebasing due to merging #7627 then probably going to just merge this -- it will be a nightmare to keep rebasing.

…corp/terraform-plugin-sdk

Reference: https://www.terraform.io/docs/extend/plugin-sdk.html

Updated via:

```console
$ tf-sdk-migrator migrate
$ go get github.com/terraform-providers/terraform-provider-tls@v2.1.1+incompatible
$ go mod tidy
$ go mod vendor
```

Output from acceptance testing (provided as a smoke test):

```
--- PASS: TestAccAWSProvider_Region_AwsCommercial (2.85s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (2.85s)
--- PASS: TestAccAWSProvider_Region_AwsChina (2.86s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (3.06s)
--- PASS: TestAccAWSProvider_Endpoints (3.11s)
```
…shicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set

Reference: https://www.terraform.io/docs/extend/plugin-sdk.html

Required as part of migrating to the new Terraform Plugin SDK, which changes the import paths from github.com/hashicorp/terraform to github.com/hashicorp/terraform-plugin-sdk.
Reference: https://www.terraform.io/docs/extend/plugin-sdk.html

Updated via:

```console
$ go get github.com/bflad/tfproviderlint@v0.5.0
$ go mod tidy
$ go mod vendor
```
@bflad bflad force-pushed the td-terraform-plugin-sdk-migration branch from a1eacc0 to 834ad01 Compare September 27, 2019 19:54
@nywilken
Copy link
Contributor

Looks like we have a few conflicts that need to be resolved.

@bflad bflad removed this from the v2.31.0 milestone Oct 3, 2019
@bflad
Copy link
Contributor Author

bflad commented Oct 3, 2019

This will be redone after tomorrow's release 👍

@bflad bflad closed this Oct 3, 2019
@bflad bflad deleted the td-terraform-plugin-sdk-migration branch October 3, 2019 02:06
@ghost
Copy link

ghost commented Nov 2, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Used to indicate dependency changes. provider Pertains to the provider itself, rather than any interaction with AWS. size/XXL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants