Skip to content
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

Add option to ignore deprecated resources and data-sources #154

Merged
merged 3 commits into from Jun 28, 2022

Conversation

remilapeyre
Copy link
Contributor

No description provided.

@remilapeyre remilapeyre requested a review from a team as a code owner June 19, 2022 21:52
@jacobbednarz
Copy link
Contributor

i've got no weighing on review of this so take it with a grain of salt however, this seems like an antipattern to be using. if a resource is being deprecated, i would expect the documentation to stick around until it is removed in which case, you can then delete the resource and the documentation goes with it; no need for a new flag.

to help the maintainers, could you elaborate a little on your use case?

@remilapeyre
Copy link
Contributor Author

I'm migrating https://github.com/hashicorp/terraform-provider-consul to use this tool and we have a few resources that have been deprecated for ages but kept to simplify things for users. They have been aliased to the new resources but have not been documented for a long time.

I would like to keep things this way to avoid suddenly adding resources in the doc that have not been used, and to be able to keep things as they were.

I understand that this is quite a specific use case and I'm happy to use a personal fork if this is not accepted.

@jacobbednarz
Copy link
Contributor

gotcha, so it's actually the reverse of what i thought 😅 undocumented resources that you don't want to see in the generated output as opposed to removing them.

Copy link
Contributor

@detro detro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @remilapeyre - thanks for this PR. I think, while nichè, this is a legit scenario that a provider with lots of existing users might want to use.

I think only 2 things are missing here to be merged:

  1. adding an entry to the CHANGELOG describing the new feature
  2. you are not applying the ignore logic to the provider content, last part of the renderMissingDocs method in internal/provider/generate package: https://github.com/hashicorp/terraform-plugin-docs/blob/main/internal/provider/generate.go#L347

Once that is handled, we can probably merge this.

Thank you for this contribution.

@detro
Copy link
Contributor

detro commented Jun 24, 2022

A recent bug-fix PR by @jacobbednarz has gone in, so adding en entry to the CHANGELOG should be a bit easier.

Staying tuned as I'd be keen to release this and the other PR.

@remilapeyre
Copy link
Contributor Author

Hi, I will update this tonight.

@remilapeyre
Copy link
Contributor Author

Hi @detro, I'm not sure what is expected for renderMissingProviderDoc(), neither resources nor data-sources appear there.

@detro
Copy link
Contributor

detro commented Jun 27, 2022

Oh, sorry @remilapeyre - I was probably tired the other day and misread the code.

Yes, there is nothing to add for provider (not like one can deprecate a provider).

But we do still need an entry in the CHANGELOG.

Copy link
Contributor

@detro detro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@detro detro merged commit 044f0f3 into hashicorp:main Jun 28, 2022
@detro
Copy link
Contributor

detro commented Jun 28, 2022

@remilapeyre @jacobbednarz I'll now be working on releasing this.

I'm thinking I should add a print out of a --help command to document what command line option this tool offers now: it's quite substantial.

@detro
Copy link
Contributor

detro commented Jun 28, 2022

And thank you so much to both

@detro detro added this to the v0.10.2 milestone Jun 28, 2022
@detro detro added enhancement New feature or request command/generate labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command/generate enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants