Skip to content

DocsEdit Path does not take upstream file path #3154

@guineveresaenger

Description

@guineveresaenger

What happened?

Let's say we're creating a new DocsEdit rule:

func skipExamplesSection(path string) tfbridge.DocsEdit {
	return tfbridge.DocsEdit{
		Path: path,
		Edit: func(_ string, content []byte) ([]byte, error) {
			return tfgen.SkipSectionByHeaderContent(content, func(headerText string) bool {
				return headerText == "Example Usage"
			})
		},
	}
}

If a resource's upstream doc file is called fantastic_service.html.markdown and it lives in a r folder for "resources", and a data source's upstream doc file is also called fantastic_service.html.markdown, if in our example we set path to r/fantastic_service.html.markdown, the DocsEdit logic ignores the first part of the path, and affects both the resource and the data source files.

TL;DR: There's no way to specify the upstream folder location for a filename, and if there are two filenames (one in the r folder and one in the d folder) that are equal, both files will be affected.

Example

pulumi/pulumi-alicloud#1045 shows that adding such a docs rule removes a section from both the resource and the data source.

Output of pulumi about

n/a

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSome behavior is incorrect or out of spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions