Skip to content

feat(docs): griffe + pre-renderer pipeline for method pages#1419

Merged
hkad98 merged 2 commits intogooddata:masterfrom
hkad98:jkd/fix-docs-scripts
Mar 16, 2026
Merged

feat(docs): griffe + pre-renderer pipeline for method pages#1419
hkad98 merged 2 commits intogooddata:masterfrom
hkad98:jkd/fix-docs-scripts

Conversation

@hkad98
Copy link
Copy Markdown
Contributor

@hkad98 hkad98 commented Mar 16, 2026

Summary

  • Add griffe_builder.py for static AST-based API introspection (replaces runtime json_builder.py)
  • Add method_page_renderer.py to pre-render method documentation pages from docstrings at build time
  • Add api_ref frontmatter to all 146 method pages so the renderer can resolve them
  • Convert RST-style docstrings to Google style across SDK packages for consistent parsing
  • Remove Hugo shortcodes (api-ref, parameter, parameters-block) that are no longer needed
  • Update generate-single-version.sh to use the new pipeline

The docs json_builder.py script expects Google-style docstrings but several
functions used RST-style (:param/:return:), had missing summary lines before
Args sections, or had improperly indented continuation lines — all causing
"Invalid docstring" warnings during docs generation.

jira: TRIVIAL
risk: low
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.36%. Comparing base (b95ca11) to head (4926843).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1419   +/-   ##
=======================================
  Coverage   77.36%   77.36%           
=======================================
  Files         228      228           
  Lines       14775    14775           
=======================================
  Hits        11430    11430           
  Misses       3345     3345           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…rer pipeline

Replace 136 manually maintained method documentation pages with a directive-based
system where signature, parameters, and returns are auto-generated from code
docstrings via griffe static AST analysis.

Key changes:

- Add griffe_builder.py: static AST replacement for json_builder.py — produces
  identical data.json without requiring package installation (~1.1s vs ~1.8s)
- Add method_page_renderer.py: pre-renders method pages from api_ref frontmatter,
  with type names hyperlinked to API reference pages via links.json
- Add migrate_method_pages.py: one-time migration that converted 136 pages to
  api_ref directive format, preserving hand-written Example sections
- Update python_ref_builder.py: fix dedup bug that skipped recursion into
  duplicate-named modules (e.g. CatalogWorkspace was unreachable), add
  --export-links flag to export type->URL mapping for method_page_renderer
- Update generate.sh and generate-single-version.sh: prefer griffe over legacy
  json_builder, call method_page_renderer with --links-json
- Fix 9 docstrings with invalid "Args: None" pattern and 3 with missing blank
  lines before Args/Returns sections
- Delete 12 unused Hugo shortcode/partial templates (api-ref-*, parameter*)
- Add 91 unit tests (up from 33) covering griffe builder, method renderer,
  link resolution, frontmatter parsing, idempotency, and edge cases
- Update scripts/docs/README.md with new pipeline documentation

jira: trivial
risk: nonprod
@hkad98 hkad98 force-pushed the jkd/fix-docs-scripts branch from ecf8d2b to 4926843 Compare March 16, 2026 11:37
@hkad98 hkad98 enabled auto-merge March 16, 2026 15:58
@hkad98 hkad98 merged commit 1cf96b9 into gooddata:master Mar 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants