crossplane / terrajet

Generate Crossplane Providers from any Terraform Provider
https://crossplane.io
Apache License 2.0
290 stars 38 forks source link

Figure out how to get CRD documentation from Terraform #92

Open muvaf opened 2 years ago

muvaf commented 2 years ago

What problem are you facing?

Currently fields don't have any documentation since most of TF providers do not fill Description field of the Schema objects.

How could Terrajet help solve your problem?

We should investigate how https://registry.terraform.io/providers/hashicorp/aws/latest/docs and other docs are produced and see how we can add description comments to generated fields.

negz commented 2 years ago

https://github.com/crossplane-contrib/provider-jet-gcp/blob/release-0.1-preview/apis/cloudplatform/v1alpha1/zz_project_types.go

It seems like in some cases we do have this - I just noticed provider-jet-gcp seems to. Is this because they fill the Description when others don't?

On a related note, I was coming here to report that sometimes this commentary is misleading. For example at: https://doc.crds.dev/github.com/crossplane-contrib/provider-jet-gcp/cloudplatform.gcp.jet.crossplane.io/Project/v1alpha1@v0.1.0-preview

The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.

I don't think we'll actually recreate a new project as this documentation states.

turkenh commented 2 years ago

Just came across this issue and I think I've found where terraform documentation for provider resources are coming from:

All content seems to be living as markdown files under webside/docs in each provider repo:

https://github.com/hashicorp/terraform-provider-aws/tree/main/website/docs https://github.com/hashicorp/terraform-provider-google/tree/master/website/docs https://github.com/hashicorp/terraform-provider-azurerm/tree/main/website/docs

For example, documentation for aws_instance is here: https://github.com/hashicorp/terraform-provider-aws/blob/main/website/docs/r/instance.html.markdown

muvaf commented 2 years ago

I just noticed provider-jet-gcp seems to. Is this because they fill the Description when others don't?

@negz Yes, that's the case. GCP fills Description while AWS doesn't.

I don't think we'll actually recreate a new project as this documentation states.

Here is the fix https://github.com/crossplane-contrib/provider-jet-gcp/pull/10

ulucinar commented 2 years ago

A relevant proposal's reference: https://github.com/crossplane/crossplane/pull/2956

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.