-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Strip Provider Prefix from File Names during Migration #349
Conversation
… short name prefix during migration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Non-blocking: Should terraform-plugin-docs/internal/provider/generate.go Lines 162 to 164 in 836a890
I think if |
@bflad Good shout! I completely forgot about the provider directory name. I've updated the code to use it as a default, and tweaked the documentation to make it clear that the prefixes are removed by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚀
Co-authored-by: Brian Flad <bflad417@gmail.com>
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Closes: #347
Supersedes: #348
Fixes a bug that is encountered when the
migrate
command andgenerate
command are run on provider documentation that have provider short name prefixes in their filenames (ex.time_rotating.md
). Themigrate
command would move the files to the template folder as-is but thegenerate
command does not recognize these files as valid documentation files because of the prefix, and therefore generates default template for the "missing" resource/data-sources, resulting in duplicate templates. This PR resolves this by introducing a--provider-name
flag to themigrate
subcommand, and uses the provided value to derive the provider short name and strips the prefix from an file name containing it.The
--provider-name
flag is optional for users who do not have the provider prefix in their file names, so they can continue to run themigrate
command without any flags, if the defaults are appropriate.