Automate multiversion documentation publishing to clawpack.github.com - #247
Open
mandli wants to merge 4 commits into
Open
Automate multiversion documentation publishing to clawpack.github.com#247mandli wants to merge 4 commits into
mandli wants to merge 4 commits into
Conversation
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5[1m]
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5[1m]
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.
Replaces the manual
make versions→cp -r v5.7.x/* .→fix_links_top_level.py→rsync→git commitprocedure with a GitHub Actions workflow, and fixes several latent bugs in that procedure along the way.The published site (
www.clawpack.org) keepsclawpack.github.com@masteras its served source and stays on legacy branch-source Pages — this PR only automates the build and the push into it.Why now
Chasing a
deploy-pagesfailure (No artifacts named "github-pages" were found) turned up that it came from GitHub's auto-generateddynamic/pages/pages-build-deploymentin the site repo, not from anything we wrote: someone had clicked "Re-run failed jobs" 27 days after the build, so the artifact had expired. A full re-run fixed it. But the underlying situation was that publishing is entirely manual, undocumented in places, and had silently broken in ways nobody noticed — including a live 404.Bugs fixed
make versionsproduced no site root.howto_doc.rstdocumented two mandatory post-build steps (cp -r <version>/* .plus a link fix) that existed nowhere in the Makefile. Nowmake versions-publishdoes the whole job.cp -r <version>/*never matched.nojekyll; the site root has one only because nothing ever deleted it. Without it Pages stops serving_static/_sourcesand every page loses its CSS.fix_links_top_level.pyonly rewrote*.html,riemann/*.htmlandpyclaw/*.html. Confirmed live:www.clawpack.org/pyclaw/evolve/limiters.htmlserves../../../dev/…, one../too many, which escapes the site root. The new build produces../../dev/….v5.14.xsilently vanished from local builds.sphinx-multiversiononly readsrefs/heads/*andrefs/tags/*, ignoring remote-tracking refs, andgit clone/actions/checkoutcreate just one local branch. Sincev5.14.xissmv_latest_version, a build without it has no top-level pages at all.make check-versionsnow catches this and prints thegit branchcommand to fix it.smv_branch_whitelistwas unanchored.re.matchanchors only the start and.is a wildcard, so a branch nameddev-experimentwould have been built and published. Now^(dev|v5\.14\.x)$._build/was not gitignored (only_build1was), so ~400 MB of build output could be committed by a straygit add ..Two constraints discovered while implementing
sphinx-multiversion0.2.4 cannot run on Sphinx 9. It callsConfig.read(confdir, overrides)positionally; Sphinx 9.0 made those keyword-only. Boundary verified empirically: works through 8.2.3, breaks at 9.0.0.requirements-docs.txtnow pinssphinx>=7.0,<9. Migrating off the (unmaintained) extension is listed as future work inhowto_doc.rst.v5.1.x–v5.6.xreference aplot_directiveextension that no longer resolves, andsphinx-multiversiondrops any ref whoseconf.pyfails to load with only a stderr line and a zero exit status. Those six are recorded inKNOWN_UNBUILDABLEso a new drop still fails the check, and they're in the publish preserve-list because their long-published HTML can no longer be regenerated.The publish path is deliberately hard to make destructive
The site repo is not a pure build artifact — it holds ~20 top-level directories no build produces (
gallery/,doxygen/,pdf/,notebooks/,v5.1.x–v5.6.x, …) plus hand-written root files, andpyclaw/is only partly build-owned. So:--deleteis confined to version directories the build actually regenerated, and only on explicit opt-in.check_published_tree.shasserts, before any commit, that nothing unmanaged changed, thatCNAME/.nojekyllsurvived, and that the root is a promoted build.--orphan.peaceiris/actions-gh-pagesandJamesIves/github-pages-deploy-actionwere rejected: their defaults delete everything absent from the publish dir and force-push.clawpack-org-websiteenvironment, so a human approves each write to the live site with the diff and the rollback SHA in the run summary.build_type: legacy: the published tree is ~1.6 GiB, over the 1 GB documented for Pages, andworkflowmode enforces that cap at deploy time.PRs build a single version only —
sphinx-multiversionbuilds from committed refs viagit archive, somake versionson a PR would show reviewers the site without the PR's changes.Verification
make versions-publishbuilds 9 versions, promotes v5.14.x, rewrites 190 of 212 promoted files;check_built_site.shpasses. Order holds undermake -j4.test_promote_latest.py(link rewriting at depths 0/1/2, dotfile carry, version dirs left alone, error paths) and 14 intest_check_published_tree.sh(the additive sync is accepted; root--deleteis refused, including the case where it eats.git;--prunecan't rescue it; modified unmanaged paths, badCNAME, missing.nojekyll, unpromoted root and partial builds all refused).actionlintandshellcheckclean. 395 MB of_buildstays out ofgit status.Follow-up needed before this publishes anything
The workflow is inert until someone does two things: create a write-enabled deploy key on
clawpack.github.comstored asCLAWPACK_SITE_DEPLOY_KEY, and create theclawpack-org-websiteenvironment with required reviewers. Then the rollout isscope: dry-run→target_branch: ci-preview(Pages doesn't serve it) →master.Please run the
ci-previewpublish twice before pointing it atmaster— the second run must produce an empty diff. That's what proves the build is byte-reproducible, and it's what keeps a 1.5 GB repo from growing by ~177 MB on every push todev.Also note:
make checkwarningshas never actually run in CI (this repo had no Actions history), and the baseline now needs regenerating under thesphinx<9pin via the workflow'supdate_baselinedispatch.Assisted-by: claude claude-opus-5