-
Notifications
You must be signed in to change notification settings - Fork 14
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
Skip unknowns in Check to avoid panic when marshalling Build object #575
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Is there a test we could add for this case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will line 121 do if build
is an unknown?
On line 179 we check if input["build"]
is null. Will that work (not panic)? Will that do the wrong thing because inputs
is actually unknown, not null?
It's good to fix the bug in any way we can for now! (if we can add a test). Thinking forward, is there a chance that this is actually a platform issue? As I've attempted in #435 it feels like there should be a way to code against a higher-level interface that hydrates a Go struct with appropriate err msgs, and concerns such as |
All good questions! @mikhailshilkov I am completely open to suggestion here, but as this is SDK behavior, testing it here feels redundant at best and incorrect at worst. @iwahbe - if we set @t0yv0 - I chatted with @Frassle about it this morning, and in the panic situation, the Build object becomes flattened during Check(), meaning if any one sub-field is Unknown, the entire object is Unknown. This does mean we lose access to any fields that were set! However, for this use case, we don't actually need access to those fields since we're setting defaults. |
@guineveresaenger #565 has a repro so a baseline test could be exercising that repro in one of our end-to-end tests. I don't know if there is a lower-level test that would still make sense. Unit test |
@mikhailshilkov - ah, an integration test makes a lot more sense to me. Added! |
Does the PR have any schema changes?Looking good! No breaking changes found. |
I meant "What will this do if build is genuinely unknown. I understand the provider won't get a |
@iwahbe - gotcha! This doesn't show up because it's in a different file, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test!
When we try to access a Build object which contains unknown values in the Check() function, the provider panics, because the Build object is not of the correct resource type.
This pull request ignores unknowns when reading inputs in Check(), allowing for the resulting object to be processed correctly.
Fixes #565.