Use lychee for docbuilding - #898
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures BayBE’s documentation CI so external link checking is run as a dedicated step/job instead of being embedded in the documentation build script, and it tunes Sphinx linkcheck settings to make the new gating behavior more reliable.
Changes:
- Adds a dedicated
linkchecktox environment and wires it into GitHub Actions (including a separate CI job). - Removes linkcheck logic/flags from
docs/scripts/build_documentation.pyand enables parallel Sphinx builds. - Configures Sphinx linkcheck behavior (ignore patterns + timeout/retries) for more stable CI runs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tox.ini |
Adds testenv:linkcheck and updates docs-quickbuild to match the new separation. |
docs/scripts/check_links.py |
Updates linkcheck utility and adds parallel build flag. |
docs/scripts/build_documentation.py |
Removes linkcheck flag/logic and enables parallel Sphinx HTML build. |
docs/conf.py |
Adds linkcheck ignore/timeout/retry settings to reduce flaky failures. |
CHANGELOG.md |
Notes the new documentation linkcheck job. |
.github/workflows/docs.yml |
Runs linkcheck explicitly before building/publishing docs. |
.github/workflows/ci.yml |
Introduces a dedicated linkcheck job and makes docs build depend on it. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
51ac6a5 to
be0aaa7
Compare
be0aaa7 to
297738c
Compare
3e48b15 to
297738c
Compare
297738c to
24125fa
Compare
56edeec to
c4068b9
Compare
c4068b9 to
9e3a794
Compare
fa70d27 to
14e9af8
Compare
a091454 to
d206f85
Compare
f453363 to
22d45fe
Compare
22d45fe to
4622a11
Compare
4622a11 to
98fd9e4
Compare
lychee for docbuilding
6cb1dd7 to
8eaa054
Compare
Checking of external links is no longer handled by the `linkcheck` builder. The `dummy ` builder is used instead, which does not check external links but still checks internal links.
Those helpers and tools were previously used for checking links, but now they focus on verifying cross-references instead.
8eaa054 to
b24fd59
Compare
There was a problem hiding this comment.
If I understand the PR desc correctly lychee only checks external links, but could also check internal crossrefs like for code objects too
is that correct?
the PR desc mentions this wouldnt bring speedbut, but the whole point of pre-performed linkcheck is also to enable fail-early, not overall speedup (whichis a benefit on top but not needed)
There was a problem hiding this comment.
Yes. The issue is that it could only properly check those links in the fully build documentation (source: Independent querying of ChatGPT and Claude Code, checking their docs manually: "Out of the box lychee supports HTML, Markdown and plain text formats.") So we would need to fully build the html documentation first anyway, and building this already checks for broken cross refs (tested)
There was a problem hiding this comment.
🟡 Changes recommended
Three moderate review findings remain unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
.github/workflows/ci.yml:90
- Moving external-link checking out of
build_documentation.pyalso changes the separate.github/workflows/docs.ymlpublish path: it still runs the build script onmainpushes, releases, and manual runs, but it has no lychee step or dependency. Theneeds: [lint, lychee]here cannot gate that separate workflow, so documentation can still be published without external-link validation; add lychee to the publishing workflow or otherwise make publication depend on the check if that path is in scope.
build-docs:
name: "Build Docs"
runs-on: ubuntu-latest
needs: [lint, lychee]
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lychee: |
There was a problem hiding this comment.
@Scienfitz @AdrianSosic I overlooked this in my first implementation. Added it now as I assume that we also want to have link checking when actually building the documentation, not only in the CI. Feel free to resolve once you have seen this.
This PR separates the linkcheck job from the actual doc building. It does so by creating a new dedicated job for it in the CI and re-organizing the code.
External link checking
linkcheckbuilder with lychee for external URL validationbaybe/,docs/,examples/, and top-level markdown fileslychee.toml(migrated fromlinkcheck_ignoreindocs/conf.py)linkcheck_ignorefromdocs/conf.pyCross-reference checking
Naming cleanup
check_linkstochange_crossrefsCI changes
Misc
sphinx). At the end of that job there is also a short summary (see screenshots)lycheefor internal links but since thesphinx htmlbuild already does this, there is no further speed-up that we can gain here.Stack created with GitHub Stacks CLI • Give Feedback 💬