pulumi / pulumi-terraform-bridge

A library allowing providers built with the Terraform Plugin SDK to be bridged into Pulumi.
Apache License 2.0
183 stars 41 forks source link

Emit upstream Installation instructions #2068

Closed guineveresaenger closed 1 week ago

guineveresaenger commented 2 weeks ago

This pull request is the scaffold implementation of generating installation docs for bridged providers from upstream source.

In this change, a new "language" called registry-docs is added to the bridge. (Note that "language" in this case is a bit of a misnomer - it is the tfgen CLI's input for determining which generating tactic to use - this is why schema is a language as well).

This change reads the upstream index.md file and emits it as a Pulumi package installation instruction file to a top-level folder called docs/ (the current registry standard). We also emit a minimal _index.md file. When these files exist in a provider, the registry will use those instead of the hard coded files existing in the registry currently.

This pull request includes a fair bit of TODOs in the docs parser - currently only the Hugo front matter is implemented, to show the scaffold. Transformations for this document to be Pulumi-friendly will follow in a separate PR.

This change does not affect any current use of the bridge - to flip it on, we'd add another Make target to a provider's Makefile, e.g. ./bin/pulumi-tfgen-openstack registry-docs --out docs/. I'd like us to consider adding this change despite the TODOs, so we can keep the changes somewhat atomic and reduce merge conflicts.

Closes https://github.com/pulumi/pulumi-terraform-bridge/issues/2082.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 19.23077% with 42 lines in your changes missing coverage. Please review.

Project coverage is 61.19%. Comparing base (ba48631) to head (0e694b9). Report is 8 commits behind head on master.

Files Patch % Lines
pkg/tfgen/generate.go 17.85% 22 Missing and 1 partial :warning:
pkg/tfgen/source.go 17.39% 17 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master pulumi/pulumi#2068 +/- ## ========================================== - Coverage 61.57% 61.19% -0.39% ========================================== Files 334 340 +6 Lines 44955 45215 +260 ========================================== - Hits 27681 27668 -13 - Misses 15750 16026 +276 + Partials 1524 1521 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.