pulumi/pkg/codegen/schema
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
..
bind.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
docs_parser.go golangci-lint: Enable staticcheck 2023-01-14 16:59:46 -08:00
docs_renderer.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
docs_test.go Actually disable plugin acquisition (#14134) 2023-10-14 08:32:43 +00:00
loader.go Refactor MissingError handling (#16689) 2024-07-18 08:33:09 +00:00
loader_client.go Add matrix testing (#13705) 2023-09-13 15:17:46 +00:00
loader_js.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
loader_mmap.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
loader_schema_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
loader_server.go Add schema loader service 2023-07-27 15:03:52 +01:00
loader_test.go all: Don't use cmdutil.Diag in tests 2023-03-13 12:54:04 -07:00
mock_pulumi_schema.go Fix incorrect YAML type checking of StackReference outputs (#16625) 2024-07-11 14:17:41 +00:00
package_reference.go Use publisher and repository fields to default the Go import path (#16899) 2024-08-07 21:02:07 +00:00
pulumi.json Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
schema.go Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
schema_test.go Ensure internal provider state doesn't clash with user config (#16837) 2024-07-30 12:22:32 +00:00