ci: rebuild the example dashboard for the dev docs (#358) - #359
Merged
Merged
Conversation
The docs site copies the committed example/robot_dashboard.html of the version it builds. For a release that is what it should do, but /dev/ documents unreleased main, where that file is behind by every merge since the last release: it was 7 commits stale and showed none of the features its own documentation describes. Every version is built in a temporary git worktree, so the rebuild happens inside the dev worktree, before copy-static.mjs copies the example into docs/public. scripts/example.py runs the package from source with that worktree as cwd, so the example is produced by the very code the docs next to it describe, and the worktree is thrown away afterwards, leaving example/ in the checkout untouched. The deploy workflow gains a python and a pip install step, which is what the rebuild needs: the dependencies of the package, not the package. A build without a usable python keeps the committed example and says so, which is fine locally but would silently bring the stale example back in CI, so there it fails instead. --no-example (DOCS_SKIP_EXAMPLE) skips the rebuild for quick local iteration. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
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 #358
Problem
scripts/docs/copy-static.mjscopies the committedexample/robot_dashboard.htmlof whatever version it is building. Released versions should indeed serve the example their own code produced, but/dev/documents unreleasedmain, where that file is only refreshed when a release is cut — it was 7 commits stale, so the/dev/example had none of the section tracks, the modal fixes or the date histogram that the/dev/docs describe right next to it.Fix
The
devbuild now rebuilds the example from its own worktree before the docs are built.rebuild_example()runsscripts/example.pyinside the dev worktree, right beforecopy-static.mjscopies the example intodocs/public.scripts/example.pyruns the package from source (python -m, cwd first onsys.path), so the example is produced by the very code the docs next to it describe.example/keeps whatever the release committed. Released versions are untouched.deploy.ymlgains a Python and apip install .step — the rebuild needs the package's dependencies, not the package.Behaviour when Python is missing
A docs build is not worth a Python install locally, so a missing interpreter (or one without
robotframework) keeps the committed example and logs why. In CI the same situation would silently bring the stale example back, so there it fails instead (process.env.CI).--no-example/DOCS_SKIP_EXAMPLE=1skips the rebuild deliberately, which is handy for quick local iteration.Verified locally
The built
dev/example/robot_dashboard.htmlcontains the date histogram; the committedexample/robot_dashboard.htmlstill does not, and the checkout stayed clean.--no-examplelogs the skip and builds in 4.8 s.Notes
devis never served from the docs build cache, so the rebuild runs on every deploy: about 20 s added to the job.scripts/example.pyis still run and committed when cutting a release, which is what every/vX.Y.Z/serves. Noted in thereleaseanddev-workflowskills and inCONTRIBUTING.md.🤖 Generated with Claude Code