Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs"" #11753

Merged
merged 1 commit into from Jan 12, 2023

Conversation

Zaid-Ajaj
Copy link
Contributor

Reverts #11701 and fixes the problem which caused the issue in the first place:

  • Binding Outputs field from FunctionSpec into Function.ReturnType when available
  • Adding a test that verifies the above works as expected

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Jan 2, 2023

Changelog

[uncommitted] (2023-01-11)

Features

  • [sdkgen/{dotnet,nodejs}] Initial implementation of simplified invokes for dotnet and nodejs.
    #11753

@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch 2 times, most recently from 01dd25d to d0813e6 Compare January 2, 2023 23:45
@Zaid-Ajaj Zaid-Ajaj marked this pull request as ready for review January 3, 2023 00:20
@iwahbe
Copy link
Member

iwahbe commented Jan 9, 2023

@Zaid-Ajaj Can you highlight the difference between #11418 and #11753? Are the only changes in schema.go?

// indicates a logical bug in our marshaling code.
return nil, diags, fmt.Errorf("error binding outputs for function %v: invalid return type", token)
}
} else if spec.Outputs != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iwahbe This check here is the main difference. This is the new code block

if spec.ReturnType != nil && spec.Outputs == nil {
  // bind from return type
} else if spec.Outputs != nil { 
  // bind from spec.Outputs
}

whereas before it was only:

if spec.ReturnType != nil  {
  // bind from return type
}

Which caused the issue that @danielrbradley had where spec.Outputs was specified by code, not through JSON/YAML parsing and didn't bind correctly.

I've also added a test to show that this actually works: Function.ReturnType being bound when FunctionSpec.Outputs is specified.

@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch 2 times, most recently from 8317bd8 to c24fd69 Compare January 9, 2023 23:41
pkg/codegen/schema/schema.go Show resolved Hide resolved
pkg/codegen/schema/bind.go Show resolved Hide resolved
pkg/codegen/schema/pulumi.json Outdated Show resolved Hide resolved
pkg/codegen/schema/schema.go Outdated Show resolved Hide resolved
pkg/codegen/schema/schema.go Outdated Show resolved Hide resolved
@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch 2 times, most recently from 5e834a9 to e1f5e0a Compare January 10, 2023 20:18
@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch 3 times, most recently from 13280a4 to fe98ef9 Compare January 10, 2023 22:42
@Zaid-Ajaj
Copy link
Contributor Author

bors merge

bors bot added a commit that referenced this pull request Jan 11, 2023
11753: Revert "Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs"" r=Zaid-Ajaj a=Zaid-Ajaj

Reverts #11701 and fixes the problem which caused the issue in the first place:
 - Binding `Outputs` field from `FunctionSpec` into `Function.ReturnType` when available
 - Adding a test that verifies the above works as expected

Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 11, 2023

Build failed:

@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch from fe98ef9 to caadcfe Compare January 11, 2023 21:42
@Zaid-Ajaj Zaid-Ajaj force-pushed the revert-11701-revert-11418-simplified-invoke-gen branch from 0015f84 to 330676a Compare January 11, 2023 22:17
@Zaid-Ajaj
Copy link
Contributor Author

bors merge

bors bot added a commit that referenced this pull request Jan 11, 2023
11753: Revert "Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs"" r=Zaid-Ajaj a=Zaid-Ajaj

Reverts #11701 and fixes the problem which caused the issue in the first place:
 - Binding `Outputs` field from `FunctionSpec` into `Function.ReturnType` when available
 - Adding a test that verifies the above works as expected

Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 12, 2023

Build succeeded:

@bors bors bot merged commit b4dd454 into master Jan 12, 2023
@bors bors bot deleted the revert-11701-revert-11418-simplified-invoke-gen branch January 12, 2023 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants