docs(validation): harden docs validation pipeline after Docusaurus migration (#1174)

オープン
#1,226 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bash, github-actions, python

調査の方向性

This is a multi-part tracker, so pick one item rather than the whole list. Start in tooling/docs-autogen/validate.py, at validate_anchor_collisions (which imports mintlify_anchor from test_mintlify_anchors.py) and validate_rst_docstrings, and check how overall_passed is computed. The docs-publish.yml workflow holds the continue-on-error flags. Maintainers have not chosen between the options in item 1, so confirm the direction in the thread before writing code.

索引モデルが issue の本文から書いたものです。

説明

documentation p2

Context

PR #1174 (Docusaurus migration) is a good opportunity to audit the validation pipeline and close several gaps that exist across tiers — editor/pre-commit/CI scripts/Docusaurus build. This issue tracks follow-on hardening work once #1174 merges.


1. Fix validate_anchor_collisions algorithm (correctness bug)

validate_anchor_collisions in tooling/docs-autogen/validate.py currently imports mintlify_anchor from test_mintlify_anchors.py to generate anchor slugs for collision detection. After the Docusaurus migration this is the wrong algorithm — Docusaurus uses a different slug function — so the check will produce false positives and misses.

Since onBrokenAnchors: 'throw' in docusaurus.config.ts already catches real collisions at build time with the correct algorithm, the validate.py check is now both redundant and incorrect. Options:

  • Update the slug function to match Docusaurus's algorithm, or
  • Retire the check entirely in favour of the build gate

2. Extend RST docstring detection and promote to a hard fail

validate_rst_docstrings() currently only detects RST double-backtick notation (``Symbol``) and is warning-only (explicitly excluded from overall_passed). It misses the :param:, :type:, :returns:, :rtype:, .. note::, and .. deprecated:: constructs that are the more common RST style patterns in practice.

Two changes needed:

  • Extend the detection patterns to cover the full set of RST constructs
  • Promote the check to a hard fail by including it in overall_passed

Additionally, add a pre-commit grep hook on mellea/**/*.py so contributors get fast local feedback before CI:

- id: no-rst-docstrings
  name: "No RST-style docstrings"
  entry: bash -c 'grep -rn ":param \|:type \|:returns:\|:rtype:\|^\s*\.\. note::\|^\s*\.\. deprecated::" "$@" && echo "RST docstring syntax found — use Google style (Args:/Returns:)" && exit 1 || exit 0'
  language: system
  types: [python]
  files: ^mellea/

Note: ruff's D rules with convention = "google" enforce section structure (presence/absence of Args:, Returns:) but do not and cannot detect RST content markup — so this genuinely needs a separate check at every tier.


3. Harden CI soft gates in docs-publish.yml

All validate.py steps except the docstring quality gate use continue-on-error: true, meaning failures appear in the job summary but do not block deploy. With the Mintlify orphan-branch deployment complexity removed by #1174, there is less justification for soft gates.

Steps to harden (remove continue-on-error: true):

  • validate_api — source link staleness, import path drift, stale files, and examples catalogue errors all currently reach production silently
  • audit_coverage — below-threshold API coverage currently does not block deploy

markdownlint could also be hardened; this is lower priority since the Docusaurus build would still succeed even with markdown style issues.


4. Extend markdownlint to .mdx files

The markdownlint gate currently covers only docs/docs/**/*.md. Authored .mdx pages and the generated API docs (all .mdx) receive no markdown linting at any tier below the Docusaurus build compile step.

Pre-commit hook should include .mdx:

files: ^docs/docs/.*\.(md|mdx)$

CI should similarly update the glob:

npx markdownlint-cli "docs/docs/**/*.{md,mdx}" --config docs/docs/.markdownlint.json

Note: some markdownlint rules may need adjusting for .mdx (JSX syntax in inline components). The existing .markdownlint.json already disables MD033 (HTML) which covers most JSX cases.


6. External link rot detection

Neither onBrokenLinks: 'throw' nor any validate.py check covers external URLs. Dead external links are invisible until users report them.

Add a scheduled workflow (weekly) using a link checker (e.g. lychee) against the built site or the source .md/.mdx files, with results posted as a summary or issue. This is lower priority than items 1–4 and worth a separate implementation discussion.


Sequencing

Items 1–4 are all low-effort and could ship as a single follow-on PR after #1174 merges. Item 6 warrants its own scoped issue once the others are addressed.

主要言語
Python
スター
1.8k
フォーク
161
平均マージ
4日 3時間
マージ済み PR(30日)
45

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

generative-computing/mellea のほかの issue

generative-computing/mellea の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。