docs icon indicating copy to clipboard operation
docs copied to clipboard

"Import" section unexpectedly at top of page, and often presents incorrect information

Open lukehoban opened this issue 4 years ago • 11 comments

The "Import" section is intended to be at the bottom of resource docs pages, and for most resources it is. However, on https://www.pulumi.com/docs/reference/pkg/docker/service/, the "Import" section is at the top of the page - which looks very out of place. This is true for 2 of the 10 resources in this package.

Screen Shot 2020-12-14 at 9 15 39 AM

lukehoban avatar Dec 14 '20 17:12 lukehoban

Also on https://www.pulumi.com/docs/reference/pkg/aws/ec2/tag/.

This feels pretty important to fix.

lukehoban avatar Feb 25 '21 05:02 lukehoban

Another wonky Docker page at https://www.pulumi.com/docs/reference/pkg/docker/container/, though this one looks like there's some Markdown getting spliced somehow. Screen Shot 2021-09-09 at 2 07 33 PM

nimbinatus avatar Sep 09 '21 19:09 nimbinatus

Another case like this is https://www.pulumi.com/registry/packages/vsphere/api-docs/hostportgroup/#importing, which has this section at the top of the page, but also somehow shows a multi-lang example section with no content instead of an import statement.

Screen Shot 2021-11-16 at 9 40 07 AM

lukehoban avatar Nov 16 '21 17:11 lukehoban

There are also cases where the import section goes missing entirely - like https://www.pulumi.com/registry/packages/vsphere/api-docs/computecluster/.

lukehoban avatar Nov 16 '21 17:11 lukehoban

there seems to be more brokenness on this now broken

susanev avatar Feb 25 '22 16:02 susanev

Seeing the same thing for snowflake.GrantPrivilegesToRole:

image

Checking out the description in the schema:

"description": "{{% examples %}}\n## Example Usage\n### global privileges\n##################################\n\n# list of privileges\nresource \"snowflake_grant_privileges_to_role\" \"g1\" {\n  privileges = [\"MODIFY\", \"USAGE\"]\n  role_name  = snowflake_role.r.name\n  on_account = true\n}\n\n# all privileges + grant option\nresource \"snowflake_grant_privileges_to_role\" \"g2\" {\n  role_name         = snowflake_role.r.name\n  on_account        = true\n  all_privileges    = true\n  with_grant_option = true\n}\n\n##################################\n### account object privileges\n##################################\n\n# list of privileges\nresource \"snowflake_grant_privileges_to_role\" \"g3\" {\n  privileges = [\"CREATE\", \"MONITOR\"]\n  role_name  = snowflake_role.r.name\n  on_account_object {\n    object_type = \"DATABASE\"\n    object_name = snowflake_database.d.name\n  }\n}\n\n# all privileges + grant option\nresource \"snowflake_grant_privileges_to_role\" \"g4\" {\n  role_name = snowflake_role.r.name\n  on_account_object {\n    object_type = \"DATABASE\"\n    object_name = snowflake_database.d.name\n  }\n  all_privileges    = true\n  with_grant_option = true\n}\n\n##################################\n### schema privileges\n##################################\n\n# list of privileges\nresource \"snowflake_grant_privileges_to_role\" \"g5\" {\n  privileges = [\"MODIFY\", \"CREATE TABLE\"]\n  role_name  = snowflake_role.r.name\n  on_schema {\n    schema_name = \"\\\"my_db\\\".\\\"my_schema\\\"\" # note this is a fully qualified name!\n  }\n}\n\n# all privileges + grant option\nresource \"snowflake_grant_privileges_to_role\" \"g6\" {\n  role_name = snowflake_role.r.name\n  on_schema {\n    schema_name = \"\\\"my_db\\\".\\\"my_schema\\\"\" # note this is a fully qualified name!\n  }\n  all_privileges    = true\n  with_grant_option = true\n}\n\n# all schemas in database\nresource \"snowflake_grant_privileges_to_role\" \"g7\" {\n  privileges = [\"MODIFY\", \"CREATE TABLE\"]\n  role_name  = snowflake_role.r.name\n  on_schema {\n    all_schemas_in_database = snowflake_database.d.name\n  }\n}\n\n# future schemas in database\nresource \"snowflake_grant_privileges_to_role\" \"g8\" {\n  privileges = [\"MODIFY\", \"CREATE TABLE\"]\n  role_name  = snowflake_role.r.name\n  on_schema {\n    future_schemas_in_database = snowflake_database.d.name\n  }\n}\n\n##################################\n{{% /examples %}}\n\n## Import\n\nformat is role_name (string) | privileges (comma-delimited string) | all_privileges (bool) |with_grant_option (bool) | on_account (bool) | on_account_object (bool) | on_schema (bool) | on_schema_object (bool) | all (bool) | future (bool) | object_type (string) | object_name (string) | object_type_plural (string) | in_schema (bool) | schema_name (string) | in_database (bool) | database_name (string)\n\n```sh\n $ pulumi import snowflake:index/grantPrivilegesToRole:GrantPrivilegesToRole \"test_role|MANAGE GRANTS,MONITOR USAGE|false|false|true|false|false|false|false|false||||false||false|\"\n```\n\n ",

I noticed a couple of possibly interesting conditions:

  1. There's no description - it just jumps right into examples.
  2. The examples do not render either.

jkodroff avatar Jul 08 '23 19:07 jkodroff

Given this comment:

Closing as dupe of https://github.com/pulumi/docs/issues/4793. Though the problem itself is most likely in tfbridge or docsgen.

Does this ticket need to be transferred to a different repo? Is a separate ticket needed to investigate in docsgen or tfbridge? cc @mikhailshilkov @justinvp

Most of the occurrences here are still an issue.

mnlumi avatar Jul 26 '23 14:07 mnlumi

@mnlumi I think this is the right place for now. If it turns out the issue is something outside the scope of docs rendering, we'll transfer to another repo.

cnunciato avatar Jul 26 '23 21:07 cnunciato

Another one: https://www.pulumi.com/registry/packages/pulumiservice/api-docs/deploymentsettings/

image

jkodroff avatar Aug 29 '23 21:08 jkodroff

Also https://www.pulumi.com/registry/packages/databricks/api-docs/permissions/

mnlumi avatar Sep 08 '23 19:09 mnlumi

Does this ticket need to be transferred to a different repo? Is a separate ticket needed to investigate in docsgen or tfbridge? cc @mikhailshilkov @justinvp

I have a feeling this issue likely resides in the bridge since the content that is rendered on these pages is embedded directly in the description property of that resource in the provider's schema file (and I do see the description beginning with the "Import" section first in these cases). Should this get transferred to the terraform bridge repo perhaps?

sean1588 avatar Sep 13 '23 18:09 sean1588