pulumi/pkg/codegen/schema
bors[bot] 818d055a77
Merge #11701
11701: Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" r=iwahbe a=AaronFriel

Reverts pulumi/pulumi#11418.

Fixes #11699. The addition of the `ReturnType` field on `schema.FunctionSpec` broke the API contract between Pulumi's codegen package and tfbridge and other tools.

From my comment on #11699.

> I was able to bisect pu/pu to a commit that had the issue, but couldn't reproduce the behavior with a synthetic schema. PR #11418 should be reverted because it introduces the breaking change, and before that PR is reintroduced, the breaking change to the schema should be addressed.
> 
> Notes on root causing:
> 
> Adding an unserialized `ReturnType` field on the `schema.FunctionSpec` type was a breaking change in the API contract with the tfgen bridge and any other tools that generate a PackageSpec directly (without marshaling/unmarshaling) before binding it and calling `GeneratePackage`.
> 
> In [cd6f658](cd6f658d3d) we can see that a regression test fails to catch this case, the generated code is correct and matches the "before" case! That's because the regression tests in Pulumi load schemas from JSON, so the `ReturnType` field is populated. That occurs in the implementation of `unmarshalFunctionSpec` at line 1656:
> 
> 78c9bf4ee4/pkg/codegen/schema/schema.go (L1649-L1658)
> 
> This function in the bridge is unaware of the new field, and so it only populates `Outputs`.
> 
> 36b10921bf/pkg/tfgen/generate_schema.go (L607-L638)




Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
2022-12-21 10:33:07 +00:00
..
bind.go Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" 2022-12-20 17:47:29 -08:00
docs_parser.go [codegen/schema] Skip processing a line if the block position is greater than the length of the line. (#5002) 2020-07-16 16:59:06 -07:00
docs_renderer.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
docs_test.go Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" 2022-12-20 17:47:29 -08:00
loader.go Account for version when caching schemas 2022-11-11 18:35:56 -08:00
loader_schema_test.go perf: Use a faster check for empty schemas (#10444) 2022-08-19 07:40:59 -07:00
loader_test.go [schema] Faster schema loading via caching alongside plugins (#9686) 2022-06-13 23:27:11 -07:00
mock_pulumi_schema.go Test YAML PCL examples 2022-10-24 10:33:48 -07:00
package_reference.go Add description to PackageReference (#9800) 2022-06-08 12:53:13 -07:00
pulumi.json Merge #11701 2022-12-21 10:33:07 +00:00
schema.go Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" 2022-12-20 17:47:29 -08:00
schema_test.go Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" 2022-12-20 17:47:29 -08:00