pulumi/pkg
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
..
asset Move some asset code to pkg (#15162) 2024-01-17 11:30:37 +00:00
authhelpers Add tests for gcpauth pkg (#13926) 2023-09-13 11:27:03 +00:00
backend Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
cmd/pulumi Centralise human-friendly error handling in the CLI (#17046) 2024-08-23 08:48:42 +00:00
codegen Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
display Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
engine Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
graph Adds a flag to graph command to insert fragment (#14858) 2024-01-08 22:03:08 +00:00
importer Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
operations Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
resource Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
secrets state_move: include stack name in the passhprase prompt (#16861) 2024-08-02 10:59:12 +00:00
testing/integration Add NodeJS test for parameterized providers #2 (#16901) 2024-08-09 08:34:29 +00:00
util [cli/plugin] Fix plugin install command when plugin type is tool (#16407) 2024-06-17 13:25:57 +00:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
workspace Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +00:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod [pkg] Update `github.com/pgavlin/text` (#17041) 2024-08-21 20:59:24 +00:00
go.sum [pkg] Update `github.com/pgavlin/text` (#17041) 2024-08-21 20:59:24 +00:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.