pulumi / pulumi-terraform-bridge

A library allowing Terraform providers to be bridged into Pulumi.
Apache License 2.0
192 stars 45 forks source link

Revisit patchProposedNewForUnknownBlocks #2247

Open t0yv0 opened 1 month ago

t0yv0 commented 1 month ago

2060 introduced a patch (patchProposedNewForUnknownBlocks) to objchange.ProposedNew algorithm vendored from OpenTOFU. This patch solves a usability issue with planning bridged provider update changes, specifically confirmed for sets with unknown elements. There are however some residual concerns whether this is the right fix. We should investigate if we can accomplished the desired goals in a way not involving patching.

Concerns:

Alternatives:

References:

VenelinMartinov commented 1 month ago

I think this was not limited to sets - a few other test cases also had failures around https://github.com/pulumi/pulumi-terraform-bridge/blob/da2282374d3b7fb2227e526d2ecede9db7b8c03b/pkg/tests/schema_pulumi_test.go#L880

In pulumi we can have unknown objects, without the containing collection being unknown - it HCL this is perhaps not expressible (at least I have not found a way to express this) - we were not representing these diffs correctly before the patch and not showing a diff at all there.

t0yv0 commented 1 month ago

I'm still concerned it's possible to write a provider that would panic under Pulumi with this but not under TF, but we can keep this around for a bit until we find a real example.