pulumi
pulumi copied to clipboard
feat(codegen/python): Generate config getters with optional default arguments
Description
Fixes #10268
Modifies the existing python codegen logic to support the new pulumi.Config.get optional default arguments. This should result in simpler looking python code when providing a default value.
Note: this PR requires https://github.com/pulumi/pulumi/pull/10344 to be merged first, otherwise we will generate invalid python from the SDK's perspective.
Checklist
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have updated the CHANGELOG-PENDING file with my change
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
Please view the results of the Downstream Codegen Tests Here
Please view the results of the Downstream Codegen Tests Here
Please view the results of the Downstream Codegen Tests Here
This will mean that newly generated SDKs won't work with older versions of the Pulumi SDK, and thus moving to a new version of an SDK will be a breaking change. I don't know if we are ok with this.
CC @mikhailshilkov
The feature implementation itself looks good.
Please view the results of the Downstream Codegen Tests Here
Please view the results of the Downstream Codegen Tests Here
@iwahbe Moving to a new version of the SDK should be non-breaking, since the old function signature is compatible with the new. This does mean that generating new python code will require moving to the new SDK, however.