-
Notifications
You must be signed in to change notification settings - Fork 75
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
docs: generate docs from provider schema #1032
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1032 +/- ##
===========================================
- Coverage 66.28% 30.60% -35.68%
===========================================
Files 66 66
Lines 9868 9942 +74
===========================================
- Hits 6541 3043 -3498
- Misses 2612 6859 +4247
+ Partials 715 40 -675
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
4a73c5a
to
c9dfda0
Compare
c9dfda0
to
fb3f552
Compare
I am not sure what we should do with the old documentation that is now duplicate. I could copy the generated docs to the old files. |
fb3f552
to
844a27e
Compare
Registry docsThe Hashicorp & OpenTofu Registry display our docs, how do they react if we store part of the docs in SDK v2As far as I could tell you only updated the docs for resources/datasources that were already moved to plugin framework. Is there some technical limitation why you did not migrate SDKv2 resources? |
844a27e
to
eaf6168
Compare
RegistryOpen tofu seem to support the new directory: https://search.opentofu.org/docs/providers/docs#documentation-structure and the old one, as we already have some docs there: https://search.opentofu.org/provider/opentofu/hcloud/latest/docs/datasources/firewall But I'm not sure if they can coexist. Terraform doesn't document if both website and docs can coexist: https://developer.hashicorp.com/terraform/registry/providers/docs#migrating-legacy-providers-docs According to the plugin docs tool, the website should be removed once the docs has been created: https://github.com/hashicorp/terraform-plugin-docs#migrate-subcommand
SDKv2I thought the terraform plugin docs tool only support the plugin framework, but you are correct, we could migrate the SDKv2 providers to use the docs generation. I am just wondering if this makes sense to do for the SDKv2, or if we prefer to migrate one resource after the other? Doing it in one shot will definitely help for the consistency, but I'm a not sure if I want to copy all those strings twice (docs generation and plugin framework migration). Maybe we can replace the existing website files with the generated files for now, and do a big move once we are done with the plugin migration? I'll think about what is best. |
I thought about this a bit more, and we should migrate the whole website once. And gradually improve each module by replacing the existing static docs with the auto generated templates from the code (provider schema). So this PR is missing the foundation on top of which it can happen. |
eaf6168
to
c6200ee
Compare
c6200ee
to
da8ab04
Compare
da8ab04
to
e5f3432
Compare
This PR is based on top of #1046.
Generating the docs from the schema will give us an additional way of reviewing a provider's arguments, if they are read-only, arguments or attributes.
This also changes the way we refactor resources/data-sources to the plugin framework, the docs should not be moved to a markdown file, but generated from the code instead.