docs: replace viewcode with GitHub permalinks#5887
Conversation
Reuse source locations already collected by AutoAPI to generate commit-pinned GitHub links without importing backend modules or emitting local source pages. Coding-Agent: Codex Codex-Version: codex-cli 0.144.6 Model: gpt-5.6-sol Reasoning-Effort: xhigh
📝 WalkthroughWalkthroughSphinx documentation switches from ChangesGitHub linkcode integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Sphinx
participant AutoAPI
participant linkcode_resolve
participant GitHub
Sphinx->>AutoAPI: collect source metadata at builder-inited
AutoAPI-->>Sphinx: cache source locations
Sphinx->>linkcode_resolve: resolve Python symbol
linkcode_resolve->>GitHub: create commit-pinned source URL
GitHub-->>Sphinx: return source link
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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: 1
🤖 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 `@source/tests/test_doc_linkcode.py`:
- Line 25: Resolve the temporary repository root before assigning it to the
mocked REPOSITORY_ROOT in the test setup. Update the repository_root assignment
near the test fixture to use tmp_path.resolve(), keeping the existing mock
behavior and assertions unchanged.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4eb8f2a0-6184-4e39-a2b8-454e7a66c211
📒 Files selected for processing (3)
doc/conf.pydoc/github_linkcode.pysource/tests/test_doc_linkcode.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5887 +/- ##
==========================================
- Coverage 78.87% 78.60% -0.27%
==========================================
Files 1054 1054
Lines 121770 121770
Branches 4413 4410 -3
==========================================
- Hits 96046 95720 -326
- Misses 24159 24472 +313
- Partials 1565 1578 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Coding-Agent: Codex Codex-Version: codex-cli 0.144.6 Model: gpt-5.6-sol Reasoning-Effort: xhigh
Summary
sphinx.ext.viewcodewithsphinx.ext.linkcode.READTHEDOCS_GIT_COMMIT_HASHso links remain immutable._modulessource pages.Performance measurement
This PR intentionally contains only the source-link implementation so its Read the Docs preview isolates the Viewcode cost.
Baseline Read the Docs build 33680413:
Both performance PRs use upstream commit
83e7245646185a2de8f7d6277edc4f64b4f500f0as their base.Testing
ruff check .ruff format .pytest source/tests/test_doc_linkcode.py -vblob/<commit>/...#L10-L20URL_modulesdirectoryCoding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh
Summary by CodeRabbit
Documentation
Tests