hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Add automated check that Registry pages are well-formed #19828

Open rileykarson opened 1 month ago

rileykarson commented 1 month ago

What kind of contribution is this issue about?

Other (specify in details)

Details

I caught some bad frontmatters recently, which messed up categorization. We could try to prevent that/other similar issues automatically.

From @SarahFrench in https://github.com/GoogleCloudPlatform/magic-modules/pull/11977:

There is the terraform-plugin-docs tool, which has a validate command for validating documentation files:

$ tfplugindocs validate --help

Usage: tfplugindocs validate []

--provider-dir <ARG>       relative or absolute path to the root provider code directory; this will default to the current working directory if not set                                                              
--provider-name <ARG>      provider name, as used in Terraform configurations; defaults to the --provider-dir short name (after removing `terraform-provider-` prefix) 
--providers-schema <ARG>   path to the providers schema JSON file, which contains the output of the terraform providers schema -json command. Setting this flag will skip building the provider and calling Terraform CLI    
--tf-version <ARG>         terraform binary version to download. If not provided, will look for a terraform binary in the local environment. If not found in the environment, will download the latest version of Terraform  

That tool is mainly used for generating documentation, which isn't really relevant for TPG as we generate documentation using the code generator. I think the validate functionality can work for markdown files that weren't generated by the tool, but someone would need to experiment to test that out.

References

No response

rileykarson commented 1 month ago

IMO size/s if the tool works, size/m if it doesn't.