-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix title and reference links of nested blocks/attributes #56
Conversation
86eb433
to
6240bb7
Compare
@paultyng can we get this merged? The markdown link checker action also triggers on this. |
Wondering if this is also related to #28 |
Hello @zippolyte - thank you so much for this and the patience. I frankly had to do a bit of studying and testing to figure out what it is you were fixing: I wasn't part of the original creators of this, so I was like :head-scratch:-ing hard. Then I found this https://stackoverflow.com/questions/35276022/unexpected-slice-append-behaviour and https://go.dev/play/p/INADVS3Ats. I have also been able to assemble an even weirder example, that shows that this issue with It's likely something with how Go is manipulating the memory created as part of the initial calls to Will be merging this. |
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.
See #56 (comment)
Thank you so much
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
The
path
slice needs to be made a copy of theparents
, otherwise when there is enough nesting, theappend
operation does not do a copy of the slice, and we keep modifying the same reference in the nested blocks, thus generating incorrect titles and links.As an example, you can check https://registry.terraform.io/providers/DataDog/datadog/2.25.0/docs/resources/dashboard#nestedblock--widget--change_definition--request--apm_query, which is the level of nesting things start to go bad. The title shows the wrong
path
, but the anchor ID is still ok at this point.Related issue: DataDog/terraform-provider-datadog#1024