docs: Docs/api pipeline improvements#611
Conversation
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Adds `uv run poe apidocs-quality` as a short alias for the docstring quality audit (--quality --no-methods against docs/docs/api). Updates README to lead with the short command. Both issues generative-computing#612 and generative-computing#613 now reference this alias and include a note that the tooling lands with PR generative-computing#611.
|
Note: Currently this removes the old generated files. |
Adds `uv run poe apidocs-quality` as a short alias for the docstring quality audit (--quality --no-methods against docs/docs/api). Updates README to lead with the short command. Both issues generative-computing#612 and generative-computing#613 now reference this alias and include a note that the tooling lands with PR generative-computing#611.
5d52c89 to
3fcbf36
Compare
jakelorocco
left a comment
There was a problem hiding this comment.
looks mostly good to me; I'm confused on the api doc update mechanism though. We have the api docs in our git ignore, but we are still pushing them to the github repo? I don't understand how that works with the automation.
psschwei
left a comment
There was a problem hiding this comment.
Summarizing from discussions earlier today, this PR:
- adds tooling to assist with building the API docs
- removes the out of date API docs that were currently there
- updates the action to generate the new API docs and push them to main
I think, based on discussions earlier, that instead of pushing to main the idea is to push to a dedicated docs branch that will be used for mintlify to grab the files from (@planetf1 keep me honest here)
In general, I'm good with that process (I think there's still a few minor things to clean up like some extra files / bob tags, so not officially approving).
- Fix MDX parse errors: wrap bare doctest blocks, escape {/} outside fences
- Fix GitHub source links to use versioned tag format
- Richer landing page with prose bullet list and module descriptions
- Add --source-dir support to build.py and audit_coverage.py
- Add --quality docstring audit (8 issue categories, 322/322 pass)
- Add --orphans nav audit for MDX files absent from docs.json
- Add --fail-on-quality flag for CI/pre-commit hard gate
- Emit GitHub Actions annotations when run in CI (GITHUB_ACTIONS=true)
- Fix *args/**kwargs forwarder exemption using Griffe ParameterKind
- Remove generated API docs from version control; add to .gitignore
- Add poethepoet dev tasks (apidocs, apidocs-quality, apidocs-preview, etc)
- Disable CI workflow pending branch strategy decision (see PR generative-computing#611)
- Remove stray watch_20260210-162335 and redundant requirements.txt
Fixes generative-computing#532
be3161f to
a077f87
Compare
- Fix MDX parse errors: wrap bare doctest blocks, escape {/} outside fences
- Fix GitHub source links to use versioned tag format
- Richer landing page with prose bullet list and module descriptions
- Add --source-dir support to build.py and audit_coverage.py
- Add --quality docstring audit (8 issue categories, 322/322 pass)
- Add --orphans nav audit for MDX files absent from docs.json
- Add --fail-on-quality flag for CI/pre-commit hard gate
- Emit GitHub Actions annotations when run in CI (GITHUB_ACTIONS=true)
- Fix *args/**kwargs forwarder exemption using Griffe ParameterKind
- Remove generated API docs from version control; add to .gitignore
- Add poethepoet dev tasks (apidocs, apidocs-quality, apidocs-preview, etc)
- Disable CI workflow pending branch strategy decision (see PR generative-computing#611)
- Remove redundant files (requirements.txt, stray diagnostic output)
Fixes generative-computing#532
a077f87 to
d8f82d5
Compare
Now ready for re-review @HendrikStrobelt @psschwei @jakelorocco |
|
I think I'm still lost on where / when the docs will be, and how Mintlify will grab them. I don't see a concrete answer in this PR or the linked improvement issue. If that get's sorted out, I think this PR looks good. |
I believe the plan was a dedicated docs branch (can you confirm @planetf1 ?) |
|
The intent of this PR is to create tools that can build docs from the source content (our source code) with validation checks to ensure we're creating a good quality API reference. Yes. Intent is to publish to a dedicated docs branch (or rather two - one for each site). For example we'll write the full docs tree to docs/docs in that target branch. That will include both our 'written' conceptrual docs & the api reference. Mintlify will be pointed there so it publishes docs when they change When we've merged this, and pr 601 (I'm implementing some of the review comments) I'll do that part which hopefully will become clearer. |
jakelorocco
left a comment
There was a problem hiding this comment.
Our usual pytest commands won't catch these tests. I'm assuming it was intentional to keep them separate (which I'm fine with). We should think about if we need something to ensure they don't break.
current plan is add to CI and potentially pre-commit. |
…tooling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Removed all 7 |
psschwei
left a comment
There was a problem hiding this comment.
I ran this locally to build the docs and preview against mintlify and everything seemed to work fine (I did not run the tests, just the basic uv run poe apidocs).
I think we're in a good spot to merge this and then iterate if there are small details we need to fix once its in action.
jakelorocco
left a comment
There was a problem hiding this comment.
lgtm; I'm fine if y'all want to iterate further in this PR. But I also think the remaining potential changes are small and can be handled in future PRs as we improve the process.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
API docs pipeline improvements
Type of PR
Description
Improves the
tooling/docs-autogen/pipeline (build.py,generate-ast.py,decorate_api_mdx.py,audit_coverage.py):>>> doctestblocks in module docstrings were parsed as nested blockquotes by MDX; wrapped in fenced code blocks viawrap_doctest_blocks(). Unescaped{/}in prose (e.g. inline Python/JSON examples) caused acorn parse errors; now escaped outside code fences.fix_source_links()now handles the HTML<a href="...">format that mdxify actually emits. The old regex only matched Markdown[View source](...)format and never fired, leaving all links onblob/main/instead of the versioned tag.generate_landing_page()now emits a prose bullet list with bold linked module names and descriptions, replacing the previous plain bullet list. Descriptions are extracted from the decorated MDX body (the full module preamble text) rather than the short frontmatter one-liner.--source-dirsupport —build.pyandaudit_coverage.pynow accept--source-dirto generate or audit docs for a different checkout without touching that repo. Thedocs.jsonnavigation is updated in the source repo (bug fix: previously always wrote tomellea-d).audit_coverage.py --qualitydetects 8 categories of incomplete docstrings (missing, short, no Args/Returns/Raises sections, param name mismatches). Scoped to documented public symbols only — 322/322 documented (100% coverage).audit_coverage.py --orphansfinds MDX files that exist on disk but are absent from thedocs.jsonnavigation tree.--fail-on-qualityflag exits 1 when quality issues are found, making the audit usable as a hard gate. When run in GitHub Actions (GITHUB_ACTIONS=true), each issue is also emitted as a::error::annotation so problems surface inline on the PR diff. Groundwork for ci: gate doc quality in CI and pre-commit to prevent future degradation #616.*args/**kwargsforwarder exemption — functions that forward via*args/**kwargs(e.g.mify) are correctly exempt fromno_argsandparam_mismatchchecks. The tool uses Griffe'sParameterKindrather than a name-prefix heuristic, which was previously a no-op.Generated API docs removed from the repo
docs/docs/api/anddocs/docs/api-reference.mdxare fully generated artefacts — they are now both added to.gitignoreand removed from git tracking in this PR. The previous committed snapshot (28 MDX files) is deleted; going forward these files are generated on demand viauv run poe apidocsor by thedocs-autogen-pr.ymlCI workflow on each release tag. They should never be hand-edited or re-committed directly.uv run poecommands for API docsuv run poe apidocspyproject.toml)uv run poe apidocs-preview/tmp/mellea-preview, then run full quality audituv run poe apidocs-qualityuv run poe apidocs-orphansdocs.jsonnavigationuv run poe apidocs-validateuv run poe apidocs-testuv run poe apidocs-cleanCross-repo usage (direct script invocation)
Generate and audit docs for a different checkout without touching that repo:
Related issues
no_returnsissues once fixed)Testing
../mellea-bwith the docstring improvements from PR docs: improve docstrings for API reference (#612) #614 — audit reports 0 quality issues after those fixes