Review fixes: filename-agnostic gather, custom domains, smoother migration, Sphinx support#42
Merged
Conversation
…mains, smoother migration, Sphinx support Robustness fixes from a full repo review, ahead of adoption by Sphinx (python-copier-template) and mystmd projects: - publish.yml gathers branch/PR builds via the artifacts API by artifact NAME (docs), not by a hardcoded ci.yml workflow filename — the consumer's entry workflow can be called anything. Artifact existence is the success signal (docs.yml only uploads after a successful build). - The Pages base URL is resolved from the Pages API (custom domains work) and exported as PAGES_URL; assemble.mjs generate takes --base-url (replacing --repo) so switcher.json and the _sources restore share it. - Prerelease detection is anchored to a digit (1.0a1 yes, release-1.0 no) in assemble.mjs, release.yml, and migrate.sh — kept in parity. - docs.yml exports VERSION_NAME alongside BASE_URL so a Sphinx conf.py can set pydata-sphinx-theme's switcher version_match directly; new how-to/use-with-sphinx.md documents the Sphinx setup (to be folded into a python-copier-template release later). - migrate.sh: backfill now CREATES a Release when a tag has a gh-pages dir but no Release (makes fork rehearsals faithful — forks copy tags, not Releases); prints a will-DROP report instead of leaving the operator to diff plans by eye; --seed-from <dir> for oddly-named default-branch dirs; --wait polls the finalize guard; gh-pages is deleted via the API (no git credential-helper dependency); blobless clone. - Docs build is now strict: myst build --strict + error_rules escalate broken links/xrefs to build failures (two pre-existing broken anchors in architecture.md fixed). - Drift swept: package.json files/description, CLAUDE.md paths and PAGES_URL wording, stale fork-warn mentions in docs.yml/reference. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gh CLI rejects --paginate --slurp combined with -q/--jq ("the --slurp
option is not supported with --jq or --template"), which broke the
"Gather branch CI artifacts" step on every publish deploy. Drop -q and
pipe the paginated (multi-document) output through `jq -rs` instead —
same flattening logic, raw string output to match gh's previous -q
behavior.
Too much complexity (custom-domain caveat, doubled REPO bug) for a migration doc; the switcher config alone is enough to get going.
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.
Fixes from a full repo review, ahead of adopting the workflows in Sphinx-based repos (python-copier-template) and newer mystmd projects.
Workflows
publish.ymlfound branch/PR builds by querying runs of a hardcodedci.yml; a consumer naming their entry workflow anything else got silent degradation (stale default branch, no PR previews). It now queries the artifacts API for non-expired artifacts nameddocs(the existing contract), filtered byworkflow_run.head_branch/head_sha, withhead_repository_idchecked on the default-branch gather so a same-named fork branch can't shadow it. Note the success signal shifts from run conclusion to artifact existence —docs.ymlonly uploads after a successful build, so this is arguably the truer signal.PAGES_URLfrom the Pages API (github.io fallback) and threads it into both the_sourcesrestore andassemble.mjs generate --base-url(replacing--repo), soswitcher.jsonURLs are no longer hardcoded to*.github.io.1.0a1/2.0rc1yes;release-1.0/beta-programno) inassemble.mjs,release.yml, andmigrate.sh's new create path — kept in parity, with tests for the negatives.docs.ymlexportsVERSION_NAMEalongsideBASE_URL, so a Sphinxconf.pycan set pydata-sphinx-theme's switcherversion_matchwithout parsing it out of a path.Migration (
scripts/migrate.sh)gh-pagesdir but no Release (created-with-asset, so immutable-safe; prerelease-flagged). This makes the fork rehearsal faithful — forking copies tags but not Releases, so previously every released version dropped on the floor — and covers repos that tag without releasing.switcher.jsonversions the new model won't serve, instead of asking the operator to diff the backfill plan against the probe list by eye.--wait(with--delete-gh-pages) polls the guard until_sources/<default>.zipgoes live (30 min cap), so finalize can run right after merging the pipeline PR.--seed-from <dir>for old sites that published the default branch's docs under another name (e.g.latest/).git push --delete(no git credential-helper dependency in the temp clone); the clone is now blobless.Docs
switcher.json, so Sphinx repos need no plugin; includes theconf.py/ci.yml wiring and a note that this will be rolled into a later python-copier-template release.myst build --strict+error_rules(pattern from PandABlocks-server). Verified both ways — clean build passes, an injected broken anchor fails the build. Two pre-existing broken anchors inarchitecture.mdfixed (would have been caught by this).package.jsonfiles/description, CLAUDE.md paths andPAGES_URLwording, stale fork-warn mentions indocs.yml/reference.npm test(24 checks), biome, and the strict docs build are all green.🤖 Generated with Claude Code