Skip to content
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

merged 1 commit into from Jun 28, 2022


Copy link

@zippolyte zippolyte commented Apr 22, 2021

The path slice needs to be made a copy of the parents, otherwise when there is enough nesting, the append 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, 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

Copy link

hashicorp-cla commented Apr 22, 2021

CLA assistant check
All committers have signed the CLA.

therve approved these changes Apr 22, 2021
Copy link

mavogel commented May 17, 2021

@paultyng can we get this merged? The markdown link checker action also triggers on this.

Copy link

displague commented Jun 21, 2021

Wondering if this is also related to #28

Copy link

detro commented Jun 28, 2022

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 and I have also been able to assemble an even weirder example, that shows that this issue with append() might be a genuine bug with the internal Go implementation:

It's likely something with how Go is manipulating the memory created as part of the initial calls to append() and also what it does when it has to access and print it.

Will be merging this.

detro approved these changes Jun 28, 2022
Copy link

@detro detro left a comment

See #56 (comment)

Thank you so much

@detro detro merged commit cabc562 into hashicorp:main Jun 28, 2022
1 check passed
@detro detro added this to the v0.10.2 milestone Jun 28, 2022
@detro detro added bug Something isn't working go Pull requests that update Go code command/generate labels Jun 28, 2022
@zippolyte zippolyte deleted the hippo/nestedblockspath branch Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug Something isn't working command/generate go Pull requests that update Go code
None yet

Successfully merging this pull request may close these issues.

None yet

6 participants