feat: read shared data files locally instead of fetching from GitHub - #1614
Draft
neon60 wants to merge 9 commits into
Draft
feat: read shared data files locally instead of fetching from GitHub#1614neon60 wants to merge 9 commits into
neon60 wants to merge 9 commits into
Conversation
neon60
marked this pull request as draft
August 14, 2026 13:20
Replace every per-build GitHub fetch of shared data (latest_version.txt, release_candidate.txt, rocm_toolkits.txt, google_site_verification.txt, and projects.yaml) with local reads from a rocm-docs-common checkout. The checkout location is resolved from the new rocm_docs_common_dir config value (settable in conf.py) or the ROCM_DOCS_COMMON_DIR environment variable, config value taking precedence. There is no remote fallback: a missing directory or file fails the build so that builds always use pinned common data rather than a moving branch. This removes hundreds of raw.githubusercontent.com requests per build (the version/toolkit fetches ran once per page) plus the unauthenticated GitHub API call for projects.yaml, eliminating the rate-limit failures seen across parallel component-repo CI. The retry loops that could stall a build for minutes on throttling are gone with them. Add a tests/common_data fixture (with a placeholder google site verification token) and an autouse fixture so the test builds read from it.
Read the Docs clones the rocm-docs-common repo (tip of main) in a post_checkout job so rocm_docs reads the shared build-data files locally; docs/conf.py points rocm_docs_common_dir at that checkout. The cloned directory is gitignored so it is never committed. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Local sphinx-build now works without a manual clone: conf.py clones rocm-docs-common (tip of main) to the repo root if the folder is absent, then points rocm_docs_common_dir at it. On Read the Docs the post_checkout job already provides the clone, so the guard skips re-cloning. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Add clone_common_if_missing() plus COMMON_REPO_URL/COMMON_REPO_BRANCH so the clone-if-absent logic and the repo URL live in one place. Consumer conf.py files call the helper instead of duplicating the git clone block and hardcoding the URL. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
rocm_docs now resolves the common-data checkout itself at config-inited: if neither rocm_docs_common_dir nor ROCM_DOCS_COMMON_DIR is set it clones a default to <repo>/rocm-docs-common. Consumer conf.py files need no common-dir setup at all; the value is stored back on the config so the theme and projects reads reuse it. Add ensure_common_dir() to rocm_docs.common and drop the now-redundant clone call from this repo's own conf.py. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Add docs/developer_guide/local_common_data.md explaining how rocm_docs reads shared build data from a local rocm-docs-common checkout, the resolution order (config value, env var, auto-clone), and the local/RTD workflows. Expand the .readthedocs.yaml post_checkout comment to describe the automatic resolution and how to override it, and link the guide from the toc. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
The spellcheck CI splits "component-repo" on the hyphen and flags "repo", which is not in .wordlist.txt. Use the full word "repository", matching the terminology already used elsewhere in this file. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
The auto-clone only ran when <dest>/data was absent, so after the first local build the persisted checkout was never updated and silently went stale. Fast-forward the checkout to the branch tip when it already exists so repeated local builds read the latest shared data. The refresh is best-effort: a failure (offline, throttling) warns and builds against the existing copy, while the initial clone still raises. Only the auto-managed clone is refreshed; an explicit rocm_docs_common_dir/ROCM_DOCS_COMMON_DIR is left untouched. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
neon60
force-pushed
the
feat/local-common-data
branch
from
August 28, 2026 10:33
d3ea703 to
0b8c3be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Every rocm-docs-core build fetched shared data files from GitHub at build time, and this ran in every component repo (ROCm, rocm-systems, rocm-libraries). The version and toolkit files were fetched on the html-page-context event — once per page — so a ~100-page build made roughly 430 raw.githubusercontent.com requests, scaling linearly with page count. In parallel CI, all of these builds drew from the same anonymous GitHub quota simultaneously.
Two of the .txt fetches had no error handling, so a single 429 crashed the build outright; others retried (up to 100×, or looped for up to 10 minutes) which only amplified request volume under throttling. The projects.yaml fetch additionally used the unauthenticated GitHub REST API (60 requests/hour hard limit). Together this produced the rate-limit failures seen across component-repo CI.
Technical Details
Test Plan
Test Result
Known Issues
Submission Checklist