Skip to content

docs: group registry sidebar by subcategory - #426

Open
matifali wants to merge 2 commits into
org-chat-models/default-modelfrom
docs/registry-subcategories
Open

docs: group registry sidebar by subcategory#426
matifali wants to merge 2 commits into
org-chat-models/default-modelfrom
docs/registry-subcategories

Conversation

@matifali

@matifali matifali commented Aug 25, 2026

Copy link
Copy Markdown
Member

Problem

All coderd_* resources and data sources render on the Terraform Registry with an empty subcategory, so the sidebar lists every resource/data source flat with no grouping.

Fix

Add per-resource doc templates under templates/resources/<name>.md.tmpl and templates/data-sources/<name>.md.tmpl (the tfplugindocs conventional paths, matching the pattern used by hashicorp/aws, azurerm, google). Each is a copy of tfplugindocs' default template with a hardcoded subcategory, grouping pages into:

  • Agentsagents_mcp_server, agents_model, agents_system_prompt, agents_default_model
  • AI Governanceai_provider
  • Deploymentlicense, oauth2_provider_settings, provisioner_key, workspace_proxy
  • Identity & Access Managementorganization, organization_group_sync, organization_sync_settings, group, user
  • Templatestemplate

The templates also drop the HasImportIDConfig/HasImportIdentityConfig branches from tfplugindocs' default template: no resource in this repo ships import-by-string-id.tf/import-by-identity.tf example files, so those branches were always-false dead code. Resource templates keep a single HasImport (terraform import) section; data-source templates have no import section (data sources are never imported).

Regenerated docs/ with make gen; the diff against the base branch is exactly the subcategory line per file (19 files), nothing else changed.

Stacking

Stacked on #423 (which stacks on #422). Covers the stack's org-scoped coderd_agents_default_model rename (subcategory: Agents); the base already includes the #425 agents_system_prompt rename.

Note for future resources

With per-resource templates, a new resource/data source added without a matching templates/ file falls back to tfplugindocs' embedded default (subcategory: "") and renders uncategorized at the top of the sidebar. Copy a sibling template and set the right subcategory when adding one.

Testing

  • make build, make fmt, and make gen (idempotent, no drift) are all clean.
  • tfplugindocs validate --provider-name coderd passes.
  • make lint has 15 pre-existing usetesting findings, unchanged from the base (verified via git stash); unrelated to this change.

@matifali
matifali force-pushed the docs/registry-subcategories branch from c3874e4 to 588ce80 Compare August 25, 2026 16:17
@matifali
matifali changed the base branch from main to org-chat-models/default-model August 25, 2026 16:17
@ethanndickson
ethanndickson force-pushed the docs/registry-subcategories branch from 588ce80 to b5316cd Compare August 26, 2026 13:25

@ethanndickson ethanndickson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dedupe'd the tmpl files, lgtm

@bpmct bpmct left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid categorization

@matifali
matifali force-pushed the docs/registry-subcategories branch from 9cd92fc to 630ac8e Compare August 27, 2026 11:02
@ethanndickson
ethanndickson force-pushed the docs/registry-subcategories branch from 630ac8e to 7e8b401 Compare August 27, 2026 12:15

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7e8b4013c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

matifali and others added 2 commits August 27, 2026 12:34
Add per-resource tfplugindocs templates (templates/resources/<name>.md.tmpl,
templates/data-sources/<name>.md.tmpl) that set a subcategory
front-matter field per resource/data source, so the Terraform Registry
sidebar groups coderd_* pages into Agents, AI Governance, Deployment,
Identity & Access Management, and Templates instead of listing them flat.

The templates are copies of tfplugindocs' default resource template,
minus the HasImportIDConfig/HasImportIdentityConfig branches: no
resource ships import-by-string-id.tf or import-by-identity.tf example
files, so those branches were always-false dead code. Data-source
templates drop the import section entirely.

Stacked on org-chat-models/default-model (#423), which now includes the
renamed coderd_agents_default_model and coderd_agents_system_prompt.

Regenerated docs/ with make gen; only the subcategory line changed per
file.
tfplugindocs does not expose Registry subcategories through provider schema,
so the previous implementation copied its complete default template for every
resource and data source. That made a metadata-only change appear as hundreds
of duplicated lines and required new pages to copy the rendering markup again.

Replace the page-specific copies with generic resource and data source fallback
templates that select the subcategory from the Terraform type name. This keeps
the generated documentation unchanged while centralizing the workaround in two
maintainable templates.
@ethanndickson
ethanndickson force-pushed the docs/registry-subcategories branch from 120a8b2 to 5cab842 Compare August 27, 2026 12:37
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.

3 participants