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

Text from Type description subheadings dropped. #2841

Open
guineveresaenger opened this issue Jan 17, 2025 · 0 comments
Open

Text from Type description subheadings dropped. #2841

guineveresaenger opened this issue Jan 17, 2025 · 0 comments
Labels
area/docsgen Issues with docs capture or example rendering, historically part of pkg/tfgen kind/bug Some behavior is incorrect or out of spec

Comments

@guineveresaenger
Copy link
Contributor

See pulumi/pulumi-aws#4921 as a typical presentation of this issue.

I've copied the summary of what is happening in docsgen from a comment there here:

The reason this information is missing is most likely due to the fact that this NOTE is not attached to the rule documentation text, but rather to the subheading where rule's nested types are explained.
Here's where we're getting the Description for rule:
Image

But the NOTE is actually further down, in the subheading for rule:
Image

I believe this is less of a function of NOTE (although there is some opinionated behavior around NOTEs in the bridge) and more a function of the source of the information not being associated correctly. We never parse top-level text from nested block headings into the type Description.

See also: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function#vpc_config vs https://www.pulumi.com/registry/packages/aws/api-docs/lambda/function/#functionvpcconfig - you notice additionally that in the TF docs many of the the configuration block headers have nice intro paragraphs, none of which show up in the Pulumi docs. I believe that has the same cause.

To fix this for all such occasions, we should either:

  • refactor the parseArgReferenceSection to walk a markdown doc tree instead of parse line-by line, which should make the docsPath robust enough that if we discover descriptions for the same sub-type in two different locations in the document, we can append to the same docsPath type description.
  • find a way to add section-level text to a subheading (this would be more feasible/reasonable if we use the PlainDocsParser approach).
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Jan 17, 2025
@VenelinMartinov VenelinMartinov added kind/bug Some behavior is incorrect or out of spec area/docsgen Issues with docs capture or example rendering, historically part of pkg/tfgen and removed needs-triage Needs attention from the triage team labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docsgen Issues with docs capture or example rendering, historically part of pkg/tfgen kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants