Skip to content

Docs: write Mintlify syntax in the source registrations and remove mintlify_transform.py - #130905

Merged
9 commits merged into
ClickHouse:masterfrom
groeneai:docs/mintlify-source-registrations
Nov 17, 2026
Merged

9 commits merged into
ClickHouse:masterfrom
groeneai:docs/mintlify-source-registrations

Conversation

@groeneai

@groeneai groeneai commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #130608

Changelog category (leave one):

  • Documentation (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The descriptions in system.documentation use the same Mintlify syntax as the website reference pages, so the docs generator publishes them without rewriting.

Description

As asked in #130608 (comment), the Docusaurus syntax that mintlify_transform.py still rewrote on every nightly run (85 of 516 generated pages) is now converted in the sources.

Based on #130608, which adds mintlify_transform.py: merge it first; until then this diff also shows its three commits.

Change:

  • doc strings in 74 src/ files and the generator's settings SQL use the transform's own output: badge imports from /snippets/components/, <Note>/<Warning> instead of :::, <Accordion> instead of <details><summary>, <Tab title>, <Frame>, highlight={...} instead of highlight-* comments, current routes instead of legacy and .md links;
  • the /docs page renders <Accordion> as <details> (its sanitizer would otherwise drop uniq's "Implementation details"); the terminal help keeps the title;
  • mintlify_transform.py is deleted. The generator keeps two page-assembly steps: it drops the leading # Title of full-page descriptions (system.documentation needs that H1 to recognize a full page) and collapses blank lines of its SQL output;
  • a new test rejects :::, @theme/, highlight-* and .md links in system.documentation.

Validation: full --write runs of the old generator on the old sources and of the new one on the converted sources write the same 1131 files, identical except six pages that the next nightly regeneration will update:

  • array-functions: arrayCount's titled note is <Note title="..."> instead of <Info> with a bold line;
  • float, geo, hdfs: empty {/* */} separators removed;
  • string-functions: the inline code <!-- --> is no longer corrupted to {/* */};
  • url-functions: two descriptions get their missing closing fence, which swallowed the next section.

Workflow [PR]
Sync PR [sync-upstream/pr/130905]

Version info

  • Merged into: 26.11.1.2511-master (included in 26.11 and later)

groeneai and others added 6 commits November 10, 2026 19:57
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]>
@mintlify

mintlify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0cec8b4.

Approve preview

@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 3 findings; 1 full pass). It covered 109 of the 111 changed paths: the pure deletion of docs/_migration/slug-map.csv and slug-aliases.csv (from #130608) is too large to display and was left out.

# Sev Finding Verdict Evidence / action
1 ⚠️ The equivalence of the generated pages is not proven by checked-in tests (autogenerate_docs.py page_body) DISAGREE Full local --write runs, old generator on the old sources vs new generator on the converted sources: same 1131 files written, identical except the six pages listed in the description. This is a ci/ script change, so it adds no test of the generator itself; the evidence is that local run.
2 💡 test_statement_generators.py still passes the removed lk argument to generate_artifacts AGREE, not changed That self-test is not run in CI and already fails before this call without this PR (no registered statement documents found).
3 💡 Header comments of the eight per-component generator SQL files still mention the removed transform AGREE, not changed Comment-only; outside this diff.

Also noted: the new test rejects four syntax classes; <TabItem>, HTML comments or legacy routes written into a future registration would now reach the website page as is and show up in the regeneration PR's docs checks.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261111-165600

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @dhtclk, could you review this? The doc strings in the source registrations and the generator's settings SQL now carry the Mintlify syntax that mintlify_transform.py used to produce on every nightly run, so the transform is deleted; the /docs page and the terminal help render the new Accordion tag.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The generator in --check mode with the transform instrumented per step reports 330 transform hunks over 85 of 516 bodies on the base, and 0 (only the H1 drop and blank-line collapse the generator keeps) on the converted sources. The new guard test lists 45 entities on the base and none after.
b Root cause explained? The registrations and the generator's settings SQL were only partly migrated to Mintlify, so the generator rewrote imports, admonitions, <details>, tabs, iframes, highlight comments, HTML comments and legacy links on every run, while system.documentation kept the legacy syntax.
c Fix matches root cause? Yes. The sources carry the transform's own output and the transform is deleted; only page assembly (full-page H1, blank lines of the SQL output) stays in the generator.
d Test intent preserved / new tests added? New 05621_documentation_no_docusaurus_syntax; 04601 extended (<Accordion> mapping, uniq corpus check); gtest MintlifyAccordionKeepsTitleAndContent. The corpus checks of 04415 and 04417 follow the converted strings (named badge import; raw <details> now in MergeTree). The generator change ships no harness self-test; its three existing self-tests are updated.
e Both directions demonstrated? Yes: 330 to 0 transform hunks; guard test 45 to 0 rows; 05621, 04601, 04415 fail on the base server and pass on the new one; changed tests 50 randomized runs each, 200/200.
f Fix is general across code paths? Every generator family goes through the same generate() and is covered by a full --write comparison (same 1131 files, six intended page changes). Both renderers of system.documentation (/docs page, terminal help) handle the new <Accordion>/<Frame>.
g Fix generalizes across inputs (params/datatypes/wrappers)? Every syntax class the transform rewrote was measured per step and converted; the guard test covers the classes that could come back unnoticed (:::, @theme/, highlight-*, .md links).
h Backward compatible? (maintainer-approved exception only) Yes. No setting, default or format change; descriptions change syntax only, and both in-product renderers render it.
i Invariants and contracts preserved? Full-page detection unchanged (the H1 stays in the sources); the documentation tests 01324, 04408, 04413, 04600, 05023, 05024, 05042, 05045 pass; no raw-literal delimiter inside a converted string; the generator CLI used by the nightly job is unchanged.

Session id: cron:clickhouse-impl-slot-4:20261111-154600

@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0cec8b4]

Summary: ✅


AI Review

Summary

Reviewed #130905 at 0cec8b4bd6b96da635fef18a0542e1d206a689c9, including all prior discussion and the current diff. The change moves embedded documentation to Mintlify syntax, discovers generated pages from the current documentation tree, and removes the migration tooling. No actionable findings remain.

The affected consumers reviewed were website generation (page_body retains page assembly), browser /docs (preprocessMarkdown maps disclosures to allowlisted HTML), and terminal help (TerminalMarkdownRenderer preserves component titles and content). The focused browser check passed for all five converted disclosure sections and the named badge import. The author's full regeneration comparison and terminal regression coverage provide supporting evidence; the Praktika report reports no failed tests.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-documentation Documentation PRs for the specific code PR can be tested Allows running workflows for external contributors comp-documentation Documentation (docs, examples, READMEs). labels Nov 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 0cec8b4bd with master 7908e771a (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of b04bc0a81; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

81 translation units recompiled, 700 s compile time in total, 81 of them have a recent master baseline.

Job report

@Blargian Blargian added the pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard label Nov 12, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Nov 12, 2026
@Blargian Blargian self-assigned this Nov 12, 2026
@Blargian
Blargian enabled auto-merge November 12, 2026 17:43
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 53bc76c

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (arm_release, master_head, 1/6, 2/6, 3/6, 5/6, 6/6) infra, not from this PR: performance test selection got GitHub API 403 Client Error: rate limit exceeded while reading the changed files, so no performance query ran on these shards #131070 (external, merged)
Performance Comparison (arm_release, master_head, 4/6) infra, not from this PR: performance test selection got HTTP Error 500: Internal Server Error while reading a coverage manifest (read_manifest in performance_selection.py does not retry) a fix task is created (investigating at full effort, fixing-PR link to follow here)
Mergeable Check, PR praktika rollups of the rows above #131070 (external, merged) and the fix task above

#131070 was merged after this head's CI started. CIDB has no other FAIL or ERROR row on this head.

Session id: cron:our-pr-ci-monitor:20261112-200351

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Performance Comparison (arm_release, master_head, 4/6) row of the CI finish ledger above (performance test selection stopped on an HTTP 500 while reading a coverage manifest): #131597

@Blargian

Copy link
Copy Markdown
Member

@groeneai merge master and resolve conflicts

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]>
auto-merge was automatically disabled November 14, 2026 21:49

Head branch was pushed to by a user without write access

@groeneai

Copy link
Copy Markdown
Collaborator Author

Merged master (656d08a884aa) in 0cec8b4; the PR is mergeable again. The three conflicts were all in code this PR removes:

  • docs/_migration/migrate.py and docs/_migration/slug-map.csv: kept deleted. To check that their master changes (the fenced-link fix and the Agents move) need nothing in the sources, I ran the old transform, with the fenced-link fix ported, over the merged build: on all 516 generated bodies it changes nothing beyond the H1 drop and blank-line collapse the generator keeps and the string-functions fix listed in the description.
  • ci/jobs/scripts/docs/autogenerate/test_session_settings_split.py: dropped master's new migrate.rewrite_links check, together with the other migrate.* checks this PR already removes there.

On the merged build the docs stateless tests pass, 05621_documentation_no_docusaurus_syntax included, except 04402_help_command_interactive (an interactive prompt timeout I also get locally without this PR). #130608 conflicts on the same two files; this PR contains its commits, so merging this one lands both.

@github-merge-queue github-merge-queue Bot closed this pull request by merging all changes into ClickHouse:master in 5327cf5 Nov 17, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-documentation Documentation (docs, examples, READMEs). manual approve Manual approve required to run CI pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard pr-documentation Documentation PRs for the specific code PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants