-
Notifications
You must be signed in to change notification settings - Fork 34
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
don't marshal integer values as msgpack floats #396
don't marshal integer values as msgpack floats #396
Conversation
Round-tripping a large integer through a float64, even if the binary representation is exact, causes us to end up with a rounded string representation after decoding, because the decoded number has 52-bit precision instead of the 512 we use when dealing with string representations of large integers.
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.
LGTM, I'll push a changelog to your branch before merging 👍🏻
Note: You'll see me open another PR temporarily with these exact changes because our workflows are currently busted when a PR comes from a fork and don't run our CI tests 🙃
https://github.com/hashicorp/terraform-plugin-go/actions/runs/8740923855?pr=396
All workflows are green over in https://github.com/hashicorp/terraform-plugin-go/actions/runs/8741201175?pr=397 🟢 Thanks for the fix @jbardin! |
* don't marshal integer values as msgpack floats Round-tripping a large integer through a float64, even if the binary representation is exact, causes us to end up with a rounded string representation after decoding, because the decoded number has 52-bit precision instead of the 512 we use when dealing with string representations of large integers. * update CHANGELOG.md * update to changie log --------- Co-authored-by: Austin Valle <[email protected]>
* generate protocol bindings * add protocol bindings to external interface * build(deps): Bump google.golang.org/grpc from 1.63.0 to 1.63.2 (#394) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.63.0 to 1.63.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.63.0...v1.63.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * workflows: Remove wildcard suffix from Terraform workflow call (#395) * don't marshal integer values as msgpack floats (#396) * don't marshal integer values as msgpack floats Round-tripping a large integer through a float64, even if the binary representation is exact, causes us to end up with a rounded string representation after decoding, because the decoded number has 52-bit precision instead of the 512 we use when dealing with string representations of large integers. * update CHANGELOG.md * update to changie log --------- Co-authored-by: Austin Valle <[email protected]> * Update changelog * breaking: update protocol bindings for new client capabilities struct + add configure provider bindings * add Go pkg docs * add copywrite headers * add changelog * split client capabilities per RPC * added logging for req/resp deferred actions * add test for ensuring global variable is updated * add diagnostic for invalid deferred * move helper diag into function * add a separate log for nil client capabilities --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Bardin <[email protected]> Co-authored-by: hc-github-team-tf-provider-devex <[email protected]>
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. |
Round-tripping a large integer through a float64, even if the binary representation is exact, causes us to end up with a rounded string representation after decoding, because the decoded number has 52-bit precision instead of the 512 we use when dealing with string representations of large integers.
The test fixture was changed slightly to compare only the final value string representations, which more closely corresponds to the configuration and state values. The comparison of the
Value
directly will contain differences in the underlyingmath/big
value.This mirrors the upstream change in go-cty here, which will be incorporated into the next version of Terraform, ensuring that the round-trip encoding of values is the same in both directions.
Fixes #391