Skip to content

Review fixes: filename-agnostic gather, custom domains, smoother migration, Sphinx support#42

Merged
coretl merged 3 commits into
mainfrom
review-fixes
Jul 3, 2026
Merged

Review fixes: filename-agnostic gather, custom domains, smoother migration, Sphinx support#42
coretl merged 3 commits into
mainfrom
review-fixes

Conversation

@coretl

@coretl coretl commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes from a full repo review, ahead of adopting the workflows in Sphinx-based repos (python-copier-template) and newer mystmd projects.

Workflows

  • Gather by artifact name, not workflow filename. publish.yml found branch/PR builds by querying runs of a hardcoded ci.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 named docs (the existing contract), filtered by workflow_run.head_branch/head_sha, with head_repository_id checked 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 existencedocs.yml only uploads after a successful build, so this is arguably the truer signal.
  • Custom Pages domains work. The deploy job resolves PAGES_URL from the Pages API (github.io fallback) and threads it into both the _sources restore and assemble.mjs generate --base-url (replacing --repo), so switcher.json URLs are no longer hardcoded to *.github.io.
  • Prerelease detection anchored to a digit (1.0a1/2.0rc1 yes; release-1.0/beta-program no) in assemble.mjs, release.yml, and migrate.sh's new create path — kept in parity, with tests for the negatives.
  • docs.yml exports VERSION_NAME alongside BASE_URL, so a Sphinx conf.py can set pydata-sphinx-theme's switcher version_match without parsing it out of a path.

Migration (scripts/migrate.sh)

  • Backfill creates a Release when a tag has a gh-pages dir 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.
  • Will-DROP report: the script now prints exactly which live switcher.json versions 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>.zip goes 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/).
  • gh-pages is deleted via the API rather than git push --delete (no git credential-helper dependency in the temp clone); the clone is now blobless.

Docs

  • New how-to: use with Sphinx — pydata-sphinx-theme reads the same pydata-format switcher.json, so Sphinx repos need no plugin; includes the conf.py/ci.yml wiring and a note that this will be rolled into a later python-copier-template release.
  • Docs warnings are now errors: 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 in architecture.md fixed (would have been caught by this).
  • Drift swept: package.json files/description, CLAUDE.md paths and PAGES_URL wording, stale fork-warn mentions in docs.yml/reference.

npm test (24 checks), biome, and the strict docs build are all green.

🤖 Generated with Claude Code

…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.
@coretl coretl temporarily deployed to github-pages July 3, 2026 09:03 — with GitHub Actions Inactive
Too much complexity (custom-domain caveat, doubled REPO bug) for a
migration doc; the switcher config alone is enough to get going.
@coretl coretl temporarily deployed to github-pages July 3, 2026 10:41 — with GitHub Actions Inactive
@coretl coretl merged commit a83c963 into main Jul 3, 2026
31 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant