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

Migrate most of remaining docs from old-docs #383

Closed
wants to merge 2 commits into from

Conversation

hamiltont
Copy link
Contributor

This does a basic move on the remaining stuff in old-docs, which (if I'm following the other issues properly) is the way @mrparkers is heading (towards hosting docs on the terraform provider page). This does not break mkdocs at all, so all documentation can continue to be hosted at the current gh-pages site (although any deep links to specific pages would now return a 404). The only thing I didn't update was the index - it seems like perhaps the TODO here is to decide if the new documentation index should have a subsection on how to install for "legacy" users (in quotes because it's not qutie legacy yet until the new provider version is release, as I understand it)

This also add a small but useful utility script, check-docs.sh. It's an unintelligent script that looks for possibly missing documentation files. In looking at solving my own issue #382 I noticed there is already a generic_keycloak_identity_provider_mapper.go with no docs page (not yet sure if it will solve my issue, but nice to know about), and I saw a few other issues where docs just needed some update. As I said, the script is basic, it spits out 10-15 possibilities and expects a human to scan them and weed out false positives. But..it took 5min to write ;-)

Here's the initial output:

$ ./scripts/check-docs.sh
docs/data-sources/keycloak_openid_client_authorization_policy.md does not exist.
docs/data-sources/keycloak_openid_client_service_account_user.md does not exist.
No doc file found automatically for generic_keycloak_identity_provider.go
No doc file found automatically for generic_keycloak_identity_provider_mapper.go
No doc file found automatically for generic_protocol_mapper_helpers.go
No doc file found automatically for generic_resource_policy_import.go
No doc file found automatically for keycloak_policy_helpers.go
No doc file found automatically for misc
No doc file found automatically for provider.go
docs/resources/keycloak_attribute_to_role_identity_provider_mapper.md does not exist.
docs/resources/keycloak_authentication_flow.md does not exist.
docs/resources/keycloak_authentication_subflow.md does not exist.
docs/resources/keycloak_hardcoded_attribute_identity_provider_mapper.md does not exist.
docs/resources/keycloak_hardcoded_role_identity_provider_mapper.md does not exist.
docs/resources/keycloak_ldap_hardcoded_group_mapper.md does not exist.
docs/resources/keycloak_ldap_role_mapper.md does not exist.
docs/resources/keycloak_oidc_google_identity_provider.md does not exist.
docs/resources/keycloak_openid_client_authorization_aggregate_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_client_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_group_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_js_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_permission.md does not exist.
docs/resources/keycloak_openid_client_authorization_resource.md does not exist.
docs/resources/keycloak_openid_client_authorization_role_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_scope.md does not exist.
docs/resources/keycloak_openid_client_authorization_time_policy.md does not exist.
docs/resources/keycloak_openid_client_authorization_user_policy.md does not exist.
docs/resources/keycloak_openid_client_service_account_realm_role.md does not exist.
docs/resources/keycloak_required_action.md does not exist.
docs/resources/keycloak_user_template_importer_identity_provider_mapper.md does not exist.
No doc file found automatically for role_mapping_helpers.go
No doc file found automatically for test_utils.go
No doc file found automatically for utils.go

This is primarily jsut running move on all the files, plus a tiny bit of YAML changes
@mrparkers
Copy link
Owner

hey @hamiltont, thanks for the PR!

unfortunately, there may be a bit of a misunderstanding here. the new format for docs hosted on the terraform registry specifies that the keycloak_ prefix not be included in the file name (https://www.terraform.io/docs/registry/providers/docs.html#directory-structure). so as an example, if you were looking for the doc file for the keycloak_group data source, it would be found within docs/data-sources/group.md.

I was pretty sure that I migrated all of the old docs over, but if you'd like to modify your script to double check that for me, I'd certainly appreciate it!

@hamiltont
Copy link
Contributor Author

@mrparkers Ah, you're right. My apologies, thought I saw a 5-min way to help out. Let me double-check this documentation and I'll update the PR - my main thought was to re-combine the "old-docs" folder into the "docs" folder without breaking anything, so the master of this repo only has one 'docs' folder. FWIW, I do like how effective the simple "look for missing docs" script is. There's definitely a fancier way to do it, but having all the source code filenames match up to the doc filenames made it appealing to just try out a simple search. Was imo effective - turns out you support a lot more identity provider mappers than I had realized!

@mrparkers
Copy link
Owner

Well I appreciate the effort in any case! Perhaps at some point in the future I'll write some script that can run in CI to detect missing docs when new resources / data sources are added. Feel free to reopen this if that is something you'd like to take on.

@mrparkers mrparkers closed this Oct 20, 2020
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.

2 participants