-
Notifications
You must be signed in to change notification settings - Fork 1
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
add support for dashboard- and chart-level workflow links #232
Conversation
@@ -471,13 +505,17 @@ func getUnifiedDashboardAttributesFromResource(d *schema.ResourceData) (*client. | |||
eventQueriesSet := d.Get("event_query_ids").(*schema.Set) | |||
eventQueries := buildStringSlice(eventQueriesSet.List()) | |||
|
|||
workflowLinksList := d.Get("workflow_link").([]any) |
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's this whole []any
business? 🧐
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.
type casting with an unexpected shape?
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.
yeah, that d.Get function is getting the list of workflow links from the terraform state -- but all we told terraform is the schema, so it doesnt have a strongly-typed representation of the data
im honestly not totally sure why we traditionally cast to []any
first, and then do a subsequent cast (down here) to get the elements of the array as maps. i think maybe i dont like that pattern and im gonna break it here?? let's see how this goes...
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.
+1 all for seeing how it goes in the face of uncertainty 😆
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.
it did not go great 😂
panic: interface conversion: interface {} is []interface {}, not []map[string]string
i guess go makes you cast in two steps??
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.
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.
e.g.