Version the published documentation with mike - #44
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
=======================================
Coverage 90.80% 90.81%
=======================================
Files 26 27 +1
Lines 1446 1491 +45
Branches 137 145 +8
=======================================
+ Hits 1313 1354 +41
- Misses 96 98 +2
- Partials 37 39 +2 🚀 New features to boost your workflow:
|
rpmcginty
force-pushed
the
chore/docs-versioning
branch
from
August 20, 2026 03:56
cc9a02c to
dcfb8e8
Compare
The gh-pages deploy force-pushed one flat site per build, so only the
newest docs ever existed. Publish through mike instead: pushes to main
deploy a `dev` version, and a release deploys its X.Y version built from
the release tag and moves the `latest` alias that the site root now
redirects to. Patch releases refresh their minor version rather than
adding an entry.
- add mike to the docs dependency group and the lockfile
- point Material's version selector at mike (extra.version.provider)
- add docs-versions / docs-serve-versions / docs-deploy-{dev,release}
targets; aliases are created as copies so serving does not depend on
the host resolving git symlinks, and git de-duplicates the blobs
- serialize the two gh-pages deploys with a shared concurrency group
Backfilling the versions released before now is a run-once operation, so
the script that does it is kept outside the repo rather than merged into
each one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rpmcginty
force-pushed
the
chore/docs-versioning
branch
from
September 14, 2026 20:50
dcfb8e8 to
2c0669f
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.
Why
publish_docs.ymldeployed togh-pageswithforce_orphan: true, which recreated the branch on every build — so only the newest docs ever existed and there was no way to look back at a released version.extra.version.providerwas also set tomkdocs, which isn't a value mkdocs-material recognizes (its JS only acts on"mike"plus aversions.json), so no version selector was ever rendered.What
Publish through mike, which keeps each version in its own subdirectory on
gh-pages:/latest/latest/X.Y)X.Y/dev/mainpublish_docs.yml— pushes tomainredeploydev.release.yml— newpublish-docsjob deploys the release'sX.Yversion and moves thelatestalias. It builds from the release tag, so published docs match the released code; patch releases refresh their minor version rather than adding an entry.Makefile—docs-versions,docs-serve-versions,docs-deploy-dev,docs-deploy-release.DOCS_PUSH=trueopts into pushing, so a local deploy commits togh-pagesfor review first.docs/developer/index.md— documents the layout, the workflows, and the local commands.Two deliberate details:
--alias-type=copyforlatestinstead of mike's default symlink, so serving doesn't depend on the host resolving git symlinks. It costs nothing: the copied files are byte-identical, so git stores one tree object for both (verified —latestand1.0hashed the same).concurrency: publish-docsgroup across both workflows. A release bumps_version.pyonmain, which triggers thedevdeploy at the same time as the release deploy — two concurrentgh-pagespushes, and mike refuses a deploy when its local view of the branch is behind the remote.mikeis added to thedocsdependency group anduv.lock—make installrunsuv sync --frozen, so a lockfile-only omission would have left CI without mike.Backfilling old versions (not in this PR)
Per review, the run-once backfill script and its instructions are not merged here. It lives outside the repos and will be run by hand once this merges. Copilot's finding on it — the throwaway worktree path was keyed by the derived
X.Yrather than the tag, so two tags sharing a minor collided — is fixed in that copy.Required one-time migration
Merging this is safe on its own: the first
devdeploy addsdev/andversions.jsonwhile the old flat site keeps serving from the branch root, so there's no breakage window. But the pre-mike files stay at that root and the rootindex.htmlremains the old site, so the cutover needs one manual run after merge:make docs-deploy-releaseis deliberately not used here: it builds the working tree, which is right inrelease.yml(that job checks out the release tag) but wrong during migration, where main is ahead of the newest tag. Verified — using it rebuilt1.0from main and put content in it that was never inv1.0.0.This rebuilds the branch rather than deleting leftovers — the old workflow force-pushed an orphan commit on every deploy, so there's no history to keep. GitHub Pages settings need no change (still
gh-pages, root).Testing
Run locally against throwaway branches, since these workflows can only be exercised for real on
main:make docs-build— clean.make docs-deploy-dev+make docs-deploy-release DOCS_VERSION=1.0— produced the expected root (.nojekyll,1.0,dev,index.html,latest,versions.json), aversions.jsonlistingdevand1.0 [latest], and a rootindex.htmlredirecting tolatest/.gh-pages— confirmed it succeeds and leaves the old site intact, which is what the migration section above addresses.🤖 Generated with Claude Code