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
[codegen] Invalid default of type int for integer property #6469
Labels
area/codegen
SDK-gen, program-gen, convert
impact/panic
This bug represents a panic or unexpected crash
kind/bug
Some behavior is incorrect or out of spec
resolution/fixed
This issue was fixed
Milestone
Comments
mikhailshilkov
added
kind/bug
Some behavior is incorrect or out of spec
area/codegen
SDK-gen, program-gen, convert
labels
Mar 4, 2021
infin8x
added
impact/panic
This bug represents a panic or unexpected crash
and removed
impact/panic
labels
Jul 10, 2021
mikhailshilkov
removed
the
impact/panic
This bug represents a panic or unexpected crash
label
Jul 27, 2022
This should be fixed not to panic. It really should just be allowed (defaults that are ints). |
dixler
pushed a commit
that referenced
this issue
Jul 26, 2023
6 tasks
dixler
pushed a commit
that referenced
this issue
Jul 26, 2023
bors bot
added a commit
that referenced
this issue
Jul 26, 2023
13584: [sdkgen/python] SDKgen on external enums r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #12695 Python SDKGen was not correctly referencing external enum types which needed an import alias. ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> 13599: [codegen] Fix bug in provider schema where default int properties could not be int r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #6469 From the issue: The following type definition ```json "myprovider:index:ResourceSignal": { "properties": { "Count": { "type": "integer", "default": 1 }, "Timeout": { "type": "string", "default": "PT5M" } }, "type": "object" } ``` causes an error during schema import ``` panic: error importing schema: binding types: failed to bind type myprovider:index:ResourceSignal: error binding default value for property "Count": invalid default of type int for integer property ``` Apparently, we only allow floats as defaults here. Changing to `1.0` makes the error go away. ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Kyle Dixler <kyle@pulumi.com>
bors bot
added a commit
that referenced
this issue
Jul 27, 2023
13599: [codegen] Fix bug in provider schema where default int properties could not be int r=dixler a=dixler <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes #6469 From the issue: The following type definition ```json "myprovider:index:ResourceSignal": { "properties": { "Count": { "type": "integer", "default": 1 }, "Timeout": { "type": "string", "default": "PT5M" } }, "type": "object" } ``` causes an error during schema import ``` panic: error importing schema: binding types: failed to bind type myprovider:index:ResourceSignal: error binding default value for property "Count": invalid default of type int for integer property ``` Apparently, we only allow floats as defaults here. Changing to `1.0` makes the error go away. ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [x] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: Kyle Dixler <kyle@pulumi.com>
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
impact/panic
This bug represents a panic or unexpected crash
kind/bug
Some behavior is incorrect or out of spec
resolution/fixed
This issue was fixed
The following type definition
causes an error during schema import
Apparently, we only allow floats as defaults here. Changing to
1.0
makes the error go away.The text was updated successfully, but these errors were encountered: