Skip to content

ci(docs-versioning): improve documentation versioning and publishing reliability - #544

Open
jchong9 wants to merge 12 commits into
apache:mainfrom
jchong9:docs/improve-docs-versioning
Open

jchong9 wants to merge 12 commits into
apache:mainfrom
jchong9:docs/improve-docs-versioning

Conversation

@jchong9

@jchong9 jchong9 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds multi-version documentation publishing and improves version navigation. It builds the shared documentation tree and versioned documentation slices with consistent navigation, validates version manifests and prepared links, and assembles the generated site into gh-pages. Versioned pages use /latest/ canonical URLs, and the sitemap index lists the shared and latest sitemaps. Deploy retries reuse built artifacts when gh-pages moves, while CI checks release overwrite safety before the deploy build, supports manual dry runs from branches, and scopes push credentials.

Search behavior is unchanged in this PR; the build only checks that each documentation slice produced search.json.

Related issue: #436
Previous PR: #489

Details

  • Build shared and versioned documentation with consistent navigation, validated manifests, prepared links, version redirects, and a sitemap index.
  • Set site_url in zensical-versioned.toml to /latest/, so Zensical emits latest canonical URLs without per-target config rewriting while artifacts still publish to version-specific directories; publish the latest version sitemap alongside the shared sitemap.
  • Build each slice once within the deploy job and reuse its artifacts for assembly and retries when gh-pages changes.
  • Improve version navigation with an accessible button, explicit expanded state, Escape and outside-click handling, and a visible keyboard focus outline.
    • Because the version selector changed from a link to a button, the dropdown no longer opens on hover by default. We can restore hover-to-open, but keeping it click-to-open feels more intentional and reduces visual noise.
  • Add CI safeguards for release downgrade checks, branch dry runs, and scoped publishing credentials.
  • Verify that each build produces search.json; version-aware search is handled separately.
  • Update zensical-unversioned.toml to use relative paths for unversioned pages so Zensical can recognize the active page for navigation.

Visual changes from the config update

BEFORE ON THE HOME PAGE:
image

AFTER:
image

Testing
  • Ran a Zensical build check.
  • Ran make docs-ci locally.
  • Checked links in the generated site.

@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch from d0e8c3c to 5c780b2 Compare November 22, 2026 06:08
@codecov-commenter

codecov-commenter commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (9ece3cd) to head (61e8b4a).
⚠️ Report is 1 commits behind head on main.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch 7 times, most recently from b3a34dc to 53275aa Compare November 23, 2026 06:20
@villebro

Copy link
Copy Markdown
Member

@jchong9 could you add some screenshots to give a general feel for the changes introduced by this PR?

@jchong9

jchong9 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@villebro Will do! I actually plan to reduce the scope of this PR to purely improving the build and guardrails for the docs workflow, and move the version-aware search into a separate PR, so it might be better to add screenshots there.

The motivation for leaving it out is that the current implementation only searches shared content plus the latest version, so any text specific to a version thats not latest (when the user has selected that version) won't show up and imo defeats the purpose of the search. To fix this, I would need to inject JS and swap the search indexes, which seems like too much to cram into one PR.

@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch 4 times, most recently from 4575ad5 to 9c83d41 Compare November 24, 2026 03:31
@jchong9
jchong9 marked this pull request as ready for review November 24, 2026 04:02
@jchong9 jchong9 changed the title ci(docs-versioning): improve versioned search and publishing ci(docs-versioning): improve documentation versioning and publishing reliability Nov 24, 2026
@jchong9

jchong9 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@villebro @younsl This PR should be ready for review! It addresses the non-blocking feedback from #489 and focuses on documentation build, versioning, and publishing reliability, with no changes to the website's visual design. Please let me know if anything looks off or needs adjusting!

@younsl younsl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up on the feedback from #489. The build and assemble split, the retry loop that reuses saved artifacts, the site_url check after the rewrite, the root sitemap index, the nav consistency test, and the scoped push credentials all look right to me.

I found nothing blocking. This is a read-through review only: the Docs, CI, and Test workflows on this PR are still waiting for maintainer approval, so nothing has run against the head commit yet, and I did not build it locally this time. I would like to see a green Docs run (including the new dry-run assemble step) before approving.

What I checked by reading:

  • The live versions.json on gh-pages (0.4 with latest, plus main) passes the stricter load_manifest rules, so the first deploy after merge will not be rejected.
  • The root rsync removes sitemap-root.xml on every root build and finalize creates it again from the fresh urlset, so the index stays consistent. There is no sitemap.xml.gz on gh-pages that could go stale.
  • search.json exists at the root and in each version today, so the new existence check matches what Zensical writes.
  • navigation.instant is not enabled and the theme bundle exposes document$, so removing the MutationObserver is safe.
  • The theme reset already clears the default button background, so the button swap should not change the look.

One thing worth fixing in this PR (inline): the version toggle sets aria-expanded and a md-version--active class, but the theme has no style for that class, so the reported state and the visible state can disagree.

The other inline comments are small and fine as follow-ups.

Two notes on the description:

  • It still lists search indexes under Details. Since version-aware search moved to a separate PR, the only search change here is the search.json existence check. Could you update the text?
  • The path filter for docs/stylesheets/version-banner.css was removed, which is fine because docs/** already covers it.

Comment thread docs/javascripts/version-switcher.js Resolved
Comment thread scripts/docs_versions.py Resolved
Comment thread scripts/docs_versions.py Resolved
Comment thread scripts/prepare_docs_links.py Resolved
Comment thread scripts/publish-docs.sh Resolved
Comment thread scripts/publish-docs.sh Resolved
Comment thread .github/workflows/docs.yml Resolved
Comment thread .github/workflows/docs.yml Resolved
Comment thread scripts/test_docs_scripts.py Resolved
@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch 2 times, most recently from bf964c9 to 73dfa41 Compare November 26, 2026 07:43
@jchong9

jchong9 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review @younsl. I addressed your non-blocking feedback in 19c1fa0, 08869a1, c77ab87, and bf964c9. One thing to note is that I set site_url in zensical-versioned.toml to /latest/, so Zensical generates the canonical URLs directly and the sed/grep rewrite is no longer needed. I also removed canonical links from redirect stubs and updated the sitemap index to include the shared and latest sitemaps.

The PR description has been updated to reflect these changes as well.

@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch 2 times, most recently from b521475 to 61e8b4a Compare November 28, 2026 03:59
…ith relative paths

With absolute paths, tabs in the navigation are not highlighted despite being the active page. Adjusting unversioned pages to use relative paths allows Zensical to recognize files again
ci(docs): validate and assemble documentation builds

fix paths
fix ordering

fix(docs): harden versioned publishing and link preparation

fix(scripts): include configs in local build script

fix(test): add missing site path in test

fix: remove versioned search related code

fix: remove versioned search related code

fix: remove versioned search related code
fix(docs): preserve selector links when switching versions

fix(docs): add detailed error msg instead of using a shared function

fix: remove versioned search related code
readd original paths

fix: mask auth header
@jchong9
jchong9 force-pushed the docs/improve-docs-versioning branch from 61e8b4a to a4282ae Compare November 29, 2026 04:02

This branch has not been deployed

No deployments
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.

4 participants