pulumi/pkg/engine/lifecycletest
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
..
testdata Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
alias_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
analyzer_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
continue_on_error_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
delete_before_replace_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
golang_sdk_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
import_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
integers_test.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
parameterized_test.go Ensure internal provider state doesn't clash with user config (#16837) 2024-07-30 12:22:32 +00:00
pending_delete_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
pending_replace_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
provider_test.go Ensure internal provider state doesn't clash with user config (#16837) 2024-07-30 12:22:32 +00:00
pulumi_test.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
refresh_legacy_diff_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
refresh_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
resource_reference_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
retain_on_delete_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
source_query_test.go Add parameterized `Call` support to the engine (#16813) 2024-07-26 15:36:53 +00:00
step_generator_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
target_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
test_plan.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
transformation_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
update_plan_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00