Skip to content

chore: stop tracking generated rule and diagnostic reference pages#11326

Merged
timotheeguerin merged 1 commit into
mainfrom
tadelesh/gitignore-generated-rule-diagnostic-docs
Jul 21, 2026
Merged

chore: stop tracking generated rule and diagnostic reference pages#11326
timotheeguerin merged 1 commit into
mainfrom
tadelesh/gitignore-generated-rule-diagnostic-docs

Conversation

@tadelesh

Copy link
Copy Markdown
Member

Problem

Since tspd generates one reference page per linter rule and diagnostic from each definition's docs field, the generated pages checked into the website content duplicate their source markdown:

  • website/.../libraries/http/rules/op-reference-container-route.mdpackages/http/src/rules/op-reference-container-route.md
  • website/.../emitters/openapi3/reference/diagnostics/*.md (6 files) ↔ packages/openapi3/src/diagnostics/*.md

Keeping both copies in git means every content edit has to be made (or regenerated) in two places.

Fix

Follow the same approach as Azure/typespec-azure#4968 and the repo's existing js-api precedent (**/docs/**/js-api/ is already gitignored): stop tracking the generated pages and regenerate them during the website build.

  • .gitignore — ignore the generated pages:
    • website/src/content/docs/docs/**/rules/
    • website/src/content/docs/docs/**/reference/diagnostics/
  • Untrack the 7 generated pages (their source markdown under packages/*/src/** remains the single tracked copy).

The website build regenerates them: website build runs build:web, which runs regen-all-packages-docs before astro check/astro build.

Validation

  • Deleted the generated pages from disk, ran regen-docs for http + openapi3, and confirmed all 7 pages are reproduced at the same paths — and git now treats them as ignored (no longer tracked, not shown as untracked).
  • @typespec/http (rules) and @typespec/openapi3 (diagnostics) are the only libraries in this repo that use the docs field, so the globs only match generated content.
  • chronus verify passes (no shipped package changes).

Since tspd generates one reference page per linter rule and diagnostic from
each definition's `docs` field, the generated pages under the website content
duplicated their source markdown (`packages/*/src/rules/*.md` and
`packages/*/src/diagnostics/*.md`).

Gitignore the generated pages and stop tracking them, following the existing
`js-api` precedent — they are regenerated during the website build (`build:web`
runs `regen-all-packages-docs` before `astro build`). The source markdown
remains the single tracked copy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: de8537de-5e61-4a0d-b2de-59ec12c15dc4
@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin
timotheeguerin added this pull request to the merge queue Jul 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 21, 2026
@timotheeguerin
timotheeguerin added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 3a8d49e Jul 21, 2026
32 checks passed
@timotheeguerin
timotheeguerin deleted the tadelesh/gitignore-generated-rule-diagnostic-docs branch July 21, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants