Auto-Generate Service API Docs from Source#217
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an AST-based CLI generator (scripts/generate_service_docs.py) that extracts public service function signatures and runtime-checkable protocol types, injects generated Markdown between SERVICE_API markers into docs/service_api/*.md (or verifies with --check), wires a pre-commit hook, and updates/regenerates many service API docs and contributing/README guidance. ChangesService API Documentation Auto-Generation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/service_api/github_activity_tracker.md (1)
44-47:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove stale “Not yet in API” entries that are now documented.
This section contradicts the generated table above (e.g.,
add_commit_file_change,create_or_update_github_file,create_or_update_issue_comment,create_or_update_pr_review,create_or_update_pr_commentare already listed). Keeping both will confuse contributors.Suggested doc fix
-## Not yet in API - -- GitCommit, GitHubFile, GitCommitFileChange: add `create_commit`, `create_github_file`, `add_commit_file_change` when needed. -- IssueComment, PullRequestReview, PullRequestComment: add `create_issue_comment`, `create_pr_review`, `create_pr_comment` when needed. - ---- +---🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/service_api/github_activity_tracker.md` around lines 44 - 47, Remove the stale "Not yet in API" list entries that are already documented to avoid duplication and confusion: delete the bullet lines referencing GitCommit/GitHubFile/GitCommitFileChange and IssueComment/PullRequestReview/PullRequestComment and ensure only the canonical function names remain (e.g., add_commit_file_change, create_or_update_github_file, create_or_update_issue_comment, create_or_update_pr_review, create_or_update_pr_comment) so the table and prose are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/service_api/wg21_paper_tracker.md`:
- Around line 15-18: The API table generator is emitting empty return/summary
cells (e.g., the row for mark_paper_downloaded) which makes docs incomplete;
update the generator logic that renders rows for functions like
get_or_create_mailing, get_or_create_paper, get_or_create_paper_author, and
mark_paper_downloaded to substitute explicit fallbacks when a return annotation
or docstring summary is missing (use a consistent placeholder such as "None" or
"Unknown" for return type and "—" for summary), ensuring every table cell is
populated even if annotations/docstrings are absent.
In `@scripts/generate_service_docs.py`:
- Around line 91-113: The _format_args routine currently omits the
positional-only "/" and the bare "*" separators, so update _format_args to
insert "/" after processing args.posonlyargs when any posonlyargs exist (and
ensure it’s omitted when none), and insert a bare "*" before kwonlyargs when
args.vararg is None but there are kwonlyargs; use the existing symbols
(args.posonlyargs, args.args, first_default, args.vararg, args.kwonlyargs,
args.kw_defaults, args.kwarg) and the same parts list/formatting logic so the
generated signature includes "/" after positional-only parameters and "*" before
keyword-only parameters when appropriate.
- Line 102: The zip call pairing args.kwonlyargs and args.kw_defaults should
include strict=True to satisfy Ruff B905; update the expression
zip(args.kwonlyargs, args.kw_defaults) used in the function that iterates over
keyword-only args to zip(args.kwonlyargs, args.kw_defaults, strict=True) so the
lengths are enforced (args.kwonlyargs and args.kw_defaults are index-aligned AST
fields and strict=True is safe).
---
Outside diff comments:
In `@docs/service_api/github_activity_tracker.md`:
- Around line 44-47: Remove the stale "Not yet in API" list entries that are
already documented to avoid duplication and confusion: delete the bullet lines
referencing GitCommit/GitHubFile/GitCommitFileChange and
IssueComment/PullRequestReview/PullRequestComment and ensure only the canonical
function names remain (e.g., add_commit_file_change,
create_or_update_github_file, create_or_update_issue_comment,
create_or_update_pr_review, create_or_update_pr_comment) so the table and prose
are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 216d9e3e-8234-4d55-9957-615860be4aa3
📒 Files selected for processing (19)
.pre-commit-config.yamlREADME.mddocs/Contributing.mddocs/Service_API.mddocs/service_api/README.mddocs/service_api/boost_library_docs_tracker.mddocs/service_api/boost_library_tracker.mddocs/service_api/boost_mailing_list_tracker.mddocs/service_api/boost_usage_tracker.mddocs/service_api/clang_github_tracker.mddocs/service_api/core_protocols.mddocs/service_api/cppa_pinecone_sync.mddocs/service_api/cppa_slack_tracker.mddocs/service_api/cppa_user_tracker.mddocs/service_api/cppa_youtube_script_tracker.mddocs/service_api/discord_activity_tracker.mddocs/service_api/github_activity_tracker.mddocs/service_api/wg21_paper_tracker.mdscripts/generate_service_docs.py
1. scripts/generate_service_docs.py
2. Docs layout (docs/service_api/)
3. Pre-commit / CI
4. Contributor / index docs
Related Issue
close #204
Summary by CodeRabbit