Skip to content

chore(ci): try to enable selector by fixing versions.json#39

Open
danceratopz wants to merge 13 commits intomainfrom
fix-versions-json-syntax
Open

chore(ci): try to enable selector by fixing versions.json#39
danceratopz wants to merge 13 commits intomainfrom
fix-versions-json-syntax

Conversation

@danceratopz
Copy link
Copy Markdown
Member

@danceratopz danceratopz commented Jan 21, 2026

Fix three issues with the docs aggregation pipeline.

  • Filter artifact download by event type (push, workflow_dispatch) so PR
    runs -- which succeed but produce no artifacts -- are skipped.
  • Replace Material's built-in version selector with a custom one that
    supports multi-depth branch paths (e.g. forks/amsterdam, devnets/amsterdam/2).
    Material's selector breaks because it extracts only the last URL segment
    and navigates via relative paths.
  • Replace the rsync mirror of the default branch to /docs/ with a
    meta-refresh redirect to /docs/forks/amsterdam/.
  • Extract post-staging assembly (inject selector, generate versions.json,
    generate redirects) into scripts/assemble-docs.py, called by both the
    workflow and a new local testing script (scripts/local-assemble.py).

Material's built-in version selector (provider: mike) breaks for
multi-depth branch paths because it extracts only the last URL segment
and navigates via relative paths. Add a custom selector that uses
absolute paths for both version matching and navigation.

- scripts/version-selector.js: custom selector using Material's CSS
  classes, fetches /docs/versions.json and navigates to absolute URLs.
- scripts/assemble-docs.py: post-staging assembly (inject selector,
  generate versions.json with url fields, generate redirect HTML).
- scripts/local-assemble.py: local testing harness that stages
  artifacts and runs assembly, with optional --serve flag.
PR runs (pull_request event) succeed but don't produce artifacts. When a
PR run is newer than the push run, gh run list picks it up and the
download fails silently. Filter by --event push first, falling back to
workflow_dispatch, so only artifact-producing runs are selected.
Replace three post-staging bash steps (mirror to /docs/ root, generate
versions.json, copy versions.json to intermediate dirs) with a single
call to scripts/assemble-docs.py. The script injects a custom version
selector, generates versions.json with explicit url fields, and writes
meta-refresh redirects at /docs/ and /docs/spec/ instead of mirroring.
Add experiments/publish-docs and experiments/publish-docs-test to
BRANCH_CONFIG. Both have recent successful artifact builds, giving two
deployed versions to test the version selector switching with. Set the
default to experiments/publish-docs.
Push to main and repository_dispatch from execution-specs already cover
the real triggers. A daily fallback mostly burns Actions minutes and can
paper over a missed dispatch rather than surfacing it.
Stable permalink that tracks the current default branch so external
links survive the rollover from e.g. forks/amsterdam to forks/bogota.
/docs/ and /docs/spec/ forward through the permalink for backward
compatibility. Spec redirect target updated to specs/reference/ to
match the current branch layout.
/docs/ is now a Zensical-built landing page at docs/docs/index.md with a
section for execution-specs linking to the Amsterdam fork docs. The old
/docs/ and /docs/spec/ forwarders are removed since the site is not live;
only the /docs/default/ permalink remains for stable cross-rollover links.
Stages artifacts under site/docs/execution-specs/<branch>/ and publishes
URLs as /docs/execution-specs/<branch>/. The permalink moves to
/docs/execution-specs/default/ so rollovers only rebind within the
product. Done before the site goes live so no external links break.

versions.json entries now carry the full /docs/ path-suffix in their
version field, keeping version-selector.js unchanged. local-assemble.py
grows a PRODUCT constant that mirrors the workflow env var.
Drops the /default/ segment — the product root itself redirects to the
current default branch. Shorter URLs with no loss of function.
Drops the experiments/ test branches now that the real fork and devnet
are ready. Default branch is forks/amsterdam.
Single source of truth for product, default_branch and branches[]. CI
loads it via mikefarah yq (preinstalled on ubuntu-latest) into
GITHUB_ENV; local-assemble.py loads it via pyyaml. Removes the two-place
drift hazard between deploy.yml and local-assemble.py.
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