Skip to content

CI (docs): Reusable Mintlify docs checks for integrations repos#106258

Draft
Blargian wants to merge 7 commits into
ClickHouse:masterfrom
Blargian:reusable-mintlify-docs-check
Draft

CI (docs): Reusable Mintlify docs checks for integrations repos#106258
Blargian wants to merge 7 commits into
ClickHouse:masterfrom
Blargian:reusable-mintlify-docs-check

Conversation

@Blargian
Copy link
Copy Markdown
Member

@Blargian Blargian commented Jun 1, 2026

Structures the Mintlify docs check such that it can be easily run standalone without Praktika in other repos. The motivation for this is to enable us to easily run the same Mintlify docs checks in this repository in language client repos.

Context:

Our integrations team would like to keep docs close to the source code so they can make docs updates alongside code changes. Currently the docs are kept in clickhouse-docs repo and it's necessary to context switch to make docs updates.

With the Mintlify migration, beginning with clickhouse-connect: ClickHouse/clickhouse-connect#768, we will move language client docs back into their own repositories. As part of the language client CI any changes to the docs will run the Mintlify docs check in ClickHouse/ClickHouse in the docs_builder container. If all checks pass the PR merges. GitHub releases of the client trigger a workflow which 'syncs' the docs to copies of them in this repo.

We want the sync to be unidirectional, so there is a check added to this repository to fail the docs check with an error message pointing to the canonical source if someone tries to make the updates in ClickHouse/ClickHouse.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Blargian and others added 7 commits March 26, 2026 14:51
Remove trailing hyphen from anchor to match external links in clickhouse-docs repo.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The two example result blocks were not regenerated after the queries were
changed to `ORDER BY VisitID`, so the displayed rows did not match what a
reader running the query would see. Regenerate both blocks in `VisitID`
order, and add `Goal.Serial` as a tie-breaker to the `ARRAY JOIN` example so
the goals within a single visit are listed deterministically in array order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Decouple the Mintlify docs check logic from Praktika so another repository
(e.g. a language client whose docs are a slice of the larger site) can run the
same checks without vendoring Praktika.

- Add `ci/jobs/scripts/docs/mintlify_docs_check.py`, a self-contained driver
  that pulls the docs image, shallow/sparse-clones the aggregator docs repo
  (including `ci/jobs/scripts/docs` so shared check scripts come along),
  overlays one or more local folders, and runs the checks inside the image.
  The host only needs `docker`, `git` and `python3`; `mint` is provided by the
  image. The check definitions live in `DEFAULT_CHECKS` as the single source of
  truth.
- Rewrite `ci/jobs/docs_job_mintlify.py` as a thin Praktika adapter that imports
  `DEFAULT_CHECKS` and runs them natively (it already runs inside the image), so
  new checks are declared in one place.
- Add `ci/jobs/scripts/docs/check_readonly_copies.py` and
  `readonly_copies.json`, a one-way-sync guard that fails edits to docs folders
  whose canonical source lives in another repo and points contributors at that
  source. Wired into the Praktika job only (aggregator side); deliberately not
  part of `DEFAULT_CHECKS`.
- Track `ci/jobs/scripts/docs` in the docs job digest so changes to the shared
  check scripts re-run the job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Blargian Blargian changed the title Reusable mintlify docs check CI (docs): Reusable Mintlify docs checks for integrations repos Jun 1, 2026
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Jun 1, 2026

Workflow [PR], commit [4b9d59d]

Summary:


AI Review

Summary

This PR makes the Mintlify docs checks reusable by moving the check list into a standalone driver, adding a read-only copied-docs guard, and updating the Nested docs examples. The main issue is that the standalone driver does not validate deletions from consuming repos by default, so it can report green while the eventual synced docs tree would be broken.

Missing context / blind spots
  • ⚠️ The provided Praktika CI report for 4b9d59d3318f7cd40a233216cf8481ebfed2f323 currently contains 0 test results, so it does not show the new Docs check (Mintlify) path or a consuming-repo invocation passing.
Findings

⚠️ Majors

  • [ci/jobs/scripts/docs/mintlify_docs_check.py:121] The reusable check promises to validate a consuming repo's docs slice, but the default --overlay mode merges source files over the cloned aggregator instead of replacing the destination. If the consuming repo deletes or renames a page, the stale file from the aggregator remains, so mint validate and mint broken-links can pass even though the next sync would remove that page and may break the site.
    Suggested fix: make mirror/replacement semantics the default for --overlay, or require an explicit mode and document/use the mirror mode for consuming repos.
Tests
  • ⚠️ Add a focused test or scripted fixture for overlay that proves deleted destination files are removed before running the Mintlify checks.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: make the standalone overlay reflect deletions from the consuming repo, then add a small regression check for that behavior.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 1, 2026
parts = spec.split(":")
if len(parts) < 2:
raise ValueError(f"Invalid --overlay '{spec}'. Expected SRC:DEST[:mirror].")
mirror = len(parts) >= 3 and parts[2].lower() in ("1", "true", "mirror", "yes")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The standalone check should validate the exact docs slice from the consuming repo, but the default overlay mode is a merge. If a client repo deletes or renames a page, the old file from the cloned aggregator remains under dest, so mint validate and mint broken-links can pass even though the next sync would remove that page and potentially break the site. The help/example path does not require :mirror, so this is the mode consumers are likely to use.

Please make replacement the default for --overlay (or require an explicit mode and use mirror in the documented invocation), so deletions in the source repo are visible to the checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant