-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Fix error reading remote workspace with version constraint #36356
Fix error reading remote workspace with version constraint #36356
Conversation
dc706ad
to
8323e45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋🏻 Hi Shweta! I think this PR looks good, though I've not worked on the cloud/remote backends before so needed to dig in a little.
I believe before your PR users would see a "Malformed version"
error if the workspace's Terraform version is a version constraint string, and after your PR's fixes users will only get an error if their Terraform version doesn't match the version constraint ("Terraform version mismatch"
).
Could you please add a new test case to cover this scenario? E.g. you could set the workspace's Terraform version to something like ">= 9.9.9" and assert about the error string in TestRemote_VerifyWorkspaceTerraformVersion_workspaceErrors
. However if I've overlooked existing test coverage for the problem this PR is fixing please let me know.
Also, could you please resolve the CLA issue mentioned on the PR? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test! There's an edit required in the change file, but once that's done I'm happy to approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work! 😄
@SarahFrench's initial suggestion was fantastic. I think we can further improve our tests to make sure we have all our bases covered.
Co-authored-by: Sebastian Rivera <[email protected]>
…github.com/hashicorp/terraform into shwetamurali/TF-21401_workspace_constraint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments as I saw you'd pushed more work.
Once you're ready for review again please let me know by re-requesting review via the GitHub UI 🙇🏻
Co-authored-by: Sebastian Rivera <[email protected]>
Implementing the functionality that exists in cloud backend to remote as well to avoid errors on certain terraform commands when a version constraint is present.
CHANGELOG entry