pulumi/sdk/go/common/resource
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
..
archive Add asset archive test to conformance tests (#16455) 2024-06-24 14:23:18 +00:00
asset Add asset/archive to conformance tests and fix engine working dir issues (#16100) 2024-05-02 11:32:54 +00:00
config Enable finding Pulumi projects created from Templates (#15056) 2024-01-24 16:47:12 +00:00
plugin Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
sig Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
testing Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
urn rewrite the URN when resources are being moved between projects (#16523) 2024-07-01 17:36:11 +00:00
alias.go [engine] Fix aliasing children 2023-06-14 05:19:17 -07:00
alias_test.go feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
asset.go Add asset archive test to conformance tests (#16455) 2024-06-24 14:23:18 +00:00
asset_test.go Deserialize Assets with their Sig (#16073) 2024-04-26 19:05:50 +00:00
custom_timeouts.go move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
errors.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
mapper_test.go Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
properties.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
properties_diff.go A property.Value implementation to replace resource.PropertyValue (#15145) 2024-03-14 19:58:59 +00:00
properties_diff_test.go Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
properties_path.go Fix panics due to different length `ignoreChanges` arrays (#16742) 2024-07-22 14:54:37 +00:00
properties_path_test.go Fix panics due to different length `ignoreChanges` arrays (#16742) 2024-07-22 14:54:37 +00:00
properties_test.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
property_compatibility.go Property map keys are just strings (#15767) 2024-03-25 17:26:41 +00:00
property_compatibility_test.go A property.Value implementation to replace resource.PropertyValue (#15145) 2024-03-14 19:58:59 +00:00
resource_goal.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
resource_id.go sdk/go: Prefer contract.Assertf over Assert 2023-02-15 10:22:43 -08:00
resource_id_test.go Use EqualError/ErrorContains instead of Error (#14737) 2023-12-08 06:40:14 +00:00
resource_operation.go move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
resource_state.go Change `pulumi refresh` to report diff relative to desired state instead of relative to only output changes (#16146) 2024-06-12 16:17:05 +00:00
stack.go Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
status.go move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
urn.go Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00