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

generate: move configuration to flags #95

Merged
merged 8 commits into from Jun 1, 2022

Conversation

jacobbednarz
Copy link
Contributor

This updates all the directory and provider configuration that was
previously hardcoded to now be controlled by flags.

Majority of the flags are self explanatory (however I would like some help on
wordsmithing better descriptions) but one that stands out is the difference
between provider-name and rendered-provider-name. Within the code, these
were previously the same value however I have a use case where the provider is
registered as "cloudflare" but we want the documentation to capitalise the "C".
I didn't make it as naive as "just capitalise the provider name" as I know folks
like GitHub who would hate having "Github" 😉 So, provider-name is used
when looking for the binary and schema and rendered-provider-name for when we
are outputting it to the CLI or documentation. If rendered-provider-name is
empty, then we just assume provider-name is fine to output.

Closes #92

@hashicorp-cla
Copy link

hashicorp-cla commented Nov 2, 2021

CLA assistant check
All committers have signed the CLA.

@dominik-lekse
Copy link

Found this helpful for my use case. Had to resolve conflicts with recent main branch.

In case it helps getting this PR merged, you find the rebased version of the PR branch at https://github.com/dominik-lekse/terraform-plugin-docs/tree/config-as-flags

@jacobbednarz
Copy link
Contributor Author

thanks @dominik-lekse; i've cherry picked your changes into this branch so if we get some eyes on this, we can merge it in. appreciate it.

@jacobbednarz
Copy link
Contributor Author

jacobbednarz commented May 6, 2022

@detro i've just confirmed this is still working with the latest patches and merges. is this something i can get on someone's radar for review? if Hashicorp still isn't reviewing changes, that's fine and if that is the case, I'll stop spending my effort on keeping this in sync and just go a full fork instead.

@detro
Copy link
Contributor

detro commented May 31, 2022

Hey @jacobbednarz , sorry for the delay.

I have just taken a quick look and I think I like where this is going. But given the current state of testing in this repo, I might need to manually run some example tests to verify the current behaviour is not broken.

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.

So, I think this is looking good. I wish we had time to stop and write some proper regression testing, so that contributions could be more easily handled.

This "parametrization" is very welcome, so thank you for taking the time and the care.

Before we can proceed, could you please add to the CHANGELOG a section for 0.9.0 and a NEW FEATURES entry, describing your work succinctly?

internal/cmd/generate.go Outdated Show resolved Hide resolved
@jacobbednarz
Copy link
Contributor Author

thanks @detro; I've gone ahead and added the CHANGELOG entry for this change.

totally agree on the testing really lacking here as i had the same issue locally. i didn't end up pursuing it as the testing story in this repository is largely unit test based and this would require more integration in parts which i wasn't sure on the approach we'd like here. happy to go back and retrofit some tests onto that if we have a path forward though.

detro
detro previously approved these changes Jun 1, 2022
jacobbednarz and others added 7 commits June 1, 2022 11:21
This updates all the directory and provider configuration that was
previously hardcoded to now be controlled by flags.

Closes hashicorp#92
Co-authored-by: Ivan De Marino <ivan.de.marino@gmail.com>
@detro
Copy link
Contributor

detro commented Jun 1, 2022

Rebasing this was painful :(

Personal advice: never merge from main, always git fetch origin && git rebase origin/main.

@detro detro merged commit ed20132 into hashicorp:main Jun 1, 2022
@detro detro self-assigned this Jun 1, 2022
@jacobbednarz jacobbednarz deleted the config-as-flags branch June 1, 2022 10:53
@jacobbednarz
Copy link
Contributor Author

👏👏👏 thanks for getting this one over the line @detro, you rock!

jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Jun 3, 2022
the PR (hashicorp/terraform-plugin-docs#95) for the customisation we
needed landed so we can go back to the mainline version now.
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Jun 3, 2022
the PR (hashicorp/terraform-plugin-docs#95) for the customisation we
needed landed so we can go back to the mainline version now.
jacobbednarz added a commit to cloudflare/terraform-provider-cloudflare that referenced this pull request Jun 3, 2022
the PR (hashicorp/terraform-plugin-docs#95) for the customisation we
needed landed so we can go back to the mainline version now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support flag for providing the name of the provider
4 participants