pulumi/pkg/backend
Fraser Waters c7ed4024ff Support for integers on the wire and state protocol
An exploration into how we could support int64 as well as float64 as a
first class type in Pulumi.

There's some inherit trickiness with this because we use JSON in a few
places, state files most obviously but `PropertyValue` on the wire is
using the protobuf `Struct` and `Value` types which are just mappings to
JSON as well.

JSON doesn't have an int64 type, and while the Go JSON marshaller can
read/write int64s it's not a great behaviour to rely on given mixed
support for that across languages. Further the protobuf `Value` type
only supports float64s.

So we support integers similar to our other special types (like assets)
and wrap them in an object with a special signature field. The value
itself is either a number (if it can safely roundtrip to float64 and
back again) or a string.

Providers, SDKs and the engine communicate support for integers via
`AcceptsIntegers` fields in their interfaces (or similar). When
transmitting to a peer that doesn't support integers (e.g. an old SDK,
or old provider) all integer values are mapped back to standard number
values.

As this changes the serialisation of property values in the state file
it will trigger errors if old engines try to load a state file
containing integers.
2024-08-23 13:36:45 +01:00
..
display Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
diy Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
filestate Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
httpstate Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
state [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
apply.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
apply_test.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
backend.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
backend_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
cancellation_scope.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
inmemoryPersister.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
mock.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
policypack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
query.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
snapshot.go [snapshot] Elide writes for RRO with no changes (#15976) 2024-04-18 22:09:08 +00:00
snapshot_test.go Remove `Step.Apply`'s `preview` parameter (#16367) 2024-06-14 10:19:13 +00:00
stack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
updates.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
watch.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00