Repository navigation
ci(lecture-validation): retry a failed HTML build once with --all; restore lecture-python-programming to the matrix - #203
Conversation
…store lecture-python-programming to the matrix Fixes #102. Several lectures fetch a dataset from raw GitHub in a hidden cell at build time, and with the matrix building several repos at once from shared runner IPs that fetch is sometimes refused with HTTP 429. It is transient (the same notebook passed on the other container in the same run), but nothing in the stack retries it, so one 429 failed the leg and, off the weekly workflow_run trigger, filed a CI-failure issue. The "Build HTML" step gets an id and continue-on-error, and a second attempt runs when its outcome is failure, with its own failure-artifact-name (a run cannot hold two artifacts of one name). Between the two, a step clears the first attempt's reports directory, whose contents are already in that attempt's artifact, and records the retry in the job summary so a green leg still shows it happened. The retry passes --all. A plain second `jb build -W --keep-going` after a failed one is not a retry: the saved Sphinx environment counts every page as up to date, so it reads nothing, re-executes nothing, re-emits no warning and exits 0 with the traceback still in the page. Measured on a fixture with jupyter-book 1.0.4post1 / myst-nb 1.4.0: a persistent execution failure and a warning-only failure both "passed" on a plain rebuild, and the failed notebook was not re-run. With --all every page is re-read and every warning re-checked, while execute_notebooks: cache still spares the notebooks that executed (the cached one stayed at one execution; only the failed one ran again), and a persistent failure fails the retry. lecture-python-programming returns to the matrix. The February 2026 rewrite (81e96ff) dropped it without a note, unlike lecture-jax, while CONTAINER-VALIDATION.md and TESTING.md went on describing four repos. Those docs now list it under its current name, and CONTAINER-VALIDATION describes the retry. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd
The #102 row names the PR and what it does (a failed HTML stage rebuilt once with --all, lecture-python-programming back in the matrix), notes #144 as the earlier open PR for the same issue, and the "Last updated" header gains a 2026-09-28 entry. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The change alters the critical validation workflow and its correctness depends on runtime --all/jupyter-cache and continue-on-error behavior that cannot be exercised by a PR and requires the maintainer workflow_dispatch validation the issue mandates.
Review effort: Balanced
Findings: None
What changed in this PR
This PR hardens the test-containers-lectures.yml validation workflow against transient raw-GitHub HTTP 429 failures (issue #102) and restores a matrix repo that was silently dropped. The HTML build stage now runs once with continue-on-error, and on failure a second attempt rebuilds with --all (a fresh Sphinx environment) so that persistent failures still fail while transient ones — whose notebooks are absent from the surviving jupyter cache — are re-executed and pass. It fits the repo's ongoing CI-reliability work and pairs the fix with lecture-python-programming being added back to the matrix (which itself has raw-GitHub fetches and depends on this retry).
Changes:
- Add
id/continue-on-errorto the HTML build step, a report-clearing + job-summary step, and a gatedBuild HTML (Retry)step usingextra-args: -W --keep-going --allwith a distinctreports-html-retry-*artifact name. - Restore the
lecture-python-programmingmatrix entry with an explanatory comment. - Update CHANGELOG, PLAN, CONTAINER-VALIDATION, and TESTING docs (retry description + repo rename to the non-
.mystname).
| File | Description |
|---|---|
.github/workflows/test-containers-lectures.yml |
Adds the retry mechanism (id, continue-on-error, clear-reports step, --all retry with distinct artifact name) and restores the lecture-python-programming matrix row. |
CHANGELOG.md |
Two Unreleased / Fixed entries documenting the retry and the restored matrix repo. |
docs/dev/CONTAINER-VALIDATION.md |
Describes the two-attempt HTML stage, lists the four-repo matrix, and renames the repo. |
docs/dev/TESTING.md |
Renames lecture-python-programming.myst → lecture-python-programming. |
docs/dev/PLAN.md |
Updates the "Last updated" note and the #102 backlog row to reference this PR (#203). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… it (#214) * docs(plan): record #102 as closed by #203, and the run that exercised it The #102 row still said to review #203 and to validate it with a maintainer dispatch after merge, and called #144 open. #203 merged on 2026-09-28 and closed #102, and #144 was closed unmerged. The weekly matrix run the same day (36370003884) did the validation the row asked for. Six of eight legs passed, lecture-python-programming on both images among them. Both lecture-python.myst legs failed the retry on bayes_nonconj alone, which is the retry working as intended: a persistent failure still fails the leg. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SUGTRULyyM87pug2MckrXo * docs(plan): cite the lecture-side fix, not the CI alert, in the #102 row The row said bayes_nonconj's fix belongs in lecture-python.myst and then cited #159, which is this repo's CI-failure alert for the red matrix, not that fix. It now links lecture-python.myst#1065 for the fix and names #159 as what tracks the red matrix. Raised in Copilot's review. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SUGTRULyyM87pug2MckrXo --------- Co-authored-by: Claude <[email protected]>
Fixes #102. Built independently of #144, which was not consulted.
What changes
test-containers-lectures.ymlid: build-htmlandcontinue-on-error: true. A Build HTML (Retry) step runs onsteps.build-html.outcome == 'failure', withextra-args: -W --keep-going --alland its ownfailure-artifact-name(reports-html-retry-<container>-<repo>):build-lecturesuploads the reports under that name on failure, and a run cannot hold two artifacts of one name.run:step clearslecture-repo/_build/html/reports(its contents are already in the first attempt's artifact, so a retry that also fails reports only what failed on the retry) and writes one line to the job summary, so a leg that went green only on retry still shows it happened.lecture-python-programmingis back in the matrix, with a comment saying when and how it left. The February 2026 rewrite (81e96ff) dropped it without a note, unlikelecture-jax.Docs:
docs/dev/CONTAINER-VALIDATION.mddescribes the retry and lists the four-repo matrix; it anddocs/dev/TESTING.mdname the repo by its current name (the old.mystrows were the "4-repo claims" the issue cites). CHANGELOG entries under Unreleased / Fixed.docs/dev/PLAN.md's #102 row records this PR.Why the retry passes
--allThe issue proposes a plain second run of the step. I checked what that does on a fixture with
execute_notebooks: cache, jupyter-book 1.0.4post1 / myst-nb 1.4.0 / Sphinx 7.4.7, with a notebook that raises unless a flag file exists (a stand-in for the 429) and a counter that records each execution:--allAfter a failed
-W --keep-goingbuild the saved Sphinx environment counts every page as up to date, so a plain rebuild reads nothing, re-emits no warning and exits 0. A plain retry would therefore have passed every persistent failure, which is the opposite of the issue's acceptance criterion.--all(jupyter-book's flag for a fresh Sphinx environment) re-reads every page and re-checks every warning, while the jupyter cache in_build/.jupyter_cachestill spares the notebooks that executed, so the retry re-executes only what failed. The harness already hints at this:build-fail-guardnotes that "a stale err.log survives an incremental rebuild that exits 0".The cost is one non-executing Sphinx pass over the repo on a retried leg. For
lecture-python.mystthat fits inside its 180-minute ceiling from #197; a leg that overran would still be cancelled and alerted exactly as today.Verified
actionlintclean on the workflow; YAML parses with the intended step chain (id,continue-on-error, the two gated steps, distinct artifact names).--all, usingbuild-lectures' command shape withlecture-repo/lecturesand--path-output lecture-repo) run on the fixture for both a transient and a persistent failure: the transient case ends green with the reports directory gone and the log showingUsing cached notebookfor the good notebook and a re-execution of the failed one; the persistent case ends red naming only the failing notebook.Not verified here
workflow_runandworkflow_dispatch, so this PR cannot exercise it. Per the issue's third checkbox, a maintainerworkflow_dispatchafter merge validates it; the first weekly run after that exerciseslecture-python-programmingon the images.execute_notebooks: cacheis taken from the issue (it is what already lets stages 2 and 3 skip execution). Under any other mode the retry would still be correct, only slower.Notes
::error::annotation and traceback still appear in the log. That is deliberate: it, thereports-html-<container>-<repo>artifact and the job-summary line are how a flake stays visible.docs/MIGRATION-GUIDE.md,docs/QUICK-REFERENCE.mdandcontainers/README.mdstill uselecture-python-programming.myst; they make no matrix claim, so they were left for a docs sweep.🤖 Generated with Claude Code
https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd