-
Notifications
You must be signed in to change notification settings - Fork 45
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
chore(docs): use default template where possible for Fabric docs #764
Conversation
@equinix/governor-digin-fabric for your reference (and/or review). I noticed that #762 makes changes to the schema but doesn't include the corresponding docs updates because these templates are all currently hard-coded. |
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! However there few golangci-lint errors that we may want to address in a different PR
fbe3d00
to
be2ee47
Compare
5377cdd
to
ca3dd37
Compare
Rather than bypass the required status check, since it's already limited to files that are changed in the PR, I fixed the issues. Took a little more back-and-forth than I would have liked due to linter config. I have a separate PR to adjust linter config here: #766 |
ca3dd37
to
2bc85e0
Compare
--- | ||
|
||
# equinix_fabric_clouder_router (Data Source) |
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.
it rhymes
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.
Aside from some callouts, the move to a fully generated doc brought all-around improvement. Enums and fields that were missed are now documented and will stay documented through schema changes.
subcategory: "Fabric" | ||
description: |- |
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.
Can we add description into the resource definition to get matching markdown results? This is a small description, but we could miss some handy documentation links or greater details if they were specified on other resources (I'll keep an eye out in this review).
I presume the default page_title is as good or better.
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.
The descriptions are in the body, they are not being rendered in the markdown frontmatter.
Is this intended? The first line of non-title markdown body text ends up getting the same treatment as a description frontmatter so it would be redundant to capture it as front-matter?
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.
The description
frontmatter is not used by the registry: https://developer.hashicorp.com/terraform/registry/providers/docs#yaml-frontmatter
The page_title
is used, but based on current page titles in the registry, the value we are specifying in data source and resource pages is equivalent to not specifying that attribute at all.
### Nested Schema for `a_side.access_point` | ||
|
||
Read-Only: | ||
|
||
- `account` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--account)) | ||
- `authentication_key` (String) | ||
- `gateway` (Set of Object, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedobjatt--a_side--access_point--gateway)) |
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.
we lose a documented deprecation flag. Is the field not marked as deprecated? (also in z_side docs)
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.
It is marked appropriately, but because it is a nested field the descriptions and further details aren't picked up by tfplugindocs
. Just the name of the attribute and the type.
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.
Actually, there may be another reason for this. The data_source isn't showing descriptions for any of the nested attributes even though the resource schema displays them. Might be because of the way we're changing attribute behavior to computed and then setting the data_source value.
Resource attributes are showing nested descriptions.
@@ -60,7 +55,7 @@ resource "equinix_fabric_cloud_router" "new_cloud_router"{ | |||
|
|||
- `description` (String) Customer-provided Fabric Cloud Router description | |||
- `href` (String) Fabric Cloud Router URI information | |||
- `order` (Block Set, Min: 1, Max: 1) Order information related to this Fabric Cloud Router (see [below for nested schema](#nestedblock--order)) |
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.
Min:1 will be lost. Not included in spec? Intended? (perhaps the documentation template isn't reflecting it)
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.
Order is optional so it shouldn't have a minimum of 1 anyway. This is intended.
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. Can be shipped.
### Nested Schema for `a_side.access_point` | ||
|
||
Read-Only: | ||
|
||
- `account` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--account)) | ||
- `authentication_key` (String) | ||
- `gateway` (Set of Object, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedobjatt--a_side--access_point--gateway)) |
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.
Actually, there may be another reason for this. The data_source isn't showing descriptions for any of the nested attributes even though the resource schema displays them. Might be because of the way we're changing attribute behavior to computed and then setting the data_source value.
Resource attributes are showing nested descriptions.
@@ -60,7 +55,7 @@ resource "equinix_fabric_cloud_router" "new_cloud_router"{ | |||
|
|||
- `description` (String) Customer-provided Fabric Cloud Router description | |||
- `href` (String) Fabric Cloud Router URI information | |||
- `order` (Block Set, Min: 1, Max: 1) Order information related to this Fabric Cloud Router (see [below for nested schema](#nestedblock--order)) |
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.
Order is optional so it shouldn't have a minimum of 1 anyway. This is intended.
This renames example terraform files in cases where there is exactly one example for a Fabric resource or data source. Renaming these files brings them fully in line with the tfplugindocs conventional paths, which means we no longer need a custom template for each resource or data source.
2bc85e0
to
5f8a46c
Compare
This removes custom templates for some Fabric data sources and resources to avoid missed docs changes due to hard-coded docs templates, which partially addresses #724.
Changes made here are: in cases where there is a single example file,
tfplugindocs