ci(docs): build the documentation on documentation-relevant pull requests - #875
Merged
Conversation
…ests The Documentation workflow was reachable only through the 'run documentation' label, and in practice the label was never applied: the twelve pull requests of the v2.1 documentation rewrite all merged with the job skipped, so the site has never been built end to end in CI. Filter the pull_request trigger on the paths the built site actually depends on -- the pages, the docstrings pulled into the generated API reference, the compat bounds the doc environment resolves against, and this workflow itself. Every event that now reaches the job is documentation-relevant, so the label stops being a gate and stays only as a manual re-run handle. A pull request touching none of those paths can no longer reach the job at all. That is deliberate: it cannot change what the site renders. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
make.jl sets draft = true globally and every content page opts out with its own `Draft = false` meta. index.md was the one page that never did, so its five @example blocks -- the "Basic usage" model/solve/plot and the three reproducibility blocks -- had never been evaluated: the page rendered its code without output and without a figure. Checked against a real build: the block now produces the plot, and solve(ocp) without display=false does not push the Ipopt log above it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 23, 2026
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.
Why
Documentation.ymlis the only job that executes the@exampleblocks and resolves the@ref/@extreflinks, so it is the only check that can catch a broken page. It was reachablesolely through the
run documentationlabel — and in practice the label was never applied:The twelve PRs of the v2.1 documentation rewrite merged without a single build. Building the site
locally on this branch shows what that let through — see "What the first build found" below.
What changes
1. The docs build runs on documentation-relevant pull requests. A
pathsfilter on thepull_requesttrigger covers everything the built site depends on:docs/**— the pages,make.jl, the doc environmentsrc/**— the docstrings pulled into the generated API referenceProject.toml— the compat bounds the doc environment resolves against.github/workflows/Documentation.yml— so a change to this file validates itselfThe
if:condition drops the label gate, since every event that now reaches the job is alreadydocumentation-relevant. It keeps one guard:
labeledfires once per label added, so reacting toany label would re-run the job on every subsequent label.
2.
docs/src/index.mdgetsDraft = false.make.jlsetsdraft = trueglobally and everycontent page opts out individually — the landing page was the one that never did, so its five
@exampleblocks had never executed. With the meta in place the "Basic usage" block evaluates andthe landing page renders its figure. (Checked in the built output:
solve(ocp)withoutdisplay=falsedoes not dump the Ipopt log above the plot, which was the one risk worthlooking at.)
Trade-off, deliberately taken
A pull request touching none of the four paths above can no longer reach this job, not even with
the label. That is the intended consequence: such a PR cannot change what the site renders. The
label survives as a manual re-run handle on PRs that do match.
This widens CI slightly —
src/**changes now build the docs where before they did not. That isthe point: a docstring-only change can break the generated API reference, and nothing else
catches it.
What the first build found
Built locally on this branch: 786 log lines, 12 errors, 186 warnings, zero failing
@exampleblock, exit code 0. Three things worth recording, none of them fixed here:
solve/choosing-a-method.mdpublishes anUndefVarError. Noocpis defined anywhere onthe page, and both
try/catchblocks swallow it. The rendered page reads: "…so this raisesAmbiguousDescriptionrather than silently picking one:" followed byUndefVarError(:ocp, 0x000000000000b0e3, Main). Same again eighty lines down, under"confirmed live".
flows/overview.md's "no integrator loaded" demo cannot fail.make.jlloadsOrdinaryDiffEqat startup, so thetryblock succeeds and the page renders a fullyconstructed
OptimalControlFlowwhere it promises anExtensionError.@ref, all indocs/src/api/*— 45 inflows.md, 34 intypes.md, 29 inproblem.md, 15 inqualified.md. Zero in the hand-written guide pages. Root cause is atleast partly that
docs/inventories/holds onlyExaModels.tomlandMadNLP.tomlwhilemake.jlreferences twelve inventories; the other ten fail to load and fall back to remoteURLs, which is also what produces the two hard errors on
api/internals.md.Note on
warnonlymakedocsruns withwarnonly=true, so the build exits 0 despite all of the above. A greencheck on this job does not yet mean the site is sound. Tightening
warnonlyis what turns thisinto a real guard, but it has to wait until the 166
@refbacklog is cleared — doing it now wouldleave CI permanently red. Deliberately untouched here.
Verification
This PR touches
docs/src/index.mdand the workflow file itself, so it triggers its own build.Locally:
julia --project=docs docs/make.jlexits 0, no@exampleblock fails, and no trackedfile is modified by the build.