Upgrade go-tfe from 1.51.0 to 1.58.0#35495
Conversation
9ea5f9a to
a805e6d
Compare
|
go-tfe 1.53.0 includes a change to the mocking framework, so these unit test failures will need to be resolved before merging. |
f5d16b4 to
e8973c7
Compare
835464a to
16af0fa
Compare
jbardin
left a comment
There was a problem hiding this comment.
This changes the mocks for packages unrelated to go-tfe too, but since github.com/golang/mock is now deprecated in favor of go.uber.org/mock I don't see any reason to not change them all at once anyway.
SarahFrench
left a comment
There was a problem hiding this comment.
Approving on behalf of the gcs backend - the acceptance tests pass when I use this branch
jar-b
left a comment
There was a problem hiding this comment.
LGTM 🎉
% TF_ACC=1 go test -count=1 ./...
ok github.com/hashicorp/terraform/internal/backend/remote-state/s3 207.382s|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
* go get github.com/hashicorp/go-tfe@v1.58.0 * Switch to go.uber.org/mock for mocks
|
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 PR bumps the go-tfe dependency in Terraform to v1.58.0, which allows the Terraform
cloudblock to interact with workspaces that have HCP IDs.This requires changing the mock dependency from golang/mock to go.uber.org/mock to maintain compatibility with go-tfe v1.53.0: hashicorp/go-tfe#897
Why?
For Unified HCP Terraform, we create organizations, projects, and workspaces using HCP-generated external IDs (e.g.
terraform.workspace:qjRw3Pbjttz9D73mR7Rzfor a workspace) rather than a prefixed ID format (ws-DEB5Hz2oJM2fXnBs). This allows for greater interoperability between HCP and TFC, and also required relaxing client-side ID validation in the go-tfe library.The go-tfe changes were made here: hashicorp/go-tfe#924 and included in the go-tfe 1.58.0 release.
Because the Terraform
cloudblock uses go-tfe 1.51.0, Terraform is currently unable to read the current state of those workspaces. In the following example,jbonhag-demo-1is a unified organization, anddefault-projectis a unified project synced from HCP.main.tf:
With Terraform 1.9.2:
With proposed change:
Here is where Terraform fetches the state:
terraform/internal/cloud/state.go
Line 411 in a72b48a
And here is where go-tfe performs the subsequent workspace ID validation:
https://github.com/hashicorp/go-tfe/blob/dee5a9cfda19483a7cdf7f6728b70d0e2340168b/state_version.go#L346-L348
Target Release
1.9.3
Draft CHANGELOG entry
ENHANCEMENTS
cloudblock can now interact with workspaces that have HCP resource IDs.