Repository navigation
Docs: let the docs generator import the badges that generated pages render - #131704
Conversation
The format page generator (`format_generators` in `ci/jobs/scripts/docs/autogenerate/autogenerate_docs.py`) discovers pages only through the matched rows of `docs/_migration/slug-map.csv`. Neither `reference/formats/Vortex.mdx` nor `reference/formats/SQLite.mdx` had a row, so the nightly docs job never regenerated them and `Vortex.mdx` still described the `String` mapping from before ClickHouse#130234 (written as `Binary`, no `output_format_vortex_string_as_string` row). Add the two rows in the shape of the Puffin rows and regenerate both pages with the generator (`--write --only format:Vortex` / `format:SQLite`). The SQLite page change is the generator's link rewrite of the database engine link to its current path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reference docs generator found its destination pages and resolved legacy links through `docs/_migration/slug-map.csv`, a snapshot of the Docusaurus to Mintlify migration. Pages added or moved since then were silently skipped (`Vortex`, `SQLite`) or linked through stale routes. - Every generator names its Mintlify page (`dest`) and the page's former Docusaurus path (`source_docu`, which relative links in the source registrations are written against). - The eight page families discover their pages by walking their `reference/` directory, as database engines already did. - The Markdown to MDX transforms move next to the generator as `mintlify_transform.py`. Only the transforms that some registration can trigger are kept; the migration driver, its per-page overrides and the slug map reader are dropped. - Legacy links resolve through the docs tree plus the site redirect table `docs/_site/redirects.json`. A full regeneration with the old and the new generator writes the same page set and the same content, except one link in `ODBCDriver2.mdx`: the ODBC page moved to `concepts/features/interfaces/odbc/index.mdx`, which the stale slug-map row hid. The regenerated page is included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nothing reads it any more: the reference docs generator discovers its pages from the `reference/` directories and resolves legacy links through `docs/_site/redirects.json`. Drop the folder (slug map, alias table, one-shot migration scripts) and the exclusions that only existed for it in `navigation_check.py`, `lychee.toml` and the docs README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The source registrations are about to carry Mintlify `<Accordion title="...">` sections instead of `<details><summary>`. The `/docs` page sanitizer drops any unknown element together with its subtree, so `uniq`'s "Implementation details" would disappear there: map an own-line `<Accordion>` onto the allowlisted `<details>`/`<summary>` pair (with blank lines so the Markdown inside is still parsed). The terminal `help` renderer treats `<Accordion>` like `<Card>` (the title is kept as a bold line) and drops `<Frame>` wrappers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The docs generator still ran every generated body through the
Docusaurus-to-Mintlify transform, which rewrote 85 of 516 pages on every run
(`@theme/` imports, `:::` admonitions, `<details>`, `<TabItem>`, `<iframe>`,
`highlight-*` comments, HTML comments and pre-Mintlify links). Write the
transform's output directly in the doc strings and in the generator's
settings SQL, so the generated pages no longer depend on the transform and
`system.documentation` carries the same syntax as the website.
The conversion is the transform's own output for each string (measured per
page with the generator in check mode; nothing is left for it to change except
the leading `# Title` of full-page bodies and the blank-line collapse, which
the generator keeps), with four deliberate differences:
- the titled note of `arrayCount` uses `<Note title="...">`, the convention of
the already converted sources (the transform gave an `<Info>` with a bold line);
- the six `<!-- -->` lines that only separated a list or a code block from the
next code block are deleted (CommonMark already ends the list at the blank
line, and `{/* */}` would show literally in `system.documentation`);
- the two `...WithWWW` descriptions of `cutToFirstSignificantSubdomainCustom*`
get their missing closing fence (it swallowed the next section on the page);
- the inline code `<!-- -->` in `extractTextFromHTML` stays as is (the
transform corrupted it to `{/* */}`).
Also converted: the untyped `:::` of `geohashEncode`, the `:::note` of the
`Freeform` format and the relative `.md` link of `Nested`, which no generated
page reaches yet.
A new test checks that no description in `system.documentation` uses `:::`
admonitions, `@theme/` imports, `highlight-*` comments or `.md` links. The
corpus checks of `04415` and `04417` follow the converted descriptions: the
`TimeSeries` badge is a named import now, and `uniq` no longer carries a raw
`<details>` block (`MergeTree` still does).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The source registrations and the generator's SQL templates are written in Mintlify MDX now, so the Docusaurus-to-Mintlify body transform no longer changes any generated page. Remove it, together with the link lookups and the former Docusaurus paths (`source_docu`, `legacy_page`) that only fed it. Two steps of page assembly stay in the generator, in `page_body`: the leading `# Title` of a full-page description is dropped (Mintlify renders the page title, and `system.documentation` needs the H1 to recognize the description as a full page), and blank-line runs of the SQL output are collapsed. The generator key `full_transform` becomes `full_page`; the dictionary page self-tests compare against `page_body` instead of the transform. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: - docs/_migration/migrate.py, docs/_migration/slug-map.csv: master modified them; this branch deletes docs/_migration (moved to the generator in ClickHouse#130608, removed here), so they stay deleted. - ci/jobs/scripts/docs/autogenerate/test_session_settings_split.py: master added a `migrate.rewrite_links` fenced-link check next to the `migrate.transform_imports` checks this branch already removed with the transform; kept this branch's side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Mintlify page must import every badge it renders. `replace_between_markers`
wrote the generated content verbatim, so the only place such an import could
come from was the documentation string itself: 57 `import { XBadge } ...`
lines in 44 descriptions, 12 of them for badges the page never renders, all
visible in `system.documentation`.
`replace_between_markers`, the placement point of every marker family and
of the statement pages, now prepends at the start of the region one
`import { XBadge } from "/snippets/components/XBadge/XBadge.jsx";` per
`*Badge` tag the new content renders that the resulting page does not import
yet. The old region is not consulted (it holds the previous generation's
imports); the text outside the region and the new content are, so function
category pages that import their badges above the region, and doc strings
that still carry an import, get no duplicate. Imports follow first use. The
split settings pages keep their own derivation.
Remove the badge imports (and the blank line after each group) from the doc
strings. Retarget 04415 (TimeSeries renders `<PrivatePreviewBadge/>` without
importing it) and 05023 (full-page detection past an MDX import: the polygon
layout's snippet import). The two dictionary page self-tests now compare
through `replace_between_markers`, so they model the inserted imports.
Full `--write` A/B (old script + old binary vs new script + new binary):
26,348 of 26,358 docs files byte-identical; 6 pages drop the 12 unused
imports, 3 pages reorder imports by first use, and
`beta-and-experimental-features.mdx` reorders rows, which also happens
between two runs of the old generator.
Related: ClickHouse#131679
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings), plus my own review (3 nits). The review covered this commit together with the stacked #130905 and #130608, with only the
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261114-225202 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261114-221700 |
|
Workflow [PR], commit [d7f00f1] Summary: ✅
AI ReviewSummaryThe PR moves badge imports from embedded documentation into the docs generator; its stacked changes also remove the migration tooling and convert source documentation to Mintlify syntax. No actionable findings at Consumers reviewed:
Local validation passed for 14 dictionary-source pages, 12 dictionary-layout pages, settings splitting and routing, and focused badge-import checks across 1,313 marked reference pages. Page discovery retains all previously generated marked pages. The fetched CI reports contain no failed tests. Final VerdictStatus: ✅ Approve |
CI finish ledger - 1ee1b48Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
CIDB has no other Session id: cron:our-pr-ci-monitor:20261115-043013 |
Resolve the `ParserSystemQuery.cpp` conflict while preserving generator-managed badge imports. ClickHouse#131704
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units100 translation units recompiled, 815 s compile time in total, 100 of them have a recent master baseline. |
The new reference pages were empty AUTOGENERATED stubs that the nightly docs regeneration fills, so deploying this PR before that run would publish blank pages (asked in ClickHouse#131672 (comment)). Fill the generated regions of `backup.mdx`, `restore.mdx` and `alter/unlock-snapshot.mdx`, plus the new `UNLOCK SNAPSHOT` row of the `ALTER` overview table, with the output of master's generator (`autogenerate_docs.py --only 'statement:'`) run against a binary built from this branch. The PR carries the `pr-autogenerated-docs` label. Drop the explicit badge imports from the `BACKUP` and `ALTER TABLE ... UNLOCK SNAPSHOT` descriptions: since ClickHouse#131704 the generator adds the imports of the badges a page renders, which is where the committed pages get them from. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #131679
Related: #130905
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The docs generator adds the imports of the status badges (
<ExperimentalBadge/>,<CloudNotSupportedBadge/>, ...) that a generated reference page renders, so the documentation in the source registrations no longer carries MDXimportlines.Description
As asked in #131679 (comment).
Stacked on #130905 (itself based on #130608), which converts the remaining
@theme/badgesimports into the lines deleted here: merge both first; until then this diff also shows their commits.Change:
replace_between_markersinautogenerate_docs.py, which places every generated region, now prependsimport { XBadge } from "/snippets/components/XBadge/XBadge.jsx";at the start of the region for each*Badgetag the new content renders and the resulting page does not import yet. Pages that import a badge above the region (function category pages) and doc strings that still carry an import get no duplicate. The split settings pages keep their own import logic.src/files, sosystem.documentationno longer shows them. The terminalhelpand the/docspage already dropped them; their output is unchanged.replace_between_markers.Validation: full
--writeruns of the old generator with the old binary and of the new one with the new binary leave 26,348 of 26,358 docs files byte-identical. Differences: 6 pages drop 12 imports of badges they never render (MergeTree;s3,azureBlobStorage,hdfs,url,file), 3 pages order their imports by first use (YTsaurus engine,CODEC,CREATE DICTIONARY), andbeta-and-experimental-features.mdxreorders rows, which also happens between two runs of the old generator. Every generated page imports each badge it renders exactly once.Workflow [PR]
Sync PR [sync-upstream/pr/131704]
Version info
26.11.1.2511-master(included in26.11and later)