ci: never publish a documentation build that produced no site - #67
Closed
snesmaeili wants to merge 1 commit into
Closed
ci: never publish a documentation build that produced no site#67snesmaeili wants to merge 1 commit into
snesmaeili wants to merge 1 commit into
Conversation
Two small guards, complementary to #62 (which fixes why the build currently fails). These address how a failed or empty build reaches the live site. Refuse to deploy a build with no index.html. The GitHub Pages deploy uses force_orphan, so it replaces the entire published tree. The last successful deploy (2026-08-04) published a tree containing only .nojekyll and _sphinx_design_static -- no index.html anywhere -- which is why https://mne.tools/mne-denoise/ currently returns 404 for every page. A build that did not produce index.html and auto_examples/index.html should never be allowed to replace a working site. Add a "*" wildcard to the sphinx-gallery subsection_order. Adding any new examples/ subdirectory that contains .py files currently raises sphinx.errors.ConfigError: The subsection folder '../examples/<name>' was not found in the 'subsection_order' config. and fails the entire documentation build. The wildcard sorts unlisted folders to the end instead. (examples/tutorials and examples/output escape this today only because neither contains a .py file.) Verified with the CI invocation locally, sphinx -b html -W --keep-going: build succeeded, 194 HTML pages, 0 warnings, 36 gallery examples. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6GFfnt85ZSjuRaDrETwpU
snesmaeili
force-pushed
the
ci/resilient-docs-build
branch
from
August 10, 2026 17:38
129b164 to
1de102f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67 +/- ##
=======================================
Coverage 95.77% 95.77%
=======================================
Files 68 68
Lines 8565 8565
Branches 1512 1512
=======================================
Hits 8203 8203
Misses 175 175
Partials 187 187
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
1. Refuse to deploy a build that produced no site
https://mne.tools/mne-denoise/returns 404 for every page right now. The reason is not just that recent builds failed — it is that the last successful deploy published nothing.gh-pagesat0d1ff4b(deploy: cc22e2e, 2026-08-04) contains exactly two entries:Zero
index.htmlfiles. Because the deploy step usesforce_orphan: true, that empty tree replaced the entire published site.This adds a check between the build and the deploy:
A build that did not produce a site can no longer replace a working one. This is worth having independently of any particular build fix — it converts a silent site-wipe into a loud CI failure.
2. Wildcard the gallery subsection order
Adding any new
examples/subdirectory containing.pyfiles currently fails the entire documentation build:examples/tutorialsandexamples/outputescape this today only because neither contains a.pyfile — so the trap is invisible until someone adds a directory. A trailing"*"sorts unlisted folders to the end instead.Verification
Ran the CI invocation locally (
sphinx -b html -W --keep-going, examples executing):Changed from the first version of this PR
Originally this also carried a dataset-caching approach and the
temporal.pycitation fix. Both are already handled by #62 — and #62's render-without-executing policy is the better answer, since it avoids downloading ~1.5 GB in CI. Those commits have been dropped so there is no overlap.