Repository navigation
ci(book): build the book on pull requests, deploy only from main - #744
Merged
Merged
Conversation
The book was the only documentation surface without warnings-as-errors. The Rust
docs gate builds under RUSTDOCFLAGS="-D warnings" and says why -- to keep broken
intra-doc links from accumulating silently -- while sphinx-build ran bare, so a
broken cross-reference, a malformed directive, or a page dropped from a toctree
exited 0 and published.
Appending one dangling link to index.md shows the gap:
$ sphinx-build -b html cuda-oxide-book _build # before
build succeeded. # exit 0, publishes
$ sphinx-build -W --keep-going -b html cuda-oxide-book _build
WARNING: 'myst' cross-reference target not found: 'does-not-exist.md'
# exit 1
`--keep-going` reports every warning in one run rather than stopping at the
first, which matters when a rename breaks several references at once.
The book is already clean, so this costs nothing now: with the pinned
requirements the flagged build exits 0 on main with zero warnings. The Makefile
gets the same default so `make html` catches locally what CI would catch, and it
stays overridable for a draft build with `SPHINXOPTS= make html`.
Note requirements.txt uses `>=`, so CI floats to the newest Sphinx and a release
that adds a deprecation warning would fail this. Pinning the Sphinx major would
remove that exposure if it is unwanted.
Closes NVIDIA#732
Signed-off-by: Vyncint Ng <[email protected]>
book.yml had no `pull_request` trigger, so the book was built only after merge. Every other content gate -- ci, docs, examples-compile, codeql, naming-guard, status-guard -- runs on PRs. A pull request that broke a cross-reference, a directive or a toctree entry therefore reached main unchallenged, and the first signal was a failure on the branch everyone builds from. Adding the trigger is not sufficient on its own. This is a deployment workflow: it holds `pages: write` / `id-token: write` and a deploy job, which is presumably why it was push-only, and a naive trigger would attempt a Pages deploy from every pull request. So `deploy` is gated on `github.event_name != 'pull_request'`: a PR builds the book to prove it is sound and stops there, never touching the Pages environment. The workflow-level `concurrency: group: pages` needed the same care. It exists to serialise deploys, and leaving it workflow-wide would queue unrelated PR builds behind each other. It moves onto the deploy job, where the constraint actually applies, and the workflow-level group becomes ref-scoped. Superseded PR runs are cancelled; pushes to main are not, so a publish in flight is never interrupted. Stacked on NVIDIA#733: with `-W` in place a PR build now fails on a warning instead of publishing one, which is the half that makes this trigger worth having. Closes NVIDIA#743 Signed-off-by: Vyncint Ng <[email protected]>
… major Pull requests now run the build job, so the workflow-level token they receive should hold checkout rights only; `pages: write` and `id-token: write` move onto the deploy job, the only place they are used. With `-W` gating every PR, an unbounded `sphinx>=7.0` float lets a new Sphinx major redden every PR and the main-branch deploy overnight; bound it below 10 so majors are adopted deliberately.
Collaborator
|
The trigger, deploy gating, and concurrency logic all checked out line by line, and the I pushed a follow-up moving pages:
This closes #743 and #732 together; #733 (whose commit this carries) will be closed as already-fixed. |
This was referenced Aug 10, 2026
nihalpasham
approved these changes
Aug 10, 2026
nihalpasham
pushed a commit
that referenced
this pull request
Aug 12, 2026
Every job in every other workflow carries `timeout-minutes`; `book.yml`'s two were the only unbounded ones in the repo. An unbounded job that hangs -- a wedged `pip install`, a `sphinx-build` that never returns, a Pages deployment waiting on an API that never answers -- runs to GitHub's 6-hour default instead of failing, holding a runner and telling nobody. `build` is 15 minutes: a pip install and one sphinx-build, which settles in about two today, so the bound is generous enough not to trip on a slow runner. `deploy` is 10, since it is one `deploy-pages` action waiting on the Pages API. The `build` job is the one I added in #744 and I left the bound off it, so this is mine to tidy. `deploy` predates that. Verified: with these two, no job in any workflow lacks a bound (`uses:` calls excepted, where the timeout belongs to the callee), and book.yml still parses as YAML. Signed-off-by: Vyncint Ng <[email protected]>
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.
Closes #743.
Stacked on #733 — please review only the second commit (
fix the book build on Sphinx warningsis that PR). The two are halves of the same thing: #733 makesa warning fail the build, and this makes that build actually run before merge.
The gap
book.ymlhad nopull_requesttrigger, so the book was built only aftermerge. Every other content gate runs on PRs:
pull_request?ci.yml,docs.yml,examples-compile.yml,codeql.yml,naming-guard.yml,status-guard.ymlbook.ymlA PR that broke a cross-reference reached
mainunchallenged, and the firstsignal was a failure on the branch everyone builds from. Combined with the
missing
-W, the post-merge run would not have failed either.Why this isn't just adding the trigger
book.ymlis a deployment workflow —pages: write,id-token: write, and adeployjob — which is presumably why it was push-only. A naive trigger wouldattempt a Pages deploy from every pull request.
So
deployis gated ongithub.event_name != 'pull_request'. A PR builds thebook and stops; it never touches the Pages environment, and those write
permissions go unused on that path.
The workflow-level
concurrency: group: pagesneeded the same care. It exists toserialise deploys; left workflow-wide it would queue unrelated PR builds behind
each other. It moves onto the
deployjob where the constraint belongs, and theworkflow-level group becomes ref-scoped with
cancel-in-progressonly for pullrequests — so superseded PR runs are cancelled, while a publish in flight on
mainis never interrupted.Verified
Parsed the workflow and checked the resulting shape rather than eyeballing it:
No GPU needed.