Hello, one of the recent releases broke 3000 of ou...
# general
g
Hello, one of the recent releases broke 3000 of our stacks https://github.com/pulumi/pulumi/releases/tag/v3.202.0
Copy code
[components/{go,nodejs}] Send component inputs to be saved in state. This brings NodeJS and Go inline with Python behaviour
caused by
Copy code
error: pre-step event returned an error: failed to save snapshot: serializaing checkpoint: marshalling checkpoint: json: unsupported value: +Inf
error: update failed
Copy code
+ snapshotRetentionDays: {
                                  + def      : {
                                      + checks: [
                                      +     [0]: {}
                                        ]
                                      + type  : "number"
                                    }
                                  + format   : <null>
                                  + isFinite : true
                                  + isInt    : false
                                  + maxValue : +Inf
                                  + minValue : 0
                                  + type     : "number"
                                  + ~standard: {
                                      + vendor : "zod"
                                      + version: 1
                                    }
                                }
Copy code
export abstract class LambdaFunction<Def extends config.ServiceDef> extends pulumi.ComponentResource {
  protected readonly rcName: lib.pulumi.ResourceNameFn;

  fn: aws.lambda.Function;
  role: aws.iam.Role;
  rolePolicy: aws.iam.RolePolicy;

  public readonly region: string;
  public readonly observabilityEnvironment: string;
  protected readonly eventInvokeConfig: aws.lambda.FunctionEventInvokeConfig | undefined;
  protected serviceDef: Def;
  protected args: FunctionArgs<Def>;

  protected constructor(
    name: string,
    args: FunctionArgs<Def>,
    opts?: pulumi.ComponentResourceOptions,
    type?: string,
    extras?: BaseExtras
  ) {
    super(type ?? "org:aws:lambda:Function", name, args, opts);
    // ....
  }}
e
I can take a look. I'm guessing that's a +Inf is from a float value?
Ah yeh looks like we never supported infinities in the JSON file. I'd keep on the old version of the nodejs library for now, we'll get an update out to support infinity values.
I'll see about adding an opt-out for the saving state via an envvar or something as well.
g
Here’s more info
Def
contains zod type which has a member of
Copy code
snapshotRetentionDays: z.number().positive(),
e
Yeh +inf won't JSON marshal by itself, I think we can fix that though
g
I am not sure how much information you intend to store in the state but it feels like the more information it contains more complicated it becomes to perform a manual surgery
I wonder if this would be a minimal repro
Copy code
new pulumi.ComponentResource("hello", "world", { stuff: Infinity });
Copy code
new pulumi.ComponentResource("hello", "world", { stuff: Number.MAX_VALUE });
e
yeh that does repro. We want to store as much of the component inputs in state as we can, A) so we can give users a view of how their components are being used B) So we can diff inputs and run update lifecycle hooks at the right time
g
Understood! I love lifecycle hooks, the best addition!
e
Yeh we figured people would like those 😆
g
🙌
e
I'll get the inf in state bug fixed as well. Funny that somehow despite accepting full float values over the wire since forever, apparently no ones ever tried to use inf with a custom resource or python component resource (they're always sent their inputs to the engine)