-
Notifications
You must be signed in to change notification settings - Fork 35
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
SUP-1996: Fix infinite drift with Team Description #531
Conversation
… as a String and match GraphQL response when attribute not set
…hing GraphQL response values when not configured
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.
I'm not sure I covered this in our pairing but it does look like you've done the right thing. But just to confirm, did you modify the .graphql file and then run make generate
? We shouldn't touch the generated.go file as that is handled by the genqlient library for us based on all the .graphql files
Otherwise, I think this approach looks okay. So it will change behaviour to add in a default for the description that is an empty string. That should stop the drift as it will always be defined in that case.
However, this will cause all customers who upgrade to get a plan with lots of updates (I think). We should check to confirm that and should try to avoid that where possible as terraform output is already verbose enough, and this type of an output is kind of redundant really.
I'm not sure if you tried it, but I think there is a way for the provider to detect the difference between specified and null and not specified at all. If we can hook into that, we should be able to handle the API returning empty strings instead of null and basically ignore it (not put it into state). I think with this approach, the upgrade wont cause diffs for users
Maybe a little clearer: If the provider detects that a user has specified And for the opposite where description is omitted from the tf resource, the API would do the same thing and return |
Yeah I did, only committing the specific changes related for this PR though after running
Tested this locally using a Team Resource that was previously defined and had
I have been looking into this as well as noticed there was other Resources that used the |
@tomowatt okay awesome - very thorough! |
GraphQL Responses for Team Resources include the
description
, when it is not set it will be returned asdescription: ""
, currently there is no set a default value when the attribute is not set, so in State it will benil
and when compared for a Plan, will result in a infinite drift for the Team Resource.