ci: stabilize docs build workflow#110
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8b55b62e1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - ".readthedocs.yaml" | ||
| - "docs/**" | ||
| - "src/**" | ||
| - "tools/update_api_reference.py" | ||
| - "pyproject.toml" |
There was a problem hiding this comment.
Include all docs build inputs in path filters
With this new paths filter, documentation checks are skipped for PRs that only change files the docs job still consumes, such as setup.py via python -m pip install -e . and images/buildcompiler_logo.png via docs/conf.py's html_logo. Those changes can break the docs install/build but would no longer run this workflow; include those inputs, e.g. setup.py and images/**, in both the pull request and push filters.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@codex good catch, please fix thi issue. Also, some of the problems have not been solved. The workflow should build the documentation on CI and when its pushed into master it updates the online RTD. The remaining issues are:
/home/runner/work/BuildCompiler/BuildCompiler/docs/API_Reference.rst:366: WARNING: more than one target found for cross-reference 'Plasmid': buildcompiler.abstract_translator.Plasmid, buildcompiler.plasmid.Plasmid [ref.python]
/home/runner/work/BuildCompiler/BuildCompiler/docs/API_Reference.rst:366: WARNING: more than one target found for cross-reference 'Plasmid': buildcompiler.abstract_translator.Plasmid, buildcompiler.plasmid.Plasmid [ref.python]
There was a problem hiding this comment.
Summary
- Expanded the docs workflow path filters to include
images/**andsetup.pyfor both PR and push events, so docs CI runs when all relevant docs build inputs change. .github/workflows/docs.ymlL4-L13 .github/workflows/docs.ymlL18-L26 - Added
masterto the docs workflow push branches alongsidemain, so pushes tomasteralso run the docs build needed for the RTD update flow. .github/workflows/docs.ymlL14-L17 - Updated the API reference generator to mark
buildcompiler.abstract_translatoras a no-index module, preventing duplicate Sphinx Python targets forPlasmidwhile still documenting the module. tools/update_api_reference.pyL34-L35 tools/update_api_reference.pyL64-L79 - Regenerated
docs/API_Reference.rstso the legacyabstract_translatorautomodule uses:no-index:. docs/API_Reference.rstL357-L364 - Committed changes on the current branch with commit
3072519and created the PR via themake_prtool.
Testing
- ✅
python tools/update_api_reference.py - ✅
git diff --check - ✅
python - <<'PY' from pathlib import Path for path in ['.github/workflows/docs.yml', 'tools/update_api_reference.py', 'docs/API_Reference.rst']: assert Path(path).read_text(encoding='utf-8').strip() print('changed files are readable') PY ⚠️ python -m pip install -r docs/requirements.txt -q && sphinx-build -b html -W --keep-going docs docs/_build/html— blocked by the environment package index tunnel returning HTTP 403, so Sphinx could not be installed locally.
Motivation
docs/API_Reference.rstduring the build which is brittle for protected branches and read-only CI tokens.Description
.github/workflows/docs.ymlto add apull_requesttrigger for docs/source/config changes and to run the docs build on Python3.11with pip caching by settingcache: pipandcache-dependency-pathtopyproject.tomlanddocs/requirements.txt.permissionsin.github/workflows/docs.ymlfromcontents: writetocontents: readand remove the CI step that committed/pusheddocs/API_Reference.rst, replacing it with a deterministic freshness checkpython tools/update_api_reference.py && git diff --exit-code -- docs/API_Reference.rst..readthedocs.yamlto use Python3.11.docs/requirements.txttosphinx>=7,<9to avoid unplanned breakage from future major Sphinx releases.Testing
python tools/update_api_reference.py && git diff --exit-code -- docs/API_Reference.rstand the freshness check succeeded.git diff --checkto validate there are no whitespace or diff issues and it succeeded..github/workflows/docs.ymland.readthedocs.yamlto ensure the files are non-empty and readable and it succeeded.pip installandsphinx-buildto reproduce the full build but the package index is unreachable in this environment (HTTP403 Tunnel connection failed) which caused install failures for build tools and Sphinx so the full Sphinx build could not be completed here.Codex Task