Open alexhung opened 15 hours ago
When I run tfplugindocs validate --provider-name project
, it fails with the following:
exporting schema from Terraform
compiling provider "project"
using Terraform CLI binary from PATH if available, otherwise downloading latest Terraform CLI binary
running terraform init
getting provider schema
2024/11/13 14:08:43 [DEBUG] Found documentation files [docs/guides/repositories_in_project.md docs/index.md docs/resources/environment.md docs/resources/group.md docs/resources/project.md docs/resources/repository.md docs/resources/role.md docs/resources/share_repository.md docs/resources/share_repository_with_all.md docs/resources/user.md]
running mixed directories check
2024/11/13 14:08:43 [DEBUG] Found directory: docs/guides
2024/11/13 14:08:43 [DEBUG] Found directory: docs
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found directory: docs/resources
running number of files check
2024/11/13 14:08:43 [TRACE] Found 1 documentation files in directory: docs/guides
2024/11/13 14:08:43 [TRACE] Found 8 documentation files in directory: docs/resources
2024/11/13 14:08:43 [DEBUG] Found 9 documentation files with limit of 2000
detected static docs directory, running checks
running invalid directories check on docs/guides
running file checks on docs/guides/repositories_in_project.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/guides/repositories_in_project.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/guides/repositories_in_project.md size: 2447 (limit: 500000)
running file checks on docs/index.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/index.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/index.md size: 9837 (limit: 500000)
running invalid directories check on docs/resources
running file checks on docs/resources/environment.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/environment.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/environment.md size: 1200 (limit: 500000)
running file checks on docs/resources/group.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/group.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/group.md size: 1441 (limit: 500000)
running file checks on docs/resources/project.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/project.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/project.md size: 7627 (limit: 500000)
running file checks on docs/resources/repository.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/repository.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/repository.md size: 1128 (limit: 500000)
running file checks on docs/resources/role.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/role.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/role.md size: 2556 (limit: 500000)
running file checks on docs/resources/share_repository.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/share_repository.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/share_repository.md size: 1609 (limit: 500000)
running file checks on docs/resources/share_repository_with_all.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/share_repository_with_all.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/share_repository_with_all.md size: 1494 (limit: 500000)
running file checks on docs/resources/user.md
2024/11/13 14:08:43 [DEBUG] Checking file: /Users/alexh/Projects/terraform-provider-project/docs/resources/user.md
2024/11/13 14:08:43 [DEBUG] File /Users/alexh/Projects/terraform-provider-project/docs/resources/user.md size: 1676 (limit: 500000)
running file mismatch check
2024/11/13 14:08:43 [DEBUG] Found file environment.md
2024/11/13 14:08:43 [DEBUG] Found file group.md
2024/11/13 14:08:43 [DEBUG] Found file project.md
2024/11/13 14:08:43 [DEBUG] Found extraneous file project.md
2024/11/13 14:08:43 [DEBUG] Found file repository.md
2024/11/13 14:08:43 [DEBUG] Found file role.md
2024/11/13 14:08:43 [DEBUG] Found file share_repository.md
2024/11/13 14:08:43 [DEBUG] Found file share_repository_with_all.md
2024/11/13 14:08:43 [DEBUG] Found file user.md
2024/11/13 14:08:43 [DEBUG] Found resource project
2024/11/13 14:08:43 [DEBUG] Missing file for resource project
2024/11/13 14:08:43 [DEBUG] Found resource project_environment
2024/11/13 14:08:43 [DEBUG] Found resource project_group
2024/11/13 14:08:43 [DEBUG] Found resource project_repository
2024/11/13 14:08:43 [DEBUG] Found resource project_role
2024/11/13 14:08:43 [DEBUG] Found resource project_share_repository
2024/11/13 14:08:43 [DEBUG] Found resource project_share_repository_with_all
2024/11/13 14:08:43 [DEBUG] Found resource project_user
Error executing command: validation errors found:
matching resource for documentation file (project.md) not found, file is extraneous or incorrectly named
missing documentation file for resource: project
Terraform CLI and terraform-plugin-docs Versions
Provider Code
Expected Behavior
Able to generate correct doc files for all other resources when one resource has same name as the provider. In our case, the provider name is
project
and one of the resource name is alsoproject
.Actual Behavior
When
tfplugindocs generate
is executed, all the resource docs are replaced by content from resourceproject
doc.Steps to Reproduce
tfplugindocs generate
. That's all required.How much impact is this issue causing?
High
Logs
https://gist.github.com/alexhung/da5c294048169cef6cd73f026804bdb8
Additional Information
After generating doc, all resource doc files are modified even though none should be updated.
Using
--provider-name
arg has no effect.Code of Conduct