fix(docs): generate method sub-pages for every class in API reference#1678
fix(docs): generate method sub-pages for every class in API reference#1678czechian wants to merge 1 commit into
Conversation
Inherited methods shared across many catalog classes (e.g. client_class, from_api, to_dict) share a name. The API reference builder deduped by the global links dict and skipped page creation for all but the first class, yet every class still rendered a relative link to its own method sub-page (<a href=client_class/>), producing 404s on all other classes. Dedup now applies only to the global links dict used for docstring linkification; each class always gets its own method sub-pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughModified ChangesShared Method Page Generation Fix
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/docs/python_ref_builder.py (1)
378-382: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueGlobal
linksentry for shared method names always points to the first class encountered.Since
links[func_name]is only set once (first class wins), any docstring link resolution for that function name (e.g. fromClassB's docstring referencingclient_class) will still resolve toClassA's page — no longer 404 but potentially the wrong class's page. This is an inherent limitation of a single global links map for shared names, not a regression from this diff, but worth flagging as a known caveat.🤖 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 `@scripts/docs/python_ref_builder.py` around lines 378 - 382, The shared-name entry in the global links map is a known limitation in python_ref_builder.py: once links[func_name] is set by the first class, later same-named methods resolve to the wrong class page. Update the link-resolution logic around the links[func_name] assignment in the docstring/reference builder to disambiguate by class context instead of relying on a single global function name key, or explicitly document this first-class-wins caveat if you are not changing behavior.
🤖 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.
Nitpick comments:
In `@scripts/docs/python_ref_builder.py`:
- Around line 378-382: The shared-name entry in the global links map is a known
limitation in python_ref_builder.py: once links[func_name] is set by the first
class, later same-named methods resolve to the wrong class page. Update the
link-resolution logic around the links[func_name] assignment in the
docstring/reference builder to disambiguate by class context instead of relying
on a single global function name key, or explicitly document this
first-class-wins caveat if you are not changing behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ee9becea-e5a8-4ddd-85cc-14c385bb534a
📒 Files selected for processing (2)
scripts/docs/python_ref_builder.pyscripts/docs/tests/test_python_ref_builder.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1678 +/- ##
=======================================
Coverage 79.21% 79.21%
=======================================
Files 232 232
Lines 15809 15809
=======================================
Hits 12523 12523
Misses 3286 3286 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Inherited methods shared across many catalog classes (e.g. client_class, from_api, to_dict) share a name. The API reference builder deduped by the global links dict and skipped page creation for all but the first class, yet every class still rendered a relative link to its own method sub-page (), producing 404s on all other classes.
Dedup now applies only to the global links dict used for docstring linkification; each class always gets its own method sub-pages.
Summary by CodeRabbit