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

Ensure package generation for Go SDKs doesn't panic when encountering overly nested arrays or maps of primitive types #15680

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

Zaid-Ajaj
Copy link
Contributor

Description

Fixes #15478 where sdk-gen should no longer panic when encountering overly nested arrays or maps of primitive types. The generated code still fails to compile but validation can be added later to cover cases where we are missing primitives in the core SDK to handle overly nested type definitions.

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@Zaid-Ajaj Zaid-Ajaj added language/go area/codegen SDK-gen, program-gen, convert labels Mar 13, 2024
@Zaid-Ajaj Zaid-Ajaj requested a review from a team as a code owner March 13, 2024 23:58
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2024-03-14)

Bug Fixes

  • [sdkgen/go] Ensure package generation for Go doesn't panic when encountering overly nested arrays or maps of primitive types
    #15680

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

LGTM

Directory: "regress-go-15478",
Description: "Regress pulumi/pulumi#15478 affecting Go ensuring SDK-gen doesn't panic",
Skip: allLanguages.Except("go/any"),
SkipCompileCheck: codegen.NewStringSet(golang),
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a comment here? We're deliberately skipping right now because we don't expect it to be able to compile due to missing deeply nested container types in the core Go SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment ✅

}
}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

should probably add map/map/map as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ✅

github-merge-queue bot pushed a commit that referenced this pull request Mar 15, 2024
Tentative changelog:

### Features

- [auto/go] Support remote deployment executor image
  [#15697](#15697)


### Bug Fixes

- [sdkgen/go] Ensure package generation for Go doesn't panic when
encountering overly nested arrays or maps of primitive types
  [#15680](#15680)
@tgummerer tgummerer mentioned this pull request Mar 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 15, 2024
### Features

- [auto/go] Support remote deployment executor image
  [#15697](#15697)


### Bug Fixes

- [engine] Test and fix the engine filling in property dependencies to
provider constructs
  [#15675](#15675)

- [sdkgen/go] Ensure package generation for Go doesn't panic when
encountering overly nested arrays or maps of primitive types
  [#15680](#15680)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen SDK-gen, program-gen, convert language/go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go codegen panics for type Map<Array<string>>
4 participants